STRUCT NILFS_SC_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 STRUCT NILFS_SC_INFO(9) 🌸

okay bestie, welcome to the Kernel API Manual β€” today's main character is struct nilfs_sc_info, aka the Segment constructor information. no cap, this is the whole vibe of the NILFS2 segment constructor in one struct πŸ’…


✨ SYNOPSIS ✨

struct nilfs_sc_info {
    struct super_block     *sc_super;
    struct nilfs_root      *sc_root;
    unsigned long           sc_nblk_inc;
    struct list_head        sc_dirty_files;
    struct list_head        sc_gc_inodes;
    struct list_head        sc_iput_queue;
    struct work_struct      sc_iput_work;
    __u64 *sc_freesegs;
    size_t sc_nfreesegs;
    struct nilfs_inode_info *sc_dsync_inode;
    loff_t sc_dsync_start;
    loff_t sc_dsync_end;
    struct list_head        sc_segbufs;
    struct list_head        sc_write_logs;
    unsigned long           sc_segbuf_nblocks;
    struct nilfs_segment_buffer *sc_curseg;
    struct nilfs_cstage     sc_stage;
    struct nilfs_segsum_pointer sc_finfo_ptr;
    struct nilfs_segsum_pointer sc_binfo_ptr;
    unsigned long           sc_blk_cnt;
    unsigned long           sc_datablk_cnt;
    unsigned long           sc_nblk_this_inc;
    time64_t sc_seg_ctime;
    __u64 sc_cno;
    unsigned long           sc_flags;
    spinlock_t sc_state_lock;
    unsigned long           sc_state;
    unsigned long           sc_flush_request;
    wait_queue_head_t sc_wait_request;
    wait_queue_head_t sc_wait_daemon;
    __u32 sc_seq_request;
    __u32 sc_seq_accepted;
    __u32 sc_seq_done;
    int sc_sync;
    unsigned long           sc_interval;
    unsigned long           sc_mjcp_freq;
    unsigned long           sc_lseg_stime;
    unsigned long           sc_watermark;
    struct timer_list       sc_timer;
    struct task_struct     *sc_task;
 };

like, look at her. forty fields. she's thriving πŸ’–


πŸŽ€ MEMBERS πŸŽ€

okay so here's the field-by-field tour, bestie β€” every single one, no skips, fr fr:

  • sc_super β€” back pointer to the super_block struct. the classic "who's your parent" situation πŸ™ˆ
  • sc_root β€” root object of the current filesystem tree 🌳
  • sc_nblk_inc β€” block count of the current generation ✨
  • sc_dirty_files β€” list of files that are gonna get written πŸ’…
  • sc_gc_inodes β€” list of GC inodes that have blocks waiting to be written πŸ”₯
  • sc_iput_queue β€” list of inodes where iput still needs to happen
  • sc_iput_work β€” work struct that defers the iput call (she's patient, she waits 🫢)
  • sc_freesegs β€” array of segment numbers to be freed
  • sc_nfreesegs β€” how many segments are chillin' on sc_freesegs
  • sc_dsync_inode β€” the inode whose data pages get written for a sync operation
  • sc_dsync_start β€” start byte offset of those data pages
  • sc_dsync_end β€” end byte offset of those data pages (inclusive, bestie, don't forget πŸ’€)
  • sc_segbufs β€” list of segment buffers
  • sc_write_logs β€” list of segment buffers holding logs that are currently under writing
  • sc_segbuf_nblocks β€” number of available blocks in the segment buffers
  • sc_curseg β€” the current segment buffer, main character of the moment πŸ‘‘
  • sc_stage β€” the collection stage
  • sc_finfo_ptr β€” pointer to the current finfo struct in the segment summary
  • sc_binfo_ptr β€” pointer to the current binfo struct in the segment summary
  • sc_blk_cnt β€” block count of a file
  • sc_datablk_cnt β€” data block count of a file
  • sc_nblk_this_inc β€” number of blocks included in the current logical segment
  • sc_seg_ctime β€” creation time ⏰
  • sc_cno β€” checkpoint number of the current log 🧚
  • sc_flags β€” internal flags
  • sc_state_lock β€” spinlock for sc_state and so on, iykyk
  • sc_state β€” segctord state flags
  • sc_flush_request β€” inode bitmap of metadata files that need flushing
  • sc_wait_request β€” client request queue
  • sc_wait_daemon β€” daemon wait queue 😴
  • sc_seq_request β€” request counter
  • sc_seq_accepted β€” accepted request count
  • sc_seq_done β€” completion counter βœ…
  • sc_sync β€” request of an explicit sync operation
  • sc_interval β€” timeout value of background construction
  • sc_mjcp_freq β€” frequency of creating checkpoints
  • sc_lseg_stime β€” start time of the latest logical segment
  • sc_watermark β€” watermark for the number of dirty buffers
  • sc_timer β€” timer for segctord ⏱️
  • sc_task β€” current thread of segctord

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./fs/nilfs2/segment.h, plus the besties struct nilfs_recovery_info(9) and struct nilfs_cstage(9) β€” go say hi πŸ¦‹


okay that's the whole page, you ate that πŸ’… lowkey iconic of you to read all forty fields. this one lives under ./fs/nilfs2 and it's dated October 2026, so like… future vibes only 🌈 periodt, go read the header file bestie πŸ’œπŸŽ€

πŸ“¦ where this page comes from