fs/ceph/dir.c
Source file repositories/reference/linux-study-clean/fs/ceph/dir.c
File Facts
- System
- Linux kernel
- Corpus path
fs/ceph/dir.c- Extension
.c- Size
- 61042 bytes
- Lines
- 2276
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/ceph/ceph_debug.hlinux/spinlock.hlinux/namei.hlinux/slab.hlinux/sched.hlinux/xattr.hsuper.hmds_client.hcrypto.h
Detected Declarations
struct ceph_lease_walk_controlfunction ceph_d_initfunction ceph_make_fposfunction is_hash_orderfunction fpos_fragfunction fpos_hashfunction fpos_offfunction fpos_cmpfunction note_last_dentryfunction __dcache_find_get_entryfunction CEPH_CAP_FILE_SHAREDfunction need_send_readdirfunction ceph_readdirfunction ceph_snapfunction reset_readdirfunction seekdirfunction ceph_dir_llseekfunction strcmpfunction tracefunction is_root_ceph_dentryfunction lookupfunction ceph_mknodfunction ceph_createfunction prep_encrypted_symlink_targetfunction prep_encrypted_symlink_targetfunction ceph_symlinkfunction ceph_linkfunction ceph_async_unlink_cbfunction get_caps_for_async_unlinkfunction ceph_unlinkfunction ceph_renamefunction __ceph_dentry_lease_touchfunction __dentry_dir_lease_touchfunction __ceph_dentry_dir_lease_touchfunction __dentry_lease_unlistfunction __dentry_leases_walkfunction __dentry_lease_checkfunction __dir_lease_checkfunction ceph_trim_dentriesfunction ceph_invalidate_dentry_leasefunction __dentry_lease_is_validfunction dentry_lease_is_validfunction __dir_lease_try_checkfunction dir_lease_is_validfunction ceph_d_revalidatefunction ceph_d_deletefunction ceph_d_releasefunction ceph_d_prune
Annotated Snippet
const struct file_operations ceph_dir_fops = {
.read = ceph_read_dir,
.iterate_shared = shared_ceph_readdir,
.llseek = ceph_dir_llseek,
.open = ceph_open,
.release = ceph_release,
.unlocked_ioctl = ceph_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.fsync = ceph_fsync,
.lock = ceph_lock,
.flock = ceph_flock,
};
const struct file_operations ceph_snapdir_fops = {
.iterate_shared = shared_ceph_readdir,
.llseek = ceph_dir_llseek,
.open = ceph_open,
.release = ceph_release,
};
const struct inode_operations ceph_dir_iops = {
.lookup = ceph_lookup,
.permission = ceph_permission,
.getattr = ceph_getattr,
.setattr = ceph_setattr,
.listxattr = ceph_listxattr,
.get_inode_acl = ceph_get_acl,
.set_acl = ceph_set_acl,
.mknod = ceph_mknod,
.symlink = ceph_symlink,
.mkdir = ceph_mkdir,
.link = ceph_link,
.unlink = ceph_unlink,
.rmdir = ceph_unlink,
.rename = ceph_rename,
.create = ceph_create,
.atomic_open = ceph_atomic_open,
};
const struct inode_operations ceph_snapdir_iops = {
.lookup = ceph_lookup,
.permission = ceph_permission,
.getattr = ceph_getattr,
.mkdir = ceph_mkdir,
.rmdir = ceph_unlink,
.rename = ceph_rename,
};
const struct dentry_operations ceph_dentry_ops = {
.d_revalidate = ceph_d_revalidate,
.d_delete = ceph_d_delete,
.d_release = ceph_d_release,
.d_prune = ceph_d_prune,
.d_init = ceph_d_init,
};
Annotation
- Immediate include surface: `linux/ceph/ceph_debug.h`, `linux/spinlock.h`, `linux/namei.h`, `linux/slab.h`, `linux/sched.h`, `linux/xattr.h`, `super.h`, `mds_client.h`.
- Detected declarations: `struct ceph_lease_walk_control`, `function ceph_d_init`, `function ceph_make_fpos`, `function is_hash_order`, `function fpos_frag`, `function fpos_hash`, `function fpos_off`, `function fpos_cmp`, `function note_last_dentry`, `function __dcache_find_get_entry`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.