• Home
  • Raw
  • Download

Lines Matching +full:tcon +full:- +full:top

1 /* SPDX-License-Identifier: LGPL-2.1 */
53 * max attribute cache timeout (jiffies) - 2^30
107 #define CIFS_DFS_ROOT_SES(ses) ((ses)->dfs_root_ses ?: (ses))
160 struct shash_desc *hmacsha256; /* hmac-sha256 hash function, for SMB2 signatures */
162 struct shash_desc *aes_cmac; /* block-cipher based MAC function, for SMB3 signatures */
164 struct crypto_aead *enc; /* smb3 encryption AEAD TFM (AES-CCM and AES-GCM) */
165 struct crypto_aead *dec; /* smb3 decryption AEAD TFM (AES-CCM and AES-GCM) */
210 struct smb2_file_all_info *fi = &data->fi; in cifs_open_data_reparse()
211 u32 attrs = le32_to_cpu(fi->Attributes); in cifs_open_data_reparse()
214 ret = data->reparse_point || (attrs & ATTR_REPARSE); in cifs_open_data_reparse()
217 fi->Attributes = cpu_to_le32(attrs); in cifs_open_data_reparse()
223 kfree(data->symlink_target); in cifs_free_open_info()
241 size_t rq_iter_size; /* Amount of data in ->rq_iter */
291 * message field DataRemaining for out-of-band data read (e.g through
321 unsigned int (*negotiate_wsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
323 unsigned int (*negotiate_rsize)(struct cifs_tcon *tcon, struct smb3_fs_context *ctx);
347 struct cifs_tcon *tcon,
352 int (*query_file_info)(const unsigned int xid, struct cifs_tcon *tcon,
356 struct cifs_tcon *tcon,
362 int (*get_srv_inum)(const unsigned int xid, struct cifs_tcon *tcon,
382 umode_t mode, struct cifs_tcon *tcon,
386 struct cifs_tcon *tcon, const char *name,
403 struct cifs_tcon *tcon,
409 struct cifs_tcon *tcon,
415 struct cifs_tcon *tcon,
419 /* open a file for non-posix mounts */
422 /* set fid protocol-specific info */
428 void (*close_getattr)(const unsigned int xid, struct cifs_tcon *tcon,
464 int (*oplock_response)(struct cifs_tcon *tcon, __u64 persistent_fid, __u64 volatile_fid,
487 int (*set_integrity)(const unsigned int, struct cifs_tcon *tcon,
489 int (*enum_snapshots)(const unsigned int xid, struct cifs_tcon *tcon,
541 /* init transform request - used for encryption for now */
553 struct cifs_tcon *tcon,
561 struct cifs_tcon *tcon,
566 int (*fiemap)(struct cifs_tcon *tcon, struct cifsFileInfo *,
600 #define HEADER_SIZE(server) (server->vals->header_size)
601 #define MAX_HEADER_SIZE(server) (server->vals->max_header_size)
602 #define HEADER_PREAMBLE_SIZE(server) (server->vals->header_preamble_size)
603 #define MID_HEADER_SIZE(server) (HEADER_SIZE(server) - 1 - HEADER_PREAMBLE_SIZE(server))
700 /* message size the server can send or receive for non-raw SMBs */
708 __u64 CurrentMid; /* multiplex id - rotating counter, protected by GlobalMid_Lock */
765 bool noblockcnt; /* use non-blocking connect() */
769 * primary_server holds the ref-counted
772 #define SERVER_IS_CHAN(server) (!!(server)->primary_server)
807 mutex_lock(&server->_srv_mutex); in cifs_server_lock()
808 server->nofs_flag = nofs_flag; in cifs_server_lock()
813 unsigned int nofs_flag = server->nofs_flag; in cifs_server_unlock()
815 mutex_unlock(&server->_srv_mutex); in cifs_server_unlock()
829 spin_lock(&server->req_lock); in in_flight()
830 num = server->in_flight; in in_flight()
831 spin_unlock(&server->req_lock); in in_flight()
840 spin_lock(&server->req_lock); in has_credits()
842 spin_unlock(&server->req_lock); in has_credits()
850 server->ops->add_credits(server, credits, optype); in add_credits()
857 if (credits->value) { in add_credits_and_wake_if()
858 server->ops->add_credits(server, credits, optype); in add_credits_and_wake_if()
859 wake_up(&server->request_q); in add_credits_and_wake_if()
866 server->ops->set_credits(server, val); in set_credits()
873 return server->ops->adjust_credits ? in adjust_credits()
874 server->ops->adjust_credits(server, credits, payload_size) : 0; in adjust_credits()
880 return cpu_to_le64(server->ops->get_next_mid(server)); in get_next_mid64()
886 __u16 mid = server->ops->get_next_mid(server); in get_next_mid()
889 * on-the-wire decoding. in get_next_mid()
897 if (server->ops->revert_current_mid) in revert_current_mid()
898 server->ops->revert_current_mid(server, val); in revert_current_mid()
905 unsigned int num = le16_to_cpu(shdr->CreditCharge); in revert_current_mid_from_hdr()
913 return le16_to_cpu(smb->Mid); in get_mid()
919 return mid == le16_to_cpu(smb->Mid); in compare_mid()
924 * we can allow up to 2^24-1, minus the size of a READ/WRITE_AND_X header, not
935 #define CIFS_MAX_WSIZE ((1<<24) - 1 - sizeof(WRITE_REQ) + 4)
936 #define CIFS_MAX_RSIZE ((1<<24) - sizeof(READ_RSP) + 4)
940 * of 2^17-1 minus the size of the call header. That allows for a read or
943 #define CIFS_MAX_RFC1002_WSIZE ((1<<17) - 1 - sizeof(WRITE_REQ) + 4)
944 #define CIFS_MAX_RFC1002_RSIZE ((1<<17) - 1 - sizeof(READ_RSP) + 4)
957 …s.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance
963 * Macros to allow the TCP_Server_Info->net field and related code to drop out
971 return srv->net; in cifs_net_ns()
976 srv->net = net; in cifs_set_net_ns()
1036 unsigned int overrideSecFlg; /* if non-zero override global sec flags */
1081 #define CIFS_INVAL_CHAN_INDEX (-1)
1083 ((1UL << (ses)->chan_count) - 1)
1085 (!(ses)->chans_need_reconnect)
1087 ((ses)->chans_need_reconnect == CIFS_ALL_CHANNELS_SET(ses))
1089 ((ses)->chans_need_reconnect = CIFS_ALL_CHANNELS_SET(ses))
1091 test_bit((index), &(ses)->chans_need_reconnect)
1093 ((ses)->chans[(index)].in_reconnect)
1105 * We will ask for sess and tcon reconnection only if all the
1107 * enable the sessions on top to continue to live till any
1119 return ses->server->vals->cap_unix & ses->capabilities; in cap_unix()
1170 char *password; /* for share-level security */
1225 bool need_reopen_files:1; /* need to reopen tcon file handles */
1235 __u64 snapshot_time; /* for timewarp tokens - timestamp of snapshot */
1259 * This is a refcounted and timestamped container for a tcon pointer. The
1260 * container holds a tcon reference. It is considered safe to free one of
1282 return tlink->tl_tcon; in tlink_tcon()
1288 return cifs_sb->master_tlink; in cifs_sb_master_tlink()
1297 atomic_inc(&tlink->tl_count); in cifs_get_tlink()
1355 #define ACL_NO_MODE ((umode_t)(-1))
1357 struct cifs_tcon *tcon; member
1390 /* following two lists are protected by tcon->open_file_lock */
1391 struct list_head tlist; /* pointer to next fid owned by tcon */
1393 /* lock list below protected by cifsi->lock_sem */
1427 struct cifs_tcon *tcon; member
1445 unsigned int bv_need_unpin; /* If ->bv[] needs unpinning */
1501 * cfile->file_info_lock held.
1506 ++cifs_file->count; in cifsFileInfo_get_locked()
1521 #define CIFS_CACHE_READ(cinode) ((cinode->oplock & CIFS_CACHE_READ_FLG) || (CIFS_SB(cinode->netfs.i…
1522 #define CIFS_CACHE_HANDLE(cinode) (cinode->oplock & CIFS_CACHE_HANDLE_FLG)
1523 #define CIFS_CACHE_WRITE(cinode) ((cinode->oplock & CIFS_CACHE_WRITE_FLG) || (CIFS_SB(cinode->netfs…
1557 u64 server_eof; /* current file size on server -- protected by i_lock */
1576 return sb->s_fs_info; in CIFS_SB()
1582 return CIFS_SB(file_inode(file)->i_sb); in CIFS_FILE_SB()
1587 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) in CIFS_DIR_SEP()
1610 static inline void cifs_stats_bytes_written(struct cifs_tcon *tcon, in cifs_stats_bytes_written() argument
1614 spin_lock(&tcon->stat_lock); in cifs_stats_bytes_written()
1615 tcon->bytes_written += bytes; in cifs_stats_bytes_written()
1616 spin_unlock(&tcon->stat_lock); in cifs_stats_bytes_written()
1620 static inline void cifs_stats_bytes_read(struct cifs_tcon *tcon, in cifs_stats_bytes_read() argument
1623 spin_lock(&tcon->stat_lock); in cifs_stats_bytes_read()
1624 tcon->bytes_read += bytes; in cifs_stats_bytes_read()
1625 spin_unlock(&tcon->stat_lock); in cifs_stats_bytes_read()
1634 * - This will be called by cifsd, with no locks held.
1635 * - The mid will still be on the pending_mid_q.
1636 * - mid->resp_buf will point to the current buffer.
1649 * - it will be called by cifsd, with no locks held
1650 * - the mid will be removed from any lists
1695 struct cifs_tcon *tcon; member
1705 atomic_inc(&server->in_send); in cifs_in_send_inc()
1710 atomic_dec(&server->in_send); in cifs_in_send_dec()
1715 atomic_inc(&server->num_waiters); in cifs_num_waiters_inc()
1720 atomic_dec(&server->num_waiters); in cifs_num_waiters_dec()
1726 mid->when_sent = jiffies; in cifs_save_when_sent()
1769 struct cifs_tcon *tcon; member
1775 kfree(param->path_name); in __free_dfs_info_param()
1776 kfree(param->node_name); in __free_dfs_info_param()
1810 case -EINTR: in is_interrupt_error()
1811 case -ERESTARTSYS: in is_interrupt_error()
1812 case -ERESTARTNOHAND: in is_interrupt_error()
1813 case -ERESTARTNOINTR: in is_interrupt_error()
1821 if (is_interrupt_error(error) || error == -EAGAIN) in is_retryable_error()
1828 if (error == -EAGAIN || error == -ECONNABORTED) in is_replayable_error()
1862 #define CIFS_LOG_ERROR 0x010 /* log NT STATUS if non-zero */
1925 * (top to bottom).
1928 * this in the comments on top of your function definition.
1946 * vol_info->ctx_lock vol_info->ctx
1947 * cifs_sb_info->tlink_tree_lock cifs_sb_info->tlink_tree cifs_setup_cifs_sb
1948 * TCP_Server_Info-> TCP_Server_Info cifs_get_tcp_session
1950 * TCP_Server_Info->srv_mutex TCP_Server_Info cifs_get_tcp_session
1951 * cifs_ses->session_mutex cifs_ses sesInfoAlloc
1953 * cifs_tcon->open_file_lock cifs_tcon->openFileList tconInfoAlloc
1954 * cifs_tcon->pending_opens
1955 * cifs_tcon->stat_lock cifs_tcon->bytes_read tconInfoAlloc
1956 * cifs_tcon->bytes_written
1961 * TCP_Server_Info->srv_lock (anything in struct not protected by another lock and can change)
1962 * TCP_Server_Info->mid_lock TCP_Server_Info->pending_mid_q cifs_get_tcp_session
1963 * ->CurrentMid
1965 * TCP_Server_Info->req_lock TCP_Server_Info->in_flight cifs_get_tcp_session
1966 * ->credits
1967 * ->echo_credits
1968 * ->oplock_credits
1969 * ->reconnect_instance
1970 * cifs_ses->ses_lock (anything that is not protected by another lock and can change)
1971 * cifs_ses->iface_lock cifs_ses->iface_list sesInfoAlloc
1972 * ->iface_count
1973 * ->iface_last_update
1974 * cifs_ses->chan_lock cifs_ses->chans
1975 * ->chans_need_reconnect
1976 * ->chans_in_reconnect
1977 * cifs_tcon->tc_lock (anything that is not protected by another lock and can change)
1978 * cifsInodeInfo->open_file_lock cifsInodeInfo->openFileList cifs_alloc_inode
1979 * cifsInodeInfo->writers_lock cifsInodeInfo->writers cifsInodeInfo_alloc
1980 * cifsInodeInfo->lock_sem cifsInodeInfo->llist cifs_init_once
1981 * ->can_cache_brlcks
1982 * cifsInodeInfo->deferred_lock cifsInodeInfo->deferred_closes cifsInodeInfo_alloc
1983 * cached_fid->fid_mutex cifs_tcon->crfid tcon_info_alloc
1984 * cifsFileInfo->fh_mutex cifsFileInfo cifs_new_fileinfo
1985 * cifsFileInfo->file_info_lock cifsFileInfo->count cifs_new_fileinfo
1986 * ->invalidHandle initiate_cifs_search
1987 * ->oplock_break_cancelled
1988 * cifs_aio_ctx->aio_mutex cifs_aio_ctx cifs_aio_ctx_alloc
2008 * tcp session, and the list of tcon's per smb session. It also protects
2009 * the reference counters for the server, smb session, and tcon.
2011 * tcon->open_file_lock and that before file->file_info_lock since the
2012 * structure order is cifs_socket-->cifs_ses-->cifs_tcon-->cifs_file
2049 extern bool enable_gcm_256; /* allow optional negotiate of strongest signing (aes-gcm-256) */
2050 extern bool require_gcm_256; /* require use of strongest signing (aes-gcm-256) */
2119 return strcmp(server->vals->version_string, SMB1_VERSION_STRING) == 0; in is_smb1_server()
2122 static inline bool is_tcon_dfs(struct cifs_tcon *tcon) in is_tcon_dfs() argument
2125 * For SMB1, see MS-CIFS 2.4.55 SMB_COM_TREE_CONNECT_ANDX (0x75) and MS-CIFS 3.3.4.4 DFS in is_tcon_dfs()
2128 * For SMB2+, see MS-SMB2 2.2.10 SMB2 TREE_CONNECT Response and MS-SMB2 3.3.4.14 Server in is_tcon_dfs()
2131 if (!tcon || !tcon->ses || !tcon->ses->server) in is_tcon_dfs()
2133 return is_smb1_server(tcon->ses->server) ? tcon->Flags & SMB_SHARE_IS_IN_DFS : in is_tcon_dfs()
2134 tcon->share_flags & (SHI1005_FLAGS_DFS | SHI1005_FLAGS_DFS_ROOT); in is_tcon_dfs()
2137 static inline bool cifs_is_referral_server(struct cifs_tcon *tcon, in cifs_is_referral_server() argument
2142 * MS-DFSC 2.2.4 RESP_GET_DFS_REFERRAL. in cifs_is_referral_server()
2144 return is_tcon_dfs(tcon) || (ref && (ref->flags & DFSREF_REFERRAL_SERVER)); in cifs_is_referral_server()
2149 return (u64)fl->fl_end - fl->fl_start + 1; in cifs_flock_len()
2154 if (WARN_ON_ONCE(!ses || !ses->server)) in ntlmssp_workstation_name_size()
2160 if (ses->server->dialect <= SMB20_PROT_ID) in ntlmssp_workstation_name_size()
2161 return min_t(size_t, sizeof(ses->workstation_name), RFC1001_NAME_LEN_WITH_NULL); in ntlmssp_workstation_name_size()
2162 return sizeof(ses->workstation_name); in ntlmssp_workstation_name_size()
2167 memcpy(dst, src, (size_t)((u8 *)&src->AccessFlags - (u8 *)src)); in move_cifs_info_to_smb2()
2168 dst->AccessFlags = src->AccessFlags; in move_cifs_info_to_smb2()
2169 dst->CurrentByteOffset = src->CurrentByteOffset; in move_cifs_info_to_smb2()
2170 dst->Mode = src->Mode; in move_cifs_info_to_smb2()
2171 dst->AlignmentRequirement = src->AlignmentRequirement; in move_cifs_info_to_smb2()
2172 dst->FileNameLength = src->FileNameLength; in move_cifs_info_to_smb2()
2202 * Instead, we convert to a BVEC-type iterator higher up. in cifs_get_num_sgs()
2206 return -EIO; in cifs_get_num_sgs()
2213 return -EIO; in cifs_get_num_sgs()
2218 addr = (unsigned long)iov->iov_base + skip; in cifs_get_num_sgs()
2220 len = iov->iov_len - skip; in cifs_get_num_sgs()
2248 unsigned int len = min_t(unsigned int, buflen, PAGE_SIZE - off); in cifs_sg_set_buf()
2250 sg_set_page(&sgtable->sgl[sgtable->nents++], in cifs_sg_set_buf()
2255 buflen -= len; in cifs_sg_set_buf()
2258 sg_set_page(&sgtable->sgl[sgtable->nents++], in cifs_sg_set_buf()