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.

Dependency Surface

Detected Declarations

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

Implementation Notes