Lines Matching +full:set +full:- +full:aces

1 /* SPDX-License-Identifier: LGPL-2.1 */
58 * max attribute cache timeout (jiffies) - 2^30
112 #define CIFS_DFS_ROOT_SES(ses) ((ses)->dfs_root_ses ?: (ses))
182 struct shash_desc *hmacsha256; /* hmac-sha256 hash function, for SMB2 signatures */
184 struct shash_desc *aes_cmac; /* block-cipher based MAC function, for SMB3 signatures */
186 struct crypto_aead *enc; /* smb3 encryption AEAD TFM (AES-CCM and AES-GCM) */
187 struct crypto_aead *dec; /* smb3 decryption AEAD TFM (AES-CCM and AES-GCM) */
207 struct smb_ace *aces;
304 * message field DataRemaining for out-of-band data read (e.g through
333 /* set negotiated write size */
335 /* set negotiated read size */
381 /* set size by path */
385 /* set size by file handle */
388 /* set attributes */
405 /* set info on created directory */
436 /* open a file for non-posix mounts */
439 /* set fid protocol-specific info */
495 /* set lease key of the inode */
517 /* set oplock level for the inode */
622 #define HEADER_SIZE(server) (server->vals->header_size)
623 #define MAX_HEADER_SIZE(server) (server->vals->max_header_size)
624 #define HEADER_PREAMBLE_SIZE(server) (server->vals->header_preamble_size)
625 #define MID_HEADER_SIZE(server) (HEADER_SIZE(server) - 1 - HEADER_PREAMBLE_SIZE(server))
722 /* message size the server can send or receive for non-raw SMBs */
730 __u64 CurrentMid; /* multiplex id - rotating counter, protected by GlobalMid_Lock */
740 #define CIFS_NEGFLAVOR_EXTENDED 2 /* wct == 17, ext_sec bit set */
772 bool requested; /* "compress" mount option set*/
792 bool noblockcnt; /* use non-blocking connect() */
796 * primary_server holds the ref-counted
799 #define SERVER_IS_CHAN(server) (!!(server)->primary_server)
835 mutex_lock(&server->_srv_mutex);
836 server->nofs_flag = nofs_flag;
841 unsigned int nofs_flag = server->nofs_flag;
843 mutex_unlock(&server->_srv_mutex);
860 spin_lock(&server->req_lock);
861 num = server->in_flight;
862 spin_unlock(&server->req_lock);
871 spin_lock(&server->req_lock);
873 spin_unlock(&server->req_lock);
881 server->ops->add_credits(server, credits, optype);
888 if (credits->value) {
889 server->ops->add_credits(server, credits, optype);
890 wake_up(&server->request_q);
891 credits->value = 0;
898 server->ops->set_credits(server, val);
905 return server->ops->adjust_credits ?
906 server->ops->adjust_credits(server, subreq, trace) : 0;
912 return cpu_to_le64(server->ops->get_next_mid(server));
918 __u16 mid = server->ops->get_next_mid(server);
921 * on-the-wire decoding.
929 if (server->ops->revert_current_mid)
930 server->ops->revert_current_mid(server, val);
937 unsigned int num = le16_to_cpu(shdr->CreditCharge);
945 return le16_to_cpu(smb->Mid);
951 return mid == le16_to_cpu(smb->Mid);
956 * we can allow up to 2^24-1, minus the size of a READ/WRITE_AND_X header, not
967 #define CIFS_MAX_WSIZE ((1<<24) - 1 - sizeof(WRITE_REQ) + 4)
968 #define CIFS_MAX_RSIZE ((1<<24) - sizeof(READ_RSP) + 4)
972 * of 2^17-1 minus the size of the call header. That allows for a read or
975 #define CIFS_MAX_RFC1002_WSIZE ((1<<17) - 1 - sizeof(WRITE_REQ) + 4)
976 #define CIFS_MAX_RFC1002_RSIZE ((1<<17) - 1 - sizeof(READ_RSP) + 4)
989 * https://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx
995 * Macros to allow the TCP_Server_Info->net field and related code to drop out
996 * when CONFIG_NET_NS isn't set.
1003 return srv->net;
1008 srv->net = net;
1069 unsigned int overrideSecFlg; /* if non-zero override global sec flags */
1082 char *password2; /* When key rotation used, new password may be set before it expires */
1116 #define CIFS_INVAL_CHAN_INDEX (-1)
1118 ((1UL << (ses)->chan_count) - 1)
1120 (!(ses)->chans_need_reconnect)
1122 ((ses)->chans_need_reconnect == CIFS_ALL_CHANNELS_SET(ses))
1124 ((ses)->chans_need_reconnect = CIFS_ALL_CHANNELS_SET(ses))
1126 test_bit((index), &(ses)->chans_need_reconnect)
1128 ((ses)->chans[(index)].in_reconnect)
1154 return ses->server->vals->cap_unix & ses->capabilities;
1206 char *password; /* for share-level security */
1247 bool ipc:1; /* set if connection to IPC$ share (always also pipe) */
1248 bool pipe:1; /* set if connection to pipe share */
1249 bool print:1; /* set if connection to printer share */
1272 __u64 snapshot_time; /* for timewarp tokens - timestamp of snapshot */
1321 return tlink->tl_tcon;
1327 return cifs_sb->master_tlink;
1336 atomic_inc(&tlink->tl_count);
1394 #define ACL_NO_MODE ((umode_t)(-1))
1431 /* following two lists are protected by tcon->open_file_lock */
1434 /* lock list below protected by cifsi->lock_sem */
1504 * cfile->file_info_lock held.
1509 ++cifs_file->count;
1524 #define CIFS_CACHE_READ(cinode) ((cinode->oplock & CIFS_CACHE_READ_FLG) || (CIFS_SB(cinode->netfs.inode.i_sb)->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE))
1525 #define CIFS_CACHE_HANDLE(cinode) (cinode->oplock & CIFS_CACHE_HANDLE_FLG)
1526 #define CIFS_CACHE_WRITE(cinode) ((cinode->oplock & CIFS_CACHE_WRITE_FLG) || (CIFS_SB(cinode->netfs.inode.i_sb)->mnt_cifs_flags & CIFS_MOUNT_RW_CACHE))
1554 #define CIFS_INO_CLOSE_ON_LOCK (7) /* Not to defer the close when lock is set */
1578 return sb->s_fs_info;
1584 return CIFS_SB(file_inode(file)->i_sb);
1589 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
1616 spin_lock(&tcon->stat_lock);
1617 tcon->bytes_written += bytes;
1618 spin_unlock(&tcon->stat_lock);
1625 spin_lock(&tcon->stat_lock);
1626 tcon->bytes_read += bytes;
1627 spin_unlock(&tcon->stat_lock);
1636 * - This will be called by cifsd, with no locks held.
1637 * - The mid will still be on the pending_mid_q.
1638 * - mid->resp_buf will point to the current buffer.
1651 * - it will be called by cifsd, with no locks held
1652 * - the mid will be removed from any lists
1707 atomic_inc(&server->in_send);
1712 atomic_dec(&server->in_send);
1717 atomic_inc(&server->num_waiters);
1722 atomic_dec(&server->num_waiters);
1728 mid->when_sent = jiffies;
1776 kfree(param->path_name);
1777 kfree(param->node_name);
1811 case -EINTR:
1812 case -ERESTARTSYS:
1813 case -ERESTARTNOHAND:
1814 case -ERESTARTNOINTR:
1822 if (is_interrupt_error(error) || error == -EAGAIN)
1829 if (error == -EAGAIN || error == -ECONNABORTED)
1862 #define CIFS_TIMEOUT_MASK 0x003 /* only one of above set in req */
1863 #define CIFS_LOG_ERROR 0x010 /* log NT STATUS if non-zero */
1889 /* note that only one of the following can be set so the
1948 * vol_info->ctx_lock vol_info->ctx
1949 * cifs_sb_info->tlink_tree_lock cifs_sb_info->tlink_tree cifs_setup_cifs_sb
1950 * TCP_Server_Info-> TCP_Server_Info cifs_get_tcp_session
1952 * TCP_Server_Info->srv_mutex TCP_Server_Info cifs_get_tcp_session
1953 * cifs_ses->session_mutex cifs_ses sesInfoAlloc
1955 * cifs_tcon->open_file_lock cifs_tcon->openFileList tconInfoAlloc
1956 * cifs_tcon->pending_opens
1957 * cifs_tcon->stat_lock cifs_tcon->bytes_read tconInfoAlloc
1958 * cifs_tcon->bytes_written
1963 * TCP_Server_Info->srv_lock (anything in struct not protected by another lock and can change)
1964 * TCP_Server_Info->mid_lock TCP_Server_Info->pending_mid_q cifs_get_tcp_session
1965 * ->CurrentMid
1967 * TCP_Server_Info->req_lock TCP_Server_Info->in_flight cifs_get_tcp_session
1968 * ->credits
1969 * ->echo_credits
1970 * ->oplock_credits
1971 * ->reconnect_instance
1972 * cifs_ses->ses_lock (anything that is not protected by another lock and can change)
1973 * cifs_ses->iface_lock cifs_ses->iface_list sesInfoAlloc
1974 * ->iface_count
1975 * ->iface_last_update
1976 * cifs_ses->chan_lock cifs_ses->chans
1977 * ->chans_need_reconnect
1978 * ->chans_in_reconnect
1979 * cifs_tcon->tc_lock (anything that is not protected by another lock and can change)
1980 * inode->i_rwsem, taken by fs/netfs/locking.c e.g. should be taken before cifsInodeInfo locks
1981 * cifsInodeInfo->open_file_lock cifsInodeInfo->openFileList cifs_alloc_inode
1982 * cifsInodeInfo->writers_lock cifsInodeInfo->writers cifsInodeInfo_alloc
1983 * cifsInodeInfo->lock_sem cifsInodeInfo->llist cifs_init_once
1984 * ->can_cache_brlcks
1985 * cifsInodeInfo->deferred_lock cifsInodeInfo->deferred_closes cifsInodeInfo_alloc
1986 * cached_fid->fid_mutex cifs_tcon->crfid tcon_info_alloc
1987 * cifsFileInfo->fh_mutex cifsFileInfo cifs_new_fileinfo
1988 * cifsFileInfo->file_info_lock cifsFileInfo->count cifs_new_fileinfo
1989 * ->invalidHandle initiate_cifs_search
1990 * ->oplock_break_cancelled
2013 * tcon->open_file_lock and that before file->file_info_lock since the
2014 * structure order is cifs_socket-->cifs_ses-->cifs_tcon-->cifs_file
2051 extern bool enable_gcm_256; /* allow optional negotiate of strongest signing (aes-gcm-256) */
2052 extern bool require_gcm_256; /* require use of strongest signing (aes-gcm-256) */
2126 return strcmp(server->vals->version_string, SMB1_VERSION_STRING) == 0;
2132 * For SMB1, see MS-CIFS 2.4.55 SMB_COM_TREE_CONNECT_ANDX (0x75) and MS-CIFS 3.3.4.4 DFS
2135 * For SMB2+, see MS-SMB2 2.2.10 SMB2 TREE_CONNECT Response and MS-SMB2 3.3.4.14 Server
2138 if (!tcon || !tcon->ses || !tcon->ses->server)
2140 return is_smb1_server(tcon->ses->server) ? tcon->Flags & SMB_SHARE_IS_IN_DFS :
2141 tcon->share_flags & (SHI1005_FLAGS_DFS | SHI1005_FLAGS_DFS_ROOT);
2149 * MS-DFSC 2.2.4 RESP_GET_DFS_REFERRAL.
2151 return is_tcon_dfs(tcon) || (ref && (ref->flags & DFSREF_REFERRAL_SERVER));
2156 return (u64)fl->fl_end - fl->fl_start + 1;
2161 if (WARN_ON_ONCE(!ses || !ses->server))
2167 if (ses->server->dialect <= SMB20_PROT_ID)
2168 return min_t(size_t, sizeof(ses->workstation_name), RFC1001_NAME_LEN_WITH_NULL);
2169 return sizeof(ses->workstation_name);
2174 memcpy(dst, src, (size_t)((u8 *)&src->AccessFlags - (u8 *)src));
2175 dst->AccessFlags = src->AccessFlags;
2176 dst->CurrentByteOffset = src->CurrentByteOffset;
2177 dst->Mode = src->Mode;
2178 dst->AlignmentRequirement = src->AlignmentRequirement;
2179 dst->FileNameLength = src->FileNameLength;
2209 * Instead, we convert to a BVEC-type iterator higher up.
2213 return -EIO;
2220 return -EIO;
2225 addr = (unsigned long)iov->iov_base + skip;
2227 len = iov->iov_len - skip;
2255 unsigned int len = min_t(unsigned int, buflen, PAGE_SIZE - off);
2257 sg_set_page(&sgtable->sgl[sgtable->nents++],
2262 buflen -= len;
2265 sg_set_page(&sgtable->sgl[sgtable->nents++],
2299 spin_lock(&ses->ses_lock);
2300 ret = ses->ses_status == SES_EXITING;
2301 spin_unlock(&ses->ses_lock);