fs/nilfs2/the_nilfs.h
Source file repositories/reference/linux-study-clean/fs/nilfs2/the_nilfs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/nilfs2/the_nilfs.h- Extension
.h- Size
- 11274 bytes
- Lines
- 377
- 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.
- 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/types.hlinux/buffer_head.hlinux/rbtree.hlinux/fs.hlinux/blkdev.hlinux/backing-dev.hlinux/slab.hlinux/refcount.h
Detected Declarations
struct nilfs_sc_infostruct nilfs_sysfs_dev_subgroupsstruct the_nilfsstruct nilfs_rootfunction nilfs_sb_need_updatefunction nilfs_sb_will_flipfunction nilfs_get_rootfunction nilfs_valid_fsfunction nilfs_get_segment_rangefunction nilfs_get_segment_start_blocknrfunction nilfs_get_segnum_of_blockfunction nilfs_terminate_segmentfunction nilfs_shift_to_next_segmentfunction nilfs_last_cnofunction nilfs_segment_is_activefunction nilfs_flush_device
Annotated Snippet
struct the_nilfs {
unsigned long ns_flags;
int ns_flushed_device;
struct super_block *ns_sb;
struct block_device *ns_bdev;
struct rw_semaphore ns_sem;
struct mutex ns_snapshot_mount_mutex;
/*
* used for
* - loading the latest checkpoint exclusively.
* - allocating a new full segment.
*/
struct buffer_head *ns_sbh[2];
struct nilfs_super_block *ns_sbp[2];
time64_t ns_sbwtime;
unsigned int ns_sbwcount;
unsigned int ns_sbsize;
unsigned int ns_mount_state;
unsigned int ns_sb_update_freq;
/*
* The following fields are updated by a writable FS-instance.
* These fields are protected by ns_segctor_sem outside load_nilfs().
*/
u64 ns_seg_seq;
__u64 ns_segnum;
__u64 ns_nextnum;
unsigned long ns_pseg_offset;
__u64 ns_cno;
time64_t ns_ctime;
time64_t ns_nongc_ctime;
atomic_t ns_ndirtyblks;
/*
* The following fields hold information on the latest partial segment
* written to disk with a super root. These fields are protected by
* ns_last_segment_lock.
*/
spinlock_t ns_last_segment_lock;
sector_t ns_last_pseg;
u64 ns_last_seq;
__u64 ns_last_cno;
u64 ns_prot_seq;
u64 ns_prev_seq;
struct nilfs_sc_info *ns_writer;
struct rw_semaphore ns_segctor_sem;
/*
* Following fields are lock free except for the period before
* the_nilfs is initialized.
*/
struct inode *ns_dat;
struct inode *ns_cpfile;
struct inode *ns_sufile;
/* Checkpoint tree */
struct rb_root ns_cptree;
spinlock_t ns_cptree_lock;
/* Dirty inode list */
struct list_head ns_dirty_files;
spinlock_t ns_inode_lock;
/* GC inode list */
struct list_head ns_gc_inodes;
/* Mount options */
unsigned long ns_mount_opt;
uid_t ns_resuid;
gid_t ns_resgid;
unsigned long ns_interval;
unsigned long ns_watermark;
/* Disk layout information (static) */
unsigned int ns_blocksize_bits;
unsigned int ns_blocksize;
unsigned long ns_nsegments;
unsigned long ns_blocks_per_segment;
unsigned long ns_r_segments_percentage;
unsigned long ns_nrsvsegs;
unsigned long ns_first_data_block;
int ns_inode_size;
unsigned int ns_first_ino;
u32 ns_crc_seed;
/* /sys/fs/<nilfs>/<device> */
Annotation
- Immediate include surface: `linux/types.h`, `linux/buffer_head.h`, `linux/rbtree.h`, `linux/fs.h`, `linux/blkdev.h`, `linux/backing-dev.h`, `linux/slab.h`, `linux/refcount.h`.
- Detected declarations: `struct nilfs_sc_info`, `struct nilfs_sysfs_dev_subgroups`, `struct the_nilfs`, `struct nilfs_root`, `function nilfs_sb_need_update`, `function nilfs_sb_will_flip`, `function nilfs_get_root`, `function nilfs_valid_fs`, `function nilfs_get_segment_range`, `function nilfs_get_segment_start_blocknr`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- 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.