fs/hfs/attr.c
Source file repositories/reference/linux-study-clean/fs/hfs/attr.c
File Facts
- System
- Linux kernel
- Corpus path
fs/hfs/attr.c- Extension
.c- Size
- 3129 bytes
- Lines
- 154
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fs.hlinux/xattr.hhfs_fs.hbtree.h
Detected Declarations
enum hfs_xattr_typefunction __hfs_setxattrfunction __hfs_getxattrfunction hfs_xattr_getfunction hfs_xattr_set
Annotated Snippet
if (size >= 4) {
memcpy(value, &file->UsrWds.fdType, 4);
res = 4;
} else
res = size ? -ERANGE : 4;
break;
case HFS_CREATOR:
if (size >= 4) {
memcpy(value, &file->UsrWds.fdCreator, 4);
res = 4;
} else
res = size ? -ERANGE : 4;
break;
}
out:
if (size)
hfs_find_exit(&fd);
return res;
}
static int hfs_xattr_get(const struct xattr_handler *handler,
struct dentry *unused, struct inode *inode,
const char *name, void *value, size_t size)
{
return __hfs_getxattr(inode, handler->flags, value, size);
}
static int hfs_xattr_set(const struct xattr_handler *handler,
struct mnt_idmap *idmap,
struct dentry *unused, struct inode *inode,
const char *name, const void *value, size_t size,
int flags)
{
if (!value)
return -EOPNOTSUPP;
return __hfs_setxattr(inode, handler->flags, value, size, flags);
}
static const struct xattr_handler hfs_creator_handler = {
.name = "hfs.creator",
.flags = HFS_CREATOR,
.get = hfs_xattr_get,
.set = hfs_xattr_set,
};
static const struct xattr_handler hfs_type_handler = {
.name = "hfs.type",
.flags = HFS_TYPE,
.get = hfs_xattr_get,
.set = hfs_xattr_set,
};
const struct xattr_handler * const hfs_xattr_handlers[] = {
&hfs_creator_handler,
&hfs_type_handler,
NULL
};
Annotation
- Immediate include surface: `linux/fs.h`, `linux/xattr.h`, `hfs_fs.h`, `btree.h`.
- Detected declarations: `enum hfs_xattr_type`, `function __hfs_setxattr`, `function __hfs_getxattr`, `function hfs_xattr_get`, `function hfs_xattr_set`.
- 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.