include/linux/fs/super_types.h
Source file repositories/reference/linux-study-clean/include/linux/fs/super_types.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/fs/super_types.h- Extension
.h- Size
- 12678 bytes
- Lines
- 353
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fs_dirent.hlinux/errseq.hlinux/list_lru.hlinux/list.hlinux/list_bl.hlinux/llist.hlinux/uidgid.hlinux/uuid.hlinux/percpu-rwsem.hlinux/workqueue_types.hlinux/quota.h
Detected Declarations
struct backing_dev_infostruct block_devicestruct dentrystruct dentry_operationsstruct dquot_operationsstruct export_operationsstruct filestruct file_system_typestruct fscrypt_operationsstruct fsnotify_sb_infostruct fsverity_operationsstruct kstatfsstruct mountstruct mtd_infostruct quotactl_opsstruct shrinkerstruct unicode_mapstruct user_namespacestruct workqueue_structstruct writeback_controlstruct xattr_handlerstruct fserror_eventstruct sb_writersstruct super_operationsstruct super_blockenum freeze_holder
Annotated Snippet
struct sb_writers {
unsigned short frozen; /* Is sb frozen? */
int freeze_kcount; /* How many kernel freeze requests? */
int freeze_ucount; /* How many userspace freeze requests? */
const void *freeze_owner; /* Owner of the freeze */
struct percpu_rw_semaphore rw_sem[SB_FREEZE_LEVELS];
};
/**
* enum freeze_holder - holder of the freeze
* @FREEZE_HOLDER_KERNEL: kernel wants to freeze or thaw filesystem
* @FREEZE_HOLDER_USERSPACE: userspace wants to freeze or thaw filesystem
* @FREEZE_MAY_NEST: whether nesting freeze and thaw requests is allowed
* @FREEZE_EXCL: a freeze that can only be undone by the owner
*
* Indicate who the owner of the freeze or thaw request is and whether
* the freeze needs to be exclusive or can nest.
* Without @FREEZE_MAY_NEST, multiple freeze and thaw requests from the
* same holder aren't allowed. It is however allowed to hold a single
* @FREEZE_HOLDER_USERSPACE and a single @FREEZE_HOLDER_KERNEL freeze at
* the same time. This is relied upon by some filesystems during online
* repair or similar.
*/
enum freeze_holder {
FREEZE_HOLDER_KERNEL = (1U << 0),
FREEZE_HOLDER_USERSPACE = (1U << 1),
FREEZE_MAY_NEST = (1U << 2),
FREEZE_EXCL = (1U << 3),
};
struct super_operations {
struct inode *(*alloc_inode)(struct super_block *sb);
void (*destroy_inode)(struct inode *inode);
void (*free_inode)(struct inode *inode);
void (*dirty_inode)(struct inode *inode, int flags);
int (*write_inode)(struct inode *inode, struct writeback_control *wbc);
int (*drop_inode)(struct inode *inode);
void (*evict_inode)(struct inode *inode);
void (*put_super)(struct super_block *sb);
int (*sync_fs)(struct super_block *sb, int wait);
int (*freeze_super)(struct super_block *sb, enum freeze_holder who,
const void *owner);
int (*freeze_fs)(struct super_block *sb);
int (*thaw_super)(struct super_block *sb, enum freeze_holder who,
const void *owner);
int (*unfreeze_fs)(struct super_block *sb);
int (*statfs)(struct dentry *dentry, struct kstatfs *kstatfs);
void (*umount_begin)(struct super_block *sb);
int (*show_options)(struct seq_file *seq, struct dentry *dentry);
int (*show_devname)(struct seq_file *seq, struct dentry *dentry);
int (*show_path)(struct seq_file *seq, struct dentry *dentry);
int (*show_stats)(struct seq_file *seq, struct dentry *dentry);
#ifdef CONFIG_QUOTA
ssize_t (*quota_read)(struct super_block *sb, int type, char *data,
size_t len, loff_t off);
ssize_t (*quota_write)(struct super_block *sb, int type,
const char *data, size_t len, loff_t off);
struct dquot __rcu **(*get_dquots)(struct inode *inode);
#endif
long (*nr_cached_objects)(struct super_block *sb,
struct shrink_control *sc);
long (*free_cached_objects)(struct super_block *sb,
struct shrink_control *sc);
/*
* If a filesystem can support graceful removal of a device and
* continue read-write operations, implement this callback.
*
* Return 0 if the filesystem can continue read-write.
* Non-zero return value or no such callback means the fs will be shutdown
* as usual.
*/
int (*remove_bdev)(struct super_block *sb, struct block_device *bdev);
void (*shutdown)(struct super_block *sb);
/* Report a filesystem error */
void (*report_error)(const struct fserror_event *event);
};
struct super_block {
struct list_head s_list; /* Keep this first */
dev_t s_dev; /* search index; _not_ kdev_t */
unsigned char s_blocksize_bits;
unsigned long s_blocksize;
loff_t s_maxbytes; /* Max file size */
struct file_system_type *s_type;
const struct super_operations *s_op;
const struct dquot_operations *dq_op;
const struct quotactl_ops *s_qcop;
const struct export_operations *s_export_op;
Annotation
- Immediate include surface: `linux/fs_dirent.h`, `linux/errseq.h`, `linux/list_lru.h`, `linux/list.h`, `linux/list_bl.h`, `linux/llist.h`, `linux/uidgid.h`, `linux/uuid.h`.
- Detected declarations: `struct backing_dev_info`, `struct block_device`, `struct dentry`, `struct dentry_operations`, `struct dquot_operations`, `struct export_operations`, `struct file`, `struct file_system_type`, `struct fscrypt_operations`, `struct fsnotify_sb_info`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- 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.