fs/smb/client/cifsproto.h
Source file repositories/reference/linux-study-clean/fs/smb/client/cifsproto.h
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/client/cifsproto.h- Extension
.h- Size
- 23201 bytes
- Lines
- 616
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/nls.hlinux/ctype.hcifsglob.htrace.hdfs_cache.hsmb1proto.h
Detected Declarations
struct statfsstruct smb_rqststruct smb3_fs_contextstruct fs_contextfunction free_dentry_pathfunction send_cancelfunction get_dfs_pathfunction cifs_inval_name_dfs_link_errorfunction cifs_create_optionsfunction cifs_put_smb_sesfunction cifs_put_smb_sesfunction dfs_src_pathname_equalfunction smb_get_midfunction release_midfunction cifs_free_open_infofunction smb_EIOfunction smb_EIO1function smb_EIO2function cifs_get_num_sgsfunction cifs_sg_set_buffunction cifs_get_writable_filefunction find_readable_file
Annotated Snippet
if (*s1 == '/' || *s1 == '\\') {
if (*s2 != '/' && *s2 != '\\')
return false;
} else if (tolower(*s1) != tolower(*s2))
return false;
}
return true;
}
static inline void smb_get_mid(struct mid_q_entry *mid)
{
refcount_inc(&mid->refcount);
}
static inline void release_mid(struct TCP_Server_Info *server, struct mid_q_entry *mid)
{
if (refcount_dec_and_test(&mid->refcount))
__release_mid(server, mid);
}
static inline void cifs_free_open_info(struct cifs_open_info_data *data)
{
kfree(data->symlink_target);
free_rsp_buf(data->reparse.io.buftype, data->reparse.io.iov.iov_base);
memset(data, 0, sizeof(*data));
}
static inline int smb_EIO(enum smb_eio_trace trace)
{
trace_smb3_eio(trace, 0, 0);
return -EIO;
}
static inline int smb_EIO1(enum smb_eio_trace trace, unsigned long info)
{
trace_smb3_eio(trace, info, 0);
return -EIO;
}
static inline int smb_EIO2(enum smb_eio_trace trace, unsigned long info, unsigned long info2)
{
trace_smb3_eio(trace, info, info2);
return -EIO;
}
static inline int cifs_get_num_sgs(const struct smb_rqst *rqst,
int num_rqst,
const u8 *sig)
{
unsigned int len, skip;
unsigned int nents = 0;
unsigned long addr;
size_t data_size;
int i, j;
/*
* The first rqst has a transform header where the first 20 bytes are
* not part of the encrypted blob.
*/
skip = 20;
/* Assumes the first rqst has a transform header as the first iov.
* I.e.
* rqst[0].rq_iov[0] is transform header
* rqst[0].rq_iov[1+] data to be encrypted/decrypted
* rqst[1+].rq_iov[0+] data to be encrypted/decrypted
*/
for (i = 0; i < num_rqst; i++) {
data_size = iov_iter_count(&rqst[i].rq_iter);
/* We really don't want a mixture of pinned and unpinned pages
* in the sglist. It's hard to keep track of which is what.
* Instead, we convert to a BVEC-type iterator higher up.
*/
if (data_size &&
WARN_ON_ONCE(user_backed_iter(&rqst[i].rq_iter)))
return smb_EIO(smb_eio_trace_user_iter);
/* We also don't want to have any extra refs or pins to clean
* up in the sglist.
*/
if (data_size &&
WARN_ON_ONCE(iov_iter_extract_will_pin(&rqst[i].rq_iter)))
return smb_EIO(smb_eio_trace_extract_will_pin);
for (j = 0; j < rqst[i].rq_nvec; j++) {
struct kvec *iov = &rqst[i].rq_iov[j];
addr = (unsigned long)iov->iov_base + skip;
if (is_vmalloc_or_module_addr((void *)addr)) {
Annotation
- Immediate include surface: `linux/nls.h`, `linux/ctype.h`, `cifsglob.h`, `trace.h`, `dfs_cache.h`, `smb1proto.h`.
- Detected declarations: `struct statfs`, `struct smb_rqst`, `struct smb3_fs_context`, `struct fs_context`, `function free_dentry_path`, `function send_cancel`, `function get_dfs_path`, `function cifs_inval_name_dfs_link_error`, `function cifs_create_options`, `function cifs_put_smb_ses`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.