fs/f2fs/f2fs.h
Source file repositories/reference/linux-study-clean/fs/f2fs/f2fs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/f2fs/f2fs.h- Extension
.h- Size
- 170075 bytes
- Lines
- 5142
- 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.
- 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/uio.hlinux/types.hlinux/mmzone.hlinux/page-flags.hlinux/slab.hlinux/crc32.hlinux/magic.hlinux/kobject.hlinux/sched.hlinux/cred.hlinux/sched/mm.hlinux/vmalloc.hlinux/bio.hlinux/blkdev.hlinux/quotaops.hlinux/part_stat.hlinux/rw_hint.hlinux/fscrypt.hlinux/fsverity.h
Detected Declarations
struct f2fs_fault_infostruct f2fs_rwsemstruct f2fs_mount_infostruct cp_statsstruct cp_controlstruct ino_entrystruct inode_entrystruct fsync_node_entrystruct ckpt_reqstruct ckpt_req_controlstruct discard_entrystruct discard_infostruct discard_cmdstruct discard_policystruct discard_cmd_controlstruct fsync_inode_entrystruct f2fs_filenamestruct f2fs_dentry_ptrstruct extent_infostruct extent_nodestruct extent_treestruct extent_tree_infostruct f2fs_map_blocksstruct f2fs_inode_infostruct f2fs_nm_infostruct dnode_of_datastruct flush_cmdstruct flush_cmd_controlstruct f2fs_sm_infostruct f2fs_io_infostruct bio_entrystruct f2fs_bio_infostruct f2fs_dev_infostruct inode_managementstruct atgc_managementstruct f2fs_time_statstruct f2fs_lock_contextstruct f2fs_gc_controlstruct compress_datastruct compress_ctxstruct compress_io_ctxstruct decompress_io_ctxstruct f2fs_sb_infostruct node_infostruct f2fs_dev_statsstruct f2fs_stat_infoenum fault_optionenum f2fs_mount_opt
Annotated Snippet
extern const struct file_operations f2fs_dir_operations;
extern const struct file_operations f2fs_file_operations;
extern const struct inode_operations f2fs_file_inode_operations;
extern const struct address_space_operations f2fs_dblock_aops;
extern const struct address_space_operations f2fs_node_aops;
extern const struct address_space_operations f2fs_meta_aops;
extern const struct inode_operations f2fs_dir_inode_operations;
extern const struct inode_operations f2fs_symlink_inode_operations;
extern const struct inode_operations f2fs_encrypted_symlink_inode_operations;
extern const struct inode_operations f2fs_special_inode_operations;
extern struct kmem_cache *f2fs_inode_entry_slab;
/*
* inline.c
*/
bool f2fs_may_inline_data(struct inode *inode);
bool f2fs_sanity_check_inline_data(struct inode *inode, struct folio *ifolio);
bool f2fs_may_inline_dentry(struct inode *inode);
void f2fs_do_read_inline_data(struct folio *folio, struct folio *ifolio);
void f2fs_truncate_inline_inode(struct inode *inode, struct folio *ifolio,
u64 from);
int f2fs_read_inline_data(struct inode *inode, struct folio *folio);
int f2fs_convert_inline_folio(struct dnode_of_data *dn, struct folio *folio);
int f2fs_convert_inline_inode(struct inode *inode);
int f2fs_try_convert_inline_dir(struct inode *dir, struct dentry *dentry);
int f2fs_write_inline_data(struct inode *inode, struct folio *folio);
int f2fs_recover_inline_data(struct inode *inode, struct folio *nfolio);
struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
const struct f2fs_filename *fname, struct folio **res_folio,
bool use_hash);
int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent,
struct folio *ifolio);
int f2fs_add_inline_entry(struct inode *dir, const struct f2fs_filename *fname,
struct inode *inode, nid_t ino, umode_t mode);
void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry,
struct folio *folio, struct inode *dir, struct inode *inode);
bool f2fs_empty_inline_dir(struct inode *dir);
int f2fs_read_inline_dir(struct file *file, struct dir_context *ctx,
struct fscrypt_str *fstr);
int f2fs_inline_data_fiemap(struct inode *inode,
struct fiemap_extent_info *fieinfo,
__u64 start, __u64 len);
/*
* shrinker.c
*/
unsigned long f2fs_shrink_count(struct shrinker *shrink,
struct shrink_control *sc);
unsigned long f2fs_shrink_scan(struct shrinker *shrink,
struct shrink_control *sc);
unsigned int f2fs_donate_files(void);
void f2fs_reclaim_caches(unsigned int reclaim_caches_kb);
void f2fs_join_shrinker(struct f2fs_sb_info *sbi);
void f2fs_leave_shrinker(struct f2fs_sb_info *sbi);
/*
* extent_cache.c
*/
bool sanity_check_extent_cache(struct inode *inode, struct folio *ifolio);
void f2fs_init_extent_tree(struct inode *inode);
void f2fs_drop_extent_tree(struct inode *inode);
void f2fs_destroy_extent_node(struct inode *inode);
void f2fs_destroy_extent_tree(struct inode *inode);
void f2fs_init_extent_cache_info(struct f2fs_sb_info *sbi);
int __init f2fs_create_extent_cache(void);
void f2fs_destroy_extent_cache(void);
/* read extent cache ops */
void f2fs_init_read_extent_tree(struct inode *inode, struct folio *ifolio);
bool f2fs_lookup_read_extent_cache(struct inode *inode, pgoff_t pgofs,
struct extent_info *ei);
bool f2fs_lookup_read_extent_cache_block(struct inode *inode, pgoff_t index,
block_t *blkaddr);
void f2fs_update_read_extent_cache(struct dnode_of_data *dn);
void f2fs_update_read_extent_cache_range(struct dnode_of_data *dn,
pgoff_t fofs, block_t blkaddr, unsigned int len);
unsigned int f2fs_shrink_read_extent_tree(struct f2fs_sb_info *sbi,
int nr_shrink);
/* block age extent cache ops */
void f2fs_init_age_extent_tree(struct inode *inode);
bool f2fs_lookup_age_extent_cache(struct inode *inode, pgoff_t pgofs,
struct extent_info *ei);
void f2fs_update_age_extent_cache(struct dnode_of_data *dn);
void f2fs_update_age_extent_cache_range(struct dnode_of_data *dn,
pgoff_t fofs, unsigned int len);
unsigned int f2fs_shrink_age_extent_tree(struct f2fs_sb_info *sbi,
int nr_shrink);
/*
Annotation
- Immediate include surface: `linux/uio.h`, `linux/types.h`, `linux/mmzone.h`, `linux/page-flags.h`, `linux/slab.h`, `linux/crc32.h`, `linux/magic.h`, `linux/kobject.h`.
- Detected declarations: `struct f2fs_fault_info`, `struct f2fs_rwsem`, `struct f2fs_mount_info`, `struct cp_stats`, `struct cp_control`, `struct ino_entry`, `struct inode_entry`, `struct fsync_node_entry`, `struct ckpt_req`, `struct ckpt_req_control`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern 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.