fs/smb/client/xattr.c
Source file repositories/reference/linux-study-clean/fs/smb/client/xattr.c
File Facts
- System
- Linux kernel
- Corpus path
fs/smb/client/xattr.c- Extension
.c- Size
- 14561 bytes
- Lines
- 536
- 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/fs.hlinux/posix_acl_xattr.hlinux/slab.hlinux/xattr.hcifsfs.hcifsglob.hcifsproto.hcifs_debug.hcifs_fs_sb.hcifs_unicode.hcifs_ioctl.h
Detected Declarations
function cifs_attrib_setfunction cifs_creation_time_setfunction cifs_xattr_setfunction cifs_attrib_getfunction cifs_creation_time_getfunction cifs_xattr_getfunction cifs_listxattr
Annotated Snippet
if (pTcon->ses->server->ops->set_EA) {
rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
full_path, name, value, (__u16)size,
cifs_sb->local_nls, cifs_sb);
if (rc == 0)
inode_set_ctime_current(inode);
}
break;
case XATTR_CIFS_ACL:
case XATTR_CIFS_NTSD_SACL:
case XATTR_CIFS_NTSD_OWNER:
case XATTR_CIFS_NTSD:
case XATTR_CIFS_NTSD_FULL: {
struct smb_ntsd *pacl;
if (!value)
goto out;
pacl = kmalloc(size, GFP_KERNEL);
if (!pacl) {
rc = -ENOMEM;
} else {
memcpy(pacl, value, size);
if (pTcon->ses->server->ops->set_acl) {
int aclflags = 0;
switch (handler->flags) {
case XATTR_CIFS_NTSD_FULL:
aclflags = (CIFS_ACL_OWNER |
CIFS_ACL_GROUP |
CIFS_ACL_DACL |
CIFS_ACL_SACL);
break;
case XATTR_CIFS_NTSD:
aclflags = (CIFS_ACL_OWNER |
CIFS_ACL_GROUP |
CIFS_ACL_DACL);
break;
case XATTR_CIFS_NTSD_OWNER:
aclflags = (CIFS_ACL_OWNER |
CIFS_ACL_GROUP);
break;
case XATTR_CIFS_NTSD_SACL:
aclflags = CIFS_ACL_SACL;
break;
case XATTR_CIFS_ACL:
default:
aclflags = CIFS_ACL_DACL;
}
rc = pTcon->ses->server->ops->set_acl(pacl,
size, inode, full_path, aclflags);
} else {
rc = -EOPNOTSUPP;
}
if (rc == 0) /* force revalidate of the inode */
CIFS_I(inode)->time = 0;
kfree(pacl);
}
break;
}
}
out:
free_dentry_path(page);
free_xid(xid);
cifs_put_tlink(tlink);
return rc;
}
static int cifs_attrib_get(struct dentry *dentry,
struct inode *inode, void *value,
size_t size)
{
ssize_t rc;
__u32 *pattribute;
rc = cifs_revalidate_dentry_attr(dentry);
if (rc)
return rc;
if ((value == NULL) || (size == 0))
return sizeof(__u32);
else if (size < sizeof(__u32))
return -ERANGE;
/* return dos attributes as pseudo xattr */
pattribute = (__u32 *)value;
*pattribute = CIFS_I(inode)->cifsAttrs;
Annotation
- Immediate include surface: `linux/fs.h`, `linux/posix_acl_xattr.h`, `linux/slab.h`, `linux/xattr.h`, `cifsfs.h`, `cifsglob.h`, `cifsproto.h`, `cifs_debug.h`.
- Detected declarations: `function cifs_attrib_set`, `function cifs_creation_time_set`, `function cifs_xattr_set`, `function cifs_attrib_get`, `function cifs_creation_time_get`, `function cifs_xattr_get`, `function cifs_listxattr`.
- 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.