linux/fs/f2fs/f2fs.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * fs/f2fs/f2fs.h
 *
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *             http://www.samsung.com/
 */
#ifndef _LINUX_F2FS_H
#define _LINUX_F2FS_H

#include <linux/uio.h>
#include <linux/types.h>
#include <linux/page-flags.h>
#include <linux/buffer_head.h>
#include <linux/slab.h>
#include <linux/crc32.h>
#include <linux/magic.h>
#include <linux/kobject.h>
#include <linux/sched.h>
#include <linux/cred.h>
#include <linux/sched/mm.h>
#include <linux/vmalloc.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/quotaops.h>
#include <linux/part_stat.h>
#include <linux/rw_hint.h>
#include <crypto/hash.h>

#include <linux/fscrypt.h>
#include <linux/fsverity.h>

struct pagevec;

#ifdef CONFIG_F2FS_CHECK_FS
#define f2fs_bug_on(sbi, condition)
#else
#define f2fs_bug_on
#endif

enum {};

#ifdef CONFIG_F2FS_FAULT_INJECTION
#define F2FS_ALL_FAULT_TYPE

struct f2fs_fault_info {};

extern const char *f2fs_fault_name[FAULT_MAX];
#define IS_FAULT_SET(fi, type)

/* maximum retry count for injected failure */
#define DEFAULT_FAILURE_RETRY_COUNT
#else
#define DEFAULT_FAILURE_RETRY_COUNT
#endif

/*
 * For mount options
 */
#define F2FS_MOUNT_DISABLE_ROLL_FORWARD
#define F2FS_MOUNT_DISCARD
#define F2FS_MOUNT_NOHEAP
#define F2FS_MOUNT_XATTR_USER
#define F2FS_MOUNT_POSIX_ACL
#define F2FS_MOUNT_DISABLE_EXT_IDENTIFY
#define F2FS_MOUNT_INLINE_XATTR
#define F2FS_MOUNT_INLINE_DATA
#define F2FS_MOUNT_INLINE_DENTRY
#define F2FS_MOUNT_FLUSH_MERGE
#define F2FS_MOUNT_NOBARRIER
#define F2FS_MOUNT_FASTBOOT
#define F2FS_MOUNT_READ_EXTENT_CACHE
#define F2FS_MOUNT_DATA_FLUSH
#define F2FS_MOUNT_FAULT_INJECTION
#define F2FS_MOUNT_USRQUOTA
#define F2FS_MOUNT_GRPQUOTA
#define F2FS_MOUNT_PRJQUOTA
#define F2FS_MOUNT_QUOTA
#define F2FS_MOUNT_INLINE_XATTR_SIZE
#define F2FS_MOUNT_RESERVE_ROOT
#define F2FS_MOUNT_DISABLE_CHECKPOINT
#define F2FS_MOUNT_NORECOVERY
#define F2FS_MOUNT_ATGC
#define F2FS_MOUNT_MERGE_CHECKPOINT
#define F2FS_MOUNT_GC_MERGE
#define F2FS_MOUNT_COMPRESS_CACHE
#define F2FS_MOUNT_AGE_EXTENT_CACHE

#define F2FS_OPTION(sbi)
#define clear_opt(sbi, option)
#define set_opt(sbi, option)
#define test_opt(sbi, option)

#define ver_after(a, b)

block_t;	/*
			 * should not change u32, since it is the on-disk block
			 * address format, __le32.
			 */
nid_t;

#define COMPRESS_EXT_NUM

/*
 * An implementation of an rwsem that is explicitly unfair to readers. This
 * prevents priority inversion when a low-priority reader acquires the read lock
 * while sleeping on the write lock but the write lock is needed by
 * higher-priority clients.
 */

struct f2fs_rwsem {};

struct f2fs_mount_info {};

#define F2FS_FEATURE_ENCRYPT
#define F2FS_FEATURE_BLKZONED
#define F2FS_FEATURE_ATOMIC_WRITE
#define F2FS_FEATURE_EXTRA_ATTR
#define F2FS_FEATURE_PRJQUOTA
#define F2FS_FEATURE_INODE_CHKSUM
#define F2FS_FEATURE_FLEXIBLE_INLINE_XATTR
#define F2FS_FEATURE_QUOTA_INO
#define F2FS_FEATURE_INODE_CRTIME
#define F2FS_FEATURE_LOST_FOUND
#define F2FS_FEATURE_VERITY
#define F2FS_FEATURE_SB_CHKSUM
#define F2FS_FEATURE_CASEFOLD
#define F2FS_FEATURE_COMPRESSION
#define F2FS_FEATURE_RO

#define __F2FS_HAS_FEATURE(raw_super, mask)
#define F2FS_HAS_FEATURE(sbi, mask)

/*
 * Default values for user and/or group using reserved blocks
 */
#define F2FS_DEF_RESUID
#define F2FS_DEF_RESGID

/*
 * For checkpoint manager
 */
enum {};

#define CP_UMOUNT
#define CP_FASTBOOT
#define CP_SYNC
#define CP_RECOVERY
#define CP_DISCARD
#define CP_TRIMMED
#define CP_PAUSE
#define CP_RESIZE

#define DEF_MAX_DISCARD_REQUEST
#define DEF_MIN_DISCARD_ISSUE_TIME
#define DEF_MID_DISCARD_ISSUE_TIME
#define DEF_MAX_DISCARD_ISSUE_TIME
#define DEF_DISCARD_URGENT_UTIL
#define DEF_CP_INTERVAL
#define DEF_IDLE_INTERVAL
#define DEF_DISABLE_INTERVAL
#define DEF_DISABLE_QUICK_INTERVAL
#define DEF_UMOUNT_DISCARD_TIMEOUT

struct cp_control {};

/*
 * indicate meta/data type
 */
enum {};

/* for the list of ino */
enum {};

struct ino_entry {};

/* for the list of inodes to be GCed */
struct inode_entry {};

struct fsync_node_entry {};

struct ckpt_req {};

struct ckpt_req_control {};

/* for the bitmap indicate blocks to be discarded */
struct discard_entry {};

/* minimum discard granularity, unit: block count */
#define MIN_DISCARD_GRANULARITY
/* default discard granularity of inner discard thread, unit: block count */
#define DEFAULT_DISCARD_GRANULARITY
/* default maximum discard granularity of ordered discard, unit: block count */
#define DEFAULT_MAX_ORDERED_DISCARD_GRANULARITY

/* max discard pend list number */
#define MAX_PLIST_NUM
#define plist_idx(blk_num)

enum {};

struct discard_info {};

struct discard_cmd {};

enum {};

enum {};

struct discard_policy {};

struct discard_cmd_control {};

/* for the list of fsync inodes, used only during recovery */
struct fsync_inode_entry {};

#define nats_in_cursum(jnl)
#define sits_in_cursum(jnl)

#define nat_in_journal(jnl, i)
#define nid_in_journal(jnl, i)
#define sit_in_journal(jnl, i)
#define segno_in_journal(jnl, i)

#define MAX_NAT_JENTRIES(jnl)
#define MAX_SIT_JENTRIES(jnl)

static inline int update_nats_in_cursum(struct f2fs_journal *journal, int i)
{}

static inline int update_sits_in_cursum(struct f2fs_journal *journal, int i)
{}

static inline bool __has_cursum_space(struct f2fs_journal *journal,
							int size, int type)
{}

/* for inline stuff */
#define DEF_INLINE_RESERVED_SIZE
static inline int get_extra_isize(struct inode *inode);
static inline int get_inline_xattr_addrs(struct inode *inode);
#define MAX_INLINE_DATA(inode)

/* for inline dir */
#define NR_INLINE_DENTRY(inode)
#define INLINE_DENTRY_BITMAP_SIZE(inode)
#define INLINE_RESERVED_SIZE(inode)

/*
 * For INODE and NODE manager
 */
/* for directory operations */

struct f2fs_filename {};

struct f2fs_dentry_ptr {};

static inline void make_dentry_ptr_block(struct inode *inode,
		struct f2fs_dentry_ptr *d, struct f2fs_dentry_block *t)
{}

static inline void make_dentry_ptr_inline(struct inode *inode,
					struct f2fs_dentry_ptr *d, void *t)
{}

/*
 * XATTR_NODE_OFFSET stores xattrs to one node block per file keeping -1
 * as its node offset to distinguish from index node blocks.
 * But some bits are used to mark the node block.
 */
#define XATTR_NODE_OFFSET
enum {};

#define DEFAULT_RETRY_IO_COUNT

/* congestion wait timeout value, default: 20ms */
#define DEFAULT_IO_TIMEOUT

/* maximum retry quota flush count */
#define DEFAULT_RETRY_QUOTA_FLUSH_COUNT

/* maximum retry of EIO'ed page */
#define MAX_RETRY_PAGE_EIO

#define F2FS_LINK_MAX

#define MAX_DIR_RA_PAGES

/* dirty segments threshold for triggering CP */
#define DEFAULT_DIRTY_THRESHOLD

#define RECOVERY_MAX_RA_BLOCKS
#define RECOVERY_MIN_RA_BLOCKS

#define F2FS_ONSTACK_PAGES

/* for in-memory extent cache entry */
#define F2FS_MIN_EXTENT_LEN

/* number of extent info in extent cache we try to shrink */
#define READ_EXTENT_CACHE_SHRINK_NUMBER

/* number of age extent info in extent cache we try to shrink */
#define AGE_EXTENT_CACHE_SHRINK_NUMBER
#define LAST_AGE_WEIGHT
#define SAME_AGE_REGION

/*
 * Define data block with age less than 1GB as hot data
 * define data block with age less than 10GB but more than 1GB as warm data
 */
#define DEF_HOT_DATA_AGE_THRESHOLD
#define DEF_WARM_DATA_AGE_THRESHOLD

/* extent cache type */
enum extent_type {};

struct extent_info {};

struct extent_node {};

struct extent_tree {};

struct extent_tree_info {};

/*
 * State of block returned by f2fs_map_blocks.
 */
#define F2FS_MAP_NEW
#define F2FS_MAP_MAPPED
#define F2FS_MAP_DELALLOC
#define F2FS_MAP_FLAGS

struct f2fs_map_blocks {};

/* for flag in get_data_block */
enum {};

/*
 * i_advise uses FADVISE_XXX_BIT. We can add additional hints later.
 */
#define FADVISE_COLD_BIT
#define FADVISE_LOST_PINO_BIT
#define FADVISE_ENCRYPT_BIT
#define FADVISE_ENC_NAME_BIT
#define FADVISE_KEEP_SIZE_BIT
#define FADVISE_HOT_BIT
#define FADVISE_VERITY_BIT
#define FADVISE_TRUNC_BIT

#define FADVISE_MODIFIABLE_BITS

#define file_is_cold(inode)
#define file_set_cold(inode)
#define file_clear_cold(inode)

#define file_wrong_pino(inode)
#define file_lost_pino(inode)
#define file_got_pino(inode)

#define file_is_encrypt(inode)
#define file_set_encrypt(inode)

#define file_enc_name(inode)
#define file_set_enc_name(inode)

#define file_keep_isize(inode)
#define file_set_keep_isize(inode)

#define file_is_hot(inode)
#define file_set_hot(inode)
#define file_clear_hot(inode)

#define file_is_verity(inode)
#define file_set_verity(inode)

#define file_should_truncate(inode)
#define file_need_truncate(inode)
#define file_dont_truncate(inode)

#define DEF_DIR_LEVEL

/* used for f2fs_inode_info->flags */
enum {};

struct f2fs_inode_info {};

static inline void get_read_extent_info(struct extent_info *ext,
					struct f2fs_extent *i_ext)
{}

static inline void set_raw_read_extent(struct extent_info *ext,
					struct f2fs_extent *i_ext)
{}

static inline bool __is_discard_mergeable(struct discard_info *back,
			struct discard_info *front, unsigned int max_len)
{}

static inline bool __is_discard_back_mergeable(struct discard_info *cur,
			struct discard_info *back, unsigned int max_len)
{}

static inline bool __is_discard_front_mergeable(struct discard_info *cur,
			struct discard_info *front, unsigned int max_len)
{}

/*
 * For free nid management
 */
enum nid_state {};

enum nat_state {};

struct f2fs_nm_info {};

/*
 * this structure is used as one of function parameters.
 * all the information are dedicated to a given direct node block determined
 * by the data offset in a file.
 */
struct dnode_of_data {};

static inline void set_new_dnode(struct dnode_of_data *dn, struct inode *inode,
		struct page *ipage, struct page *npage, nid_t nid)
{}

/*
 * For SIT manager
 *
 * By default, there are 6 active log areas across the whole main area.
 * When considering hot and cold data separation to reduce cleaning overhead,
 * we split 3 for data logs and 3 for node logs as hot, warm, and cold types,
 * respectively.
 * In the current design, you should not change the numbers intentionally.
 * Instead, as a mount option such as active_logs=x, you can use 2, 4, and 6
 * logs individually according to the underlying devices. (default: 6)
 * Just in case, on-disk layout covers maximum 16 logs that consist of 8 for
 * data and 8 for node logs.
 */
#define NR_CURSEG_DATA_TYPE
#define NR_CURSEG_NODE_TYPE
#define NR_CURSEG_INMEM_TYPE
#define NR_CURSEG_RO_TYPE
#define NR_CURSEG_PERSIST_TYPE
#define NR_CURSEG_TYPE

enum {};

struct flush_cmd {};

struct flush_cmd_control {};

struct f2fs_sm_info {};

/*
 * For superblock
 */
/*
 * COUNT_TYPE for monitoring
 *
 * f2fs monitors the number of several block types such as on-writeback,
 * dirty dentry blocks, dirty node blocks, and dirty meta blocks.
 */
#define WB_DATA_TYPE(p, f)
enum count_type {};

/*
 * The below are the page types of bios used in submit_bio().
 * The available types are:
 * DATA			User data pages. It operates as async mode.
 * NODE			Node pages. It operates as async mode.
 * META			FS metadata pages such as SIT, NAT, CP.
 * NR_PAGE_TYPE		The number of page types.
 * META_FLUSH		Make sure the previous pages are written
 *			with waiting the bio's completion
 * ...			Only can be used with META.
 */
#define PAGE_TYPE_OF_BIO(type)
#define PAGE_TYPE_ON_MAIN(type)
enum page_type {};

enum temp_type {};

enum need_lock_type {};

enum cp_reason_type {};

enum iostat_type {};

struct f2fs_io_info {};

struct bio_entry {};

#define is_read_io(rw)
struct f2fs_bio_info {};

#define FDEV(i)
#define RDEV(i)
struct f2fs_dev_info {};

enum inode_type {};

/* for inner inode cache management */
struct inode_management {};

/* for GC_AT */
struct atgc_management {};

struct f2fs_gc_control {};

/*
 * For s_flag in struct f2fs_sb_info
 * Modification on enum should be synchronized with s_flag array
 */
enum {};

enum {};

/* Note that you need to keep synchronization with this gc_mode_names array */
enum {};

enum {};

enum {};

enum {};

enum fsync_mode {};

enum {};

enum {};

enum {};

enum errors_option {};

enum {};

static inline int f2fs_test_bit(unsigned int nr, char *addr);
static inline void f2fs_set_bit(unsigned int nr, char *addr);
static inline void f2fs_clear_bit(unsigned int nr, char *addr);

/*
 * Layout of f2fs page.private:
 *
 * Layout A: lowest bit should be 1
 * | bit0 = 1 | bit1 | bit2 | ... | bit MAX | private data .... |
 * bit 0	PAGE_PRIVATE_NOT_POINTER
 * bit 1	PAGE_PRIVATE_ONGOING_MIGRATION
 * bit 2	PAGE_PRIVATE_INLINE_INODE
 * bit 3	PAGE_PRIVATE_REF_RESOURCE
 * bit 4-	f2fs private data
 *
 * Layout B: lowest bit should be 0
 * page.private is a wrapped pointer.
 */
enum {};

/* For compression */
enum compress_algorithm_type {};

enum compress_flag {};

#define COMPRESS_WATERMARK
#define COMPRESS_PERCENT

#define COMPRESS_DATA_RESERVED_SIZE
struct compress_data {};

#define COMPRESS_HEADER_SIZE

#define F2FS_COMPRESSED_PAGE_MAGIC

#define F2FS_ZSTD_DEFAULT_CLEVEL

#define COMPRESS_LEVEL_OFFSET

/* compress context */
struct compress_ctx {};

/* compress context for write IO path */
struct compress_io_ctx {};

/* Context for decompressing one cluster on the read IO path */
struct decompress_io_ctx {};

#define NULL_CLUSTER
#define MIN_COMPRESS_LOG_SIZE
#define MAX_COMPRESS_LOG_SIZE
#define MAX_COMPRESS_WINDOW_SIZE(log_size)

struct f2fs_sb_info {};

/* Definitions to access f2fs_sb_info */
#define SEGS_TO_BLKS(sbi, segs)
#define BLKS_TO_SEGS(sbi, blks)

#define BLKS_PER_SEG(sbi)
#define BLKS_PER_SEC(sbi)
#define SEGS_PER_SEC(sbi)

__printf(3, 4)
void f2fs_printk(struct f2fs_sb_info *sbi, bool limit_rate, const char *fmt, ...);

#define f2fs_err(sbi, fmt, ...)
#define f2fs_warn(sbi, fmt, ...)
#define f2fs_notice(sbi, fmt, ...)
#define f2fs_info(sbi, fmt, ...)
#define f2fs_debug(sbi, fmt, ...)

#define f2fs_err_ratelimited(sbi, fmt, ...)
#define f2fs_warn_ratelimited(sbi, fmt, ...)
#define f2fs_info_ratelimited(sbi, fmt, ...)

#ifdef CONFIG_F2FS_FAULT_INJECTION
#define time_to_inject(sbi, type)
static inline bool __time_to_inject(struct f2fs_sb_info *sbi, int type,
				const char *func, const char *parent_func)
{}
#else
static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type)
{
	return false;
}
#endif

/*
 * Test if the mounted volume is a multi-device volume.
 *   - For a single regular disk volume, sbi->s_ndevs is 0.
 *   - For a single zoned disk volume, sbi->s_ndevs is 1.
 *   - For a multi-device volume, sbi->s_ndevs is always 2 or more.
 */
static inline bool f2fs_is_multi_device(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_update_time(struct f2fs_sb_info *sbi, int type)
{}

static inline bool f2fs_time_over(struct f2fs_sb_info *sbi, int type)
{}

static inline unsigned int f2fs_time_to_wait(struct f2fs_sb_info *sbi,
						int type)
{}

/*
 * Inline functions
 */
static inline u32 __f2fs_crc32(struct f2fs_sb_info *sbi, u32 crc,
			      const void *address, unsigned int length)
{}

static inline u32 f2fs_crc32(struct f2fs_sb_info *sbi, const void *address,
			   unsigned int length)
{}

static inline bool f2fs_crc_valid(struct f2fs_sb_info *sbi, __u32 blk_crc,
				  void *buf, size_t buf_size)
{}

static inline u32 f2fs_chksum(struct f2fs_sb_info *sbi, u32 crc,
			      const void *address, unsigned int length)
{}

static inline struct f2fs_inode_info *F2FS_I(struct inode *inode)
{}

static inline struct f2fs_sb_info *F2FS_SB(struct super_block *sb)
{}

static inline struct f2fs_sb_info *F2FS_I_SB(struct inode *inode)
{}

static inline struct f2fs_sb_info *F2FS_M_SB(struct address_space *mapping)
{}

static inline struct f2fs_sb_info *F2FS_P_SB(struct page *page)
{}

static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi)
{}

static inline struct f2fs_checkpoint *F2FS_CKPT(struct f2fs_sb_info *sbi)
{}

static inline struct f2fs_node *F2FS_NODE(struct page *page)
{}

static inline struct f2fs_inode *F2FS_INODE(struct page *page)
{}

static inline struct f2fs_nm_info *NM_I(struct f2fs_sb_info *sbi)
{}

static inline struct f2fs_sm_info *SM_I(struct f2fs_sb_info *sbi)
{}

static inline struct sit_info *SIT_I(struct f2fs_sb_info *sbi)
{}

static inline struct free_segmap_info *FREE_I(struct f2fs_sb_info *sbi)
{}

static inline struct dirty_seglist_info *DIRTY_I(struct f2fs_sb_info *sbi)
{}

static inline struct address_space *META_MAPPING(struct f2fs_sb_info *sbi)
{}

static inline struct address_space *NODE_MAPPING(struct f2fs_sb_info *sbi)
{}

static inline bool is_sbi_flag_set(struct f2fs_sb_info *sbi, unsigned int type)
{}

static inline void set_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
{}

static inline void clear_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
{}

static inline unsigned long long cur_cp_version(struct f2fs_checkpoint *cp)
{}

static inline unsigned long f2fs_qf_ino(struct super_block *sb, int type)
{}

static inline __u64 cur_cp_crc(struct f2fs_checkpoint *cp)
{}

static inline bool __is_set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
{}

static inline bool is_set_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
{}

static inline void __set_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
{}

static inline void set_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
{}

static inline void __clear_ckpt_flags(struct f2fs_checkpoint *cp, unsigned int f)
{}

static inline void clear_ckpt_flags(struct f2fs_sb_info *sbi, unsigned int f)
{}

#define init_f2fs_rwsem(sem)

static inline void __init_f2fs_rwsem(struct f2fs_rwsem *sem,
		const char *sem_name, struct lock_class_key *key)
{}

static inline int f2fs_rwsem_is_locked(struct f2fs_rwsem *sem)
{}

static inline int f2fs_rwsem_is_contended(struct f2fs_rwsem *sem)
{}

static inline void f2fs_down_read(struct f2fs_rwsem *sem)
{}

static inline int f2fs_down_read_trylock(struct f2fs_rwsem *sem)
{}

static inline void f2fs_up_read(struct f2fs_rwsem *sem)
{}

static inline void f2fs_down_write(struct f2fs_rwsem *sem)
{}

#ifdef CONFIG_DEBUG_LOCK_ALLOC
static inline void f2fs_down_read_nested(struct f2fs_rwsem *sem, int subclass)
{}

static inline void f2fs_down_write_nested(struct f2fs_rwsem *sem, int subclass)
{}
#else
#define f2fs_down_read_nested
#define f2fs_down_write_nested
#endif

static inline int f2fs_down_write_trylock(struct f2fs_rwsem *sem)
{}

static inline void f2fs_up_write(struct f2fs_rwsem *sem)
{}

static inline void f2fs_lock_op(struct f2fs_sb_info *sbi)
{}

static inline int f2fs_trylock_op(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_lock_all(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
{}

static inline int __get_cp_reason(struct f2fs_sb_info *sbi)
{}

static inline bool __remain_node_summaries(int reason)
{}

static inline bool __exist_node_summaries(struct f2fs_sb_info *sbi)
{}

/*
 * Check whether the inode has blocks or not
 */
static inline int F2FS_HAS_BLOCKS(struct inode *inode)
{}

static inline bool f2fs_has_xattr_block(unsigned int ofs)
{}

static inline bool __allow_reserved_blocks(struct f2fs_sb_info *sbi,
					struct inode *inode, bool cap)
{}

static inline unsigned int get_available_block_count(struct f2fs_sb_info *sbi,
						struct inode *inode, bool cap)
{}

static inline void f2fs_i_blocks_write(struct inode *, block_t, bool, bool);
static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
				 struct inode *inode, blkcnt_t *count, bool partial)
{}

#define PAGE_PRIVATE_GET_FUNC(name, flagname)

#define PAGE_PRIVATE_SET_FUNC(name, flagname)

#define PAGE_PRIVATE_CLEAR_FUNC(name, flagname)

PAGE_PRIVATE_GET_FUNC(nonpointer, NOT_POINTER);
PAGE_PRIVATE_GET_FUNC(inline, INLINE_INODE);
PAGE_PRIVATE_GET_FUNC(gcing, ONGOING_MIGRATION);

PAGE_PRIVATE_SET_FUNC(reference, REF_RESOURCE);
PAGE_PRIVATE_SET_FUNC(inline, INLINE_INODE);
PAGE_PRIVATE_SET_FUNC(gcing, ONGOING_MIGRATION);

PAGE_PRIVATE_CLEAR_FUNC(reference, REF_RESOURCE);
PAGE_PRIVATE_CLEAR_FUNC(inline, INLINE_INODE);
PAGE_PRIVATE_CLEAR_FUNC(gcing, ONGOING_MIGRATION);

static inline unsigned long get_page_private_data(struct page *page)
{}

static inline void set_page_private_data(struct page *page, unsigned long data)
{}

static inline void clear_page_private_data(struct page *page)
{}

static inline void clear_page_private_all(struct page *page)
{}

static inline void dec_valid_block_count(struct f2fs_sb_info *sbi,
						struct inode *inode,
						block_t count)
{}

static inline void inc_page_count(struct f2fs_sb_info *sbi, int count_type)
{}

static inline void inode_inc_dirty_pages(struct inode *inode)
{}

static inline void dec_page_count(struct f2fs_sb_info *sbi, int count_type)
{}

static inline void inode_dec_dirty_pages(struct inode *inode)
{}

static inline void inc_atomic_write_cnt(struct inode *inode)
{}

static inline void release_atomic_write_cnt(struct inode *inode)
{}

static inline s64 get_pages(struct f2fs_sb_info *sbi, int count_type)
{}

static inline int get_dirty_pages(struct inode *inode)
{}

static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
{}

static inline block_t valid_user_blocks(struct f2fs_sb_info *sbi)
{}

static inline block_t discard_blocks(struct f2fs_sb_info *sbi)
{}

static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag)
{}

static inline block_t __cp_payload(struct f2fs_sb_info *sbi)
{}

static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)
{}

static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
{}

static inline block_t __start_cp_next_addr(struct f2fs_sb_info *sbi)
{}

static inline void __set_cp_next_pack(struct f2fs_sb_info *sbi)
{}

static inline block_t __start_sum_addr(struct f2fs_sb_info *sbi)
{}

extern void f2fs_mark_inode_dirty_sync(struct inode *inode, bool sync);
static inline int inc_valid_node_count(struct f2fs_sb_info *sbi,
					struct inode *inode, bool is_inode)
{}

static inline void dec_valid_node_count(struct f2fs_sb_info *sbi,
					struct inode *inode, bool is_inode)
{}

static inline unsigned int valid_node_count(struct f2fs_sb_info *sbi)
{}

static inline void inc_valid_inode_count(struct f2fs_sb_info *sbi)
{}

static inline void dec_valid_inode_count(struct f2fs_sb_info *sbi)
{}

static inline s64 valid_inode_count(struct f2fs_sb_info *sbi)
{}

static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
						pgoff_t index, bool for_write)
{}

static inline struct page *f2fs_pagecache_get_page(
				struct address_space *mapping, pgoff_t index,
				fgf_t fgp_flags, gfp_t gfp_mask)
{}

static inline void f2fs_put_page(struct page *page, int unlock)
{}

static inline void f2fs_put_dnode(struct dnode_of_data *dn)
{}

static inline struct kmem_cache *f2fs_kmem_cache_create(const char *name,
					size_t size)
{}

static inline void *f2fs_kmem_cache_alloc_nofail(struct kmem_cache *cachep,
						gfp_t flags)
{}

static inline void *f2fs_kmem_cache_alloc(struct kmem_cache *cachep,
			gfp_t flags, bool nofail, struct f2fs_sb_info *sbi)
{}

static inline bool is_inflight_io(struct f2fs_sb_info *sbi, int type)
{}

static inline bool is_idle(struct f2fs_sb_info *sbi, int type)
{}

static inline void f2fs_radix_tree_insert(struct radix_tree_root *root,
				unsigned long index, void *item)
{}

#define RAW_IS_INODE(p)

static inline bool IS_INODE(struct page *page)
{}

static inline int offset_in_addr(struct f2fs_inode *i)
{}

static inline __le32 *blkaddr_in_node(struct f2fs_node *node)
{}

static inline int f2fs_has_extra_attr(struct inode *inode);
static inline block_t data_blkaddr(struct inode *inode,
			struct page *node_page, unsigned int offset)
{}

static inline block_t f2fs_data_blkaddr(struct dnode_of_data *dn)
{}

static inline int f2fs_test_bit(unsigned int nr, char *addr)
{}

static inline void f2fs_set_bit(unsigned int nr, char *addr)
{}

static inline void f2fs_clear_bit(unsigned int nr, char *addr)
{}

static inline int f2fs_test_and_set_bit(unsigned int nr, char *addr)
{}

static inline int f2fs_test_and_clear_bit(unsigned int nr, char *addr)
{}

static inline void f2fs_change_bit(unsigned int nr, char *addr)
{}

/*
 * On-disk inode flags (f2fs_inode::i_flags)
 */
#define F2FS_COMPR_FL
#define F2FS_SYNC_FL
#define F2FS_IMMUTABLE_FL
#define F2FS_APPEND_FL
#define F2FS_NODUMP_FL
#define F2FS_NOATIME_FL
#define F2FS_NOCOMP_FL
#define F2FS_INDEX_FL
#define F2FS_DIRSYNC_FL
#define F2FS_PROJINHERIT_FL
#define F2FS_CASEFOLD_FL

#define F2FS_QUOTA_DEFAULT_FL

/* Flags that should be inherited by new inodes from their parent. */
#define F2FS_FL_INHERITED

/* Flags that are appropriate for regular files (all but dir-specific ones). */
#define F2FS_REG_FLMASK

/* Flags that are appropriate for non-directories/regular files. */
#define F2FS_OTHER_FLMASK

static inline __u32 f2fs_mask_flags(umode_t mode, __u32 flags)
{}

static inline void __mark_inode_dirty_flag(struct inode *inode,
						int flag, bool set)
{}

static inline void set_inode_flag(struct inode *inode, int flag)
{}

static inline int is_inode_flag_set(struct inode *inode, int flag)
{}

static inline void clear_inode_flag(struct inode *inode, int flag)
{}

static inline bool f2fs_verity_in_progress(struct inode *inode)
{}

static inline void set_acl_inode(struct inode *inode, umode_t mode)
{}

static inline void f2fs_i_links_write(struct inode *inode, bool inc)
{}

static inline void f2fs_i_blocks_write(struct inode *inode,
					block_t diff, bool add, bool claim)
{}

static inline bool f2fs_is_atomic_file(struct inode *inode);

static inline void f2fs_i_size_write(struct inode *inode, loff_t i_size)
{}

static inline void f2fs_i_depth_write(struct inode *inode, unsigned int depth)
{}

static inline void f2fs_i_gc_failures_write(struct inode *inode,
					unsigned int count)
{}

static inline void f2fs_i_xnid_write(struct inode *inode, nid_t xnid)
{}

static inline void f2fs_i_pino_write(struct inode *inode, nid_t pino)
{}

static inline void get_inline_info(struct inode *inode, struct f2fs_inode *ri)
{}

static inline void set_raw_inline(struct inode *inode, struct f2fs_inode *ri)
{}

static inline int f2fs_has_extra_attr(struct inode *inode)
{}

static inline int f2fs_has_inline_xattr(struct inode *inode)
{}

static inline int f2fs_compressed_file(struct inode *inode)
{}

static inline bool f2fs_need_compress_data(struct inode *inode)
{}

static inline unsigned int addrs_per_page(struct inode *inode,
							bool is_inode)
{}

static inline void *inline_xattr_addr(struct inode *inode, struct page *page)
{}

static inline int inline_xattr_size(struct inode *inode)
{}

/*
 * Notice: check inline_data flag without inode page lock is unsafe.
 * It could change at any time by f2fs_convert_inline_page().
 */
static inline int f2fs_has_inline_data(struct inode *inode)
{}

static inline int f2fs_exist_data(struct inode *inode)
{}

static inline int f2fs_has_inline_dots(struct inode *inode)
{}

static inline int f2fs_is_mmap_file(struct inode *inode)
{}

static inline bool f2fs_is_pinned_file(struct inode *inode)
{}

static inline bool f2fs_is_atomic_file(struct inode *inode)
{}

static inline bool f2fs_is_cow_file(struct inode *inode)
{}

static inline __le32 *get_dnode_addr(struct inode *inode,
					struct page *node_page);
static inline void *inline_data_addr(struct inode *inode, struct page *page)
{}

static inline int f2fs_has_inline_dentry(struct inode *inode)
{}

static inline int is_file(struct inode *inode, int type)
{}

static inline void set_file(struct inode *inode, int type)
{}

static inline void clear_file(struct inode *inode, int type)
{}

static inline bool f2fs_is_time_consistent(struct inode *inode)
{}

static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
{}

static inline bool f2fs_readonly(struct super_block *sb)
{}

static inline bool f2fs_cp_error(struct f2fs_sb_info *sbi)
{}

static inline void *f2fs_kmalloc(struct f2fs_sb_info *sbi,
					size_t size, gfp_t flags)
{}

static inline void *f2fs_getname(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_putname(char *buf)
{}

static inline void *f2fs_kzalloc(struct f2fs_sb_info *sbi,
					size_t size, gfp_t flags)
{}

static inline void *f2fs_kvmalloc(struct f2fs_sb_info *sbi,
					size_t size, gfp_t flags)
{}

static inline void *f2fs_kvzalloc(struct f2fs_sb_info *sbi,
					size_t size, gfp_t flags)
{}

static inline int get_extra_isize(struct inode *inode)
{}

static inline int get_inline_xattr_addrs(struct inode *inode)
{}

static inline __le32 *get_dnode_addr(struct inode *inode,
					struct page *node_page)
{}

#define f2fs_get_inode_mode(i)

#define F2FS_MIN_EXTRA_ATTR_SIZE

#define F2FS_TOTAL_EXTRA_ATTR_SIZE	\

#define F2FS_OLD_ATTRIBUTE_SIZE
#define F2FS_FITS_IN_INODE(f2fs_inode, extra_isize, field)	\

#define __is_large_section(sbi)

#define __is_meta_io(fio)

bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
					block_t blkaddr, int type);
static inline void verify_blkaddr(struct f2fs_sb_info *sbi,
					block_t blkaddr, int type)
{}

static inline bool __is_valid_data_blkaddr(block_t blkaddr)
{}

/*
 * file.c
 */
int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);
int f2fs_do_truncate_blocks(struct inode *inode, u64 from, bool lock);
int f2fs_truncate_blocks(struct inode *inode, u64 from, bool lock);
int f2fs_truncate(struct inode *inode);
int f2fs_getattr(struct mnt_idmap *idmap, const struct path *path,
		 struct kstat *stat, u32 request_mask, unsigned int flags);
int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
		 struct iattr *attr);
int f2fs_truncate_hole(struct inode *inode, pgoff_t pg_start, pgoff_t pg_end);
void f2fs_truncate_data_blocks_range(struct dnode_of_data *dn, int count);
int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag,
							bool readonly);
int f2fs_precache_extents(struct inode *inode);
int f2fs_fileattr_get(struct dentry *dentry, struct fileattr *fa);
int f2fs_fileattr_set(struct mnt_idmap *idmap,
		      struct dentry *dentry, struct fileattr *fa);
long f2fs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
int f2fs_transfer_project_quota(struct inode *inode, kprojid_t kprojid);
int f2fs_pin_file_control(struct inode *inode, bool inc);

/*
 * inode.c
 */
void f2fs_set_inode_flags(struct inode *inode);
bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct page *page);
void f2fs_inode_chksum_set(struct f2fs_sb_info *sbi, struct page *page);
struct inode *f2fs_iget(struct super_block *sb, unsigned long ino);
struct inode *f2fs_iget_retry(struct super_block *sb, unsigned long ino);
int f2fs_try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink);
void f2fs_update_inode(struct inode *inode, struct page *node_page);
void f2fs_update_inode_page(struct inode *inode);
int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc);
void f2fs_evict_inode(struct inode *inode);
void f2fs_handle_failed_inode(struct inode *inode);

/*
 * namei.c
 */
int f2fs_update_extension_list(struct f2fs_sb_info *sbi, const char *name,
							bool hot, bool set);
struct dentry *f2fs_get_parent(struct dentry *child);
int f2fs_get_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
		     struct inode **new_inode);

/*
 * dir.c
 */
#if IS_ENABLED(CONFIG_UNICODE)
int f2fs_init_casefolded_name(const struct inode *dir,
			      struct f2fs_filename *fname);
void f2fs_free_casefolded_name(struct f2fs_filename *fname);
#else
static inline int f2fs_init_casefolded_name(const struct inode *dir,
					    struct f2fs_filename *fname)
{
	return 0;
}

static inline void f2fs_free_casefolded_name(struct f2fs_filename *fname)
{
}
#endif /* CONFIG_UNICODE */

int f2fs_setup_filename(struct inode *dir, const struct qstr *iname,
			int lookup, struct f2fs_filename *fname);
int f2fs_prepare_lookup(struct inode *dir, struct dentry *dentry,
			struct f2fs_filename *fname);
void f2fs_free_filename(struct f2fs_filename *fname);
struct f2fs_dir_entry *f2fs_find_target_dentry(const struct f2fs_dentry_ptr *d,
			const struct f2fs_filename *fname, int *max_slots);
int f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d,
			unsigned int start_pos, struct fscrypt_str *fstr);
void f2fs_do_make_empty_dir(struct inode *inode, struct inode *parent,
			struct f2fs_dentry_ptr *d);
struct page *f2fs_init_inode_metadata(struct inode *inode, struct inode *dir,
			const struct f2fs_filename *fname, struct page *dpage);
void f2fs_update_parent_metadata(struct inode *dir, struct inode *inode,
			unsigned int current_depth);
int f2fs_room_for_filename(const void *bitmap, int slots, int max_slots);
void f2fs_drop_nlink(struct inode *dir, struct inode *inode);
struct f2fs_dir_entry *__f2fs_find_entry(struct inode *dir,
					 const struct f2fs_filename *fname,
					 struct page **res_page);
struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
			const struct qstr *child, struct page **res_page);
struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p);
ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr,
			struct page **page);
void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de,
			struct page *page, struct inode *inode);
bool f2fs_has_enough_room(struct inode *dir, struct page *ipage,
			  const struct f2fs_filename *fname);
void f2fs_update_dentry(nid_t ino, umode_t mode, struct f2fs_dentry_ptr *d,
			const struct fscrypt_str *name, f2fs_hash_t name_hash,
			unsigned int bit_pos);
int f2fs_add_regular_entry(struct inode *dir, const struct f2fs_filename *fname,
			struct inode *inode, nid_t ino, umode_t mode);
int f2fs_add_dentry(struct inode *dir, const struct f2fs_filename *fname,
			struct inode *inode, nid_t ino, umode_t mode);
int f2fs_do_add_link(struct inode *dir, const struct qstr *name,
			struct inode *inode, nid_t ino, umode_t mode);
void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page,
			struct inode *dir, struct inode *inode);
int f2fs_do_tmpfile(struct inode *inode, struct inode *dir,
					struct f2fs_filename *fname);
bool f2fs_empty_dir(struct inode *dir);

static inline int f2fs_add_link(struct dentry *dentry, struct inode *inode)
{}

/*
 * super.c
 */
int f2fs_inode_dirtied(struct inode *inode, bool sync);
void f2fs_inode_synced(struct inode *inode);
int f2fs_dquot_initialize(struct inode *inode);
int f2fs_enable_quota_files(struct f2fs_sb_info *sbi, bool rdonly);
int f2fs_quota_sync(struct super_block *sb, int type);
loff_t max_file_blocks(struct inode *inode);
void f2fs_quota_off_umount(struct super_block *sb);
void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag);
void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason,
							bool irq_context);
void f2fs_handle_error(struct f2fs_sb_info *sbi, unsigned char error);
void f2fs_handle_error_async(struct f2fs_sb_info *sbi, unsigned char error);
int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover);
int f2fs_sync_fs(struct super_block *sb, int sync);
int f2fs_sanity_check_ckpt(struct f2fs_sb_info *sbi);

/*
 * hash.c
 */
void f2fs_hash_filename(const struct inode *dir, struct f2fs_filename *fname);

/*
 * node.c
 */
struct node_info;

int f2fs_check_nid_range(struct f2fs_sb_info *sbi, nid_t nid);
bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type);
bool f2fs_in_warm_node_list(struct f2fs_sb_info *sbi, struct page *page);
void f2fs_init_fsync_node_info(struct f2fs_sb_info *sbi);
void f2fs_del_fsync_node_entry(struct f2fs_sb_info *sbi, struct page *page);
void f2fs_reset_fsync_node_info(struct f2fs_sb_info *sbi);
int f2fs_need_dentry_mark(struct f2fs_sb_info *sbi, nid_t nid);
bool f2fs_is_checkpointed_node(struct f2fs_sb_info *sbi, nid_t nid);
bool f2fs_need_inode_block_update(struct f2fs_sb_info *sbi, nid_t ino);
int f2fs_get_node_info(struct f2fs_sb_info *sbi, nid_t nid,
				struct node_info *ni, bool checkpoint_context);
pgoff_t f2fs_get_next_page_offset(struct dnode_of_data *dn, pgoff_t pgofs);
int f2fs_get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode);
int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from);
int f2fs_truncate_xattr_node(struct inode *inode);
int f2fs_wait_on_node_pages_writeback(struct f2fs_sb_info *sbi,
					unsigned int seq_id);
bool f2fs_nat_bitmap_enabled(struct f2fs_sb_info *sbi);
int f2fs_remove_inode_page(struct inode *inode);
struct page *f2fs_new_inode_page(struct inode *inode);
struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs);
void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid);
struct page *f2fs_get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid);
struct page *f2fs_get_node_page_ra(struct page *parent, int start);
int f2fs_move_node_page(struct page *node_page, int gc_type);
void f2fs_flush_inline_data(struct f2fs_sb_info *sbi);
int f2fs_fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode,
			struct writeback_control *wbc, bool atomic,
			unsigned int *seq_id);
int f2fs_sync_node_pages(struct f2fs_sb_info *sbi,
			struct writeback_control *wbc,
			bool do_balance, enum iostat_type io_type);
int f2fs_build_free_nids(struct f2fs_sb_info *sbi, bool sync, bool mount);
bool f2fs_alloc_nid(struct f2fs_sb_info *sbi, nid_t *nid);
void f2fs_alloc_nid_done(struct f2fs_sb_info *sbi, nid_t nid);
void f2fs_alloc_nid_failed(struct f2fs_sb_info *sbi, nid_t nid);
int f2fs_try_to_free_nids(struct f2fs_sb_info *sbi, int nr_shrink);
int f2fs_recover_inline_xattr(struct inode *inode, struct page *page);
int f2fs_recover_xattr_data(struct inode *inode, struct page *page);
int f2fs_recover_inode_page(struct f2fs_sb_info *sbi, struct page *page);
int f2fs_restore_node_summary(struct f2fs_sb_info *sbi,
			unsigned int segno, struct f2fs_summary_block *sum);
void f2fs_enable_nat_bits(struct f2fs_sb_info *sbi);
int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc);
int f2fs_build_node_manager(struct f2fs_sb_info *sbi);
void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi);
int __init f2fs_create_node_manager_caches(void);
void f2fs_destroy_node_manager_caches(void);

/*
 * segment.c
 */
bool f2fs_need_SSR(struct f2fs_sb_info *sbi);
int f2fs_commit_atomic_write(struct inode *inode);
void f2fs_abort_atomic_write(struct inode *inode, bool clean);
void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need);
void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg);
int f2fs_issue_flush(struct f2fs_sb_info *sbi, nid_t ino);
int f2fs_create_flush_cmd_control(struct f2fs_sb_info *sbi);
int f2fs_flush_device_cache(struct f2fs_sb_info *sbi);
void f2fs_destroy_flush_cmd_control(struct f2fs_sb_info *sbi, bool free);
void f2fs_invalidate_blocks(struct f2fs_sb_info *sbi, block_t addr);
bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr);
int f2fs_start_discard_thread(struct f2fs_sb_info *sbi);
void f2fs_drop_discard_cmd(struct f2fs_sb_info *sbi);
void f2fs_stop_discard_thread(struct f2fs_sb_info *sbi);
bool f2fs_issue_discard_timeout(struct f2fs_sb_info *sbi);
void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi,
					struct cp_control *cpc);
void f2fs_dirty_to_prefree(struct f2fs_sb_info *sbi);
block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi);
int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable);
void f2fs_release_discard_addrs(struct f2fs_sb_info *sbi);
int f2fs_npages_for_summary_flush(struct f2fs_sb_info *sbi, bool for_ra);
bool f2fs_segment_has_free_slot(struct f2fs_sb_info *sbi, int segno);
int f2fs_init_inmem_curseg(struct f2fs_sb_info *sbi);
int f2fs_reinit_atgc_curseg(struct f2fs_sb_info *sbi);
void f2fs_save_inmem_curseg(struct f2fs_sb_info *sbi);
void f2fs_restore_inmem_curseg(struct f2fs_sb_info *sbi);
int f2fs_allocate_segment_for_resize(struct f2fs_sb_info *sbi, int type,
					unsigned int start, unsigned int end);
int f2fs_allocate_new_section(struct f2fs_sb_info *sbi, int type, bool force);
int f2fs_allocate_pinning_section(struct f2fs_sb_info *sbi);
int f2fs_allocate_new_segments(struct f2fs_sb_info *sbi);
int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range);
bool f2fs_exist_trim_candidates(struct f2fs_sb_info *sbi,
					struct cp_control *cpc);
struct page *f2fs_get_sum_page(struct f2fs_sb_info *sbi, unsigned int segno);
void f2fs_update_meta_page(struct f2fs_sb_info *sbi, void *src,
					block_t blk_addr);
void f2fs_do_write_meta_page(struct f2fs_sb_info *sbi, struct page *page,
						enum iostat_type io_type);
void f2fs_do_write_node_page(unsigned int nid, struct f2fs_io_info *fio);
void f2fs_outplace_write_data(struct dnode_of_data *dn,
			struct f2fs_io_info *fio);
int f2fs_inplace_write_data(struct f2fs_io_info *fio);
void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
			block_t old_blkaddr, block_t new_blkaddr,
			bool recover_curseg, bool recover_newaddr,
			bool from_gc);
void f2fs_replace_block(struct f2fs_sb_info *sbi, struct dnode_of_data *dn,
			block_t old_addr, block_t new_addr,
			unsigned char version, bool recover_curseg,
			bool recover_newaddr);
int f2fs_get_segment_temp(int seg_type);
int f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
			block_t old_blkaddr, block_t *new_blkaddr,
			struct f2fs_summary *sum, int type,
			struct f2fs_io_info *fio);
void f2fs_update_device_state(struct f2fs_sb_info *sbi, nid_t ino,
					block_t blkaddr, unsigned int blkcnt);
void f2fs_wait_on_page_writeback(struct page *page,
			enum page_type type, bool ordered, bool locked);
void f2fs_wait_on_block_writeback(struct inode *inode, block_t blkaddr);
void f2fs_wait_on_block_writeback_range(struct inode *inode, block_t blkaddr,
								block_t len);
void f2fs_write_data_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
void f2fs_write_node_summaries(struct f2fs_sb_info *sbi, block_t start_blk);
int f2fs_lookup_journal_in_cursum(struct f2fs_journal *journal, int type,
			unsigned int val, int alloc);
void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc);
int f2fs_fix_curseg_write_pointer(struct f2fs_sb_info *sbi);
int f2fs_check_write_pointer(struct f2fs_sb_info *sbi);
int f2fs_build_segment_manager(struct f2fs_sb_info *sbi);
void f2fs_destroy_segment_manager(struct f2fs_sb_info *sbi);
int __init f2fs_create_segment_manager_caches(void);
void f2fs_destroy_segment_manager_caches(void);
int f2fs_rw_hint_to_seg_type(struct f2fs_sb_info *sbi, enum rw_hint hint);
enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
			enum page_type type, enum temp_type temp);
unsigned int f2fs_usable_segs_in_sec(struct f2fs_sb_info *sbi,
			unsigned int segno);
unsigned int f2fs_usable_blks_in_seg(struct f2fs_sb_info *sbi,
			unsigned int segno);

#define DEF_FRAGMENT_SIZE
#define MIN_FRAGMENT_SIZE
#define MAX_FRAGMENT_SIZE

static inline bool f2fs_need_rand_seg(struct f2fs_sb_info *sbi)
{}

/*
 * checkpoint.c
 */
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
							unsigned char reason);
void f2fs_flush_ckpt_thread(struct f2fs_sb_info *sbi);
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
struct page *f2fs_get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index);
struct page *f2fs_get_meta_page_retry(struct f2fs_sb_info *sbi, pgoff_t index);
struct page *f2fs_get_tmp_page(struct f2fs_sb_info *sbi, pgoff_t index);
bool f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
					block_t blkaddr, int type);
bool f2fs_is_valid_blkaddr_raw(struct f2fs_sb_info *sbi,
					block_t blkaddr, int type);
int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
			int type, bool sync);
void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index,
							unsigned int ra_blocks);
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
			long nr_to_write, enum iostat_type io_type);
void f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
void f2fs_remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
void f2fs_release_ino_entry(struct f2fs_sb_info *sbi, bool all);
bool f2fs_exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode);
void f2fs_set_dirty_device(struct f2fs_sb_info *sbi, nid_t ino,
					unsigned int devidx, int type);
bool f2fs_is_dirty_device(struct f2fs_sb_info *sbi, nid_t ino,
					unsigned int devidx, int type);
int f2fs_acquire_orphan_inode(struct f2fs_sb_info *sbi);
void f2fs_release_orphan_inode(struct f2fs_sb_info *sbi);
void f2fs_add_orphan_inode(struct inode *inode);
void f2fs_remove_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino);
int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi);
int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi);
void f2fs_update_dirty_folio(struct inode *inode, struct folio *folio);
void f2fs_remove_dirty_inode(struct inode *inode);
int f2fs_sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type,
								bool from_cp);
void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type);
u64 f2fs_get_sectors_written(struct f2fs_sb_info *sbi);
int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc);
void f2fs_init_ino_entry_info(struct f2fs_sb_info *sbi);
int __init f2fs_create_checkpoint_caches(void);
void f2fs_destroy_checkpoint_caches(void);
int f2fs_issue_checkpoint(struct f2fs_sb_info *sbi);
int f2fs_start_ckpt_thread(struct f2fs_sb_info *sbi);
void f2fs_stop_ckpt_thread(struct f2fs_sb_info *sbi);
void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi);

/*
 * data.c
 */
int __init f2fs_init_bioset(void);
void f2fs_destroy_bioset(void);
bool f2fs_is_cp_guaranteed(struct page *page);
int f2fs_init_bio_entry_cache(void);
void f2fs_destroy_bio_entry_cache(void);
void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, struct bio *bio,
			  enum page_type type);
int f2fs_init_write_merge_io(struct f2fs_sb_info *sbi);
void f2fs_submit_merged_write(struct f2fs_sb_info *sbi, enum page_type type);
void f2fs_submit_merged_write_cond(struct f2fs_sb_info *sbi,
				struct inode *inode, struct page *page,
				nid_t ino, enum page_type type);
void f2fs_submit_merged_ipu_write(struct f2fs_sb_info *sbi,
					struct bio **bio, struct page *page);
void f2fs_flush_merged_writes(struct f2fs_sb_info *sbi);
int f2fs_submit_page_bio(struct f2fs_io_info *fio);
int f2fs_merge_page_bio(struct f2fs_io_info *fio);
void f2fs_submit_page_write(struct f2fs_io_info *fio);
struct block_device *f2fs_target_device(struct f2fs_sb_info *sbi,
		block_t blk_addr, sector_t *sector);
int f2fs_target_device_index(struct f2fs_sb_info *sbi, block_t blkaddr);
void f2fs_set_data_blkaddr(struct dnode_of_data *dn, block_t blkaddr);
void f2fs_update_data_blkaddr(struct dnode_of_data *dn, block_t blkaddr);
int f2fs_reserve_new_blocks(struct dnode_of_data *dn, blkcnt_t count);
int f2fs_reserve_new_block(struct dnode_of_data *dn);
int f2fs_get_block_locked(struct dnode_of_data *dn, pgoff_t index);
int f2fs_reserve_block(struct dnode_of_data *dn, pgoff_t index);
struct page *f2fs_get_read_data_page(struct inode *inode, pgoff_t index,
			blk_opf_t op_flags, bool for_write, pgoff_t *next_pgofs);
struct page *f2fs_find_data_page(struct inode *inode, pgoff_t index,
							pgoff_t *next_pgofs);
struct page *f2fs_get_lock_data_page(struct inode *inode, pgoff_t index,
			bool for_write);
struct page *f2fs_get_new_data_page(struct inode *inode,
			struct page *ipage, pgoff_t index, bool new_i_size);
int f2fs_do_write_data_page(struct f2fs_io_info *fio);
int f2fs_map_blocks(struct inode *inode, struct f2fs_map_blocks *map, int flag);
int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
			u64 start, u64 len);
int f2fs_encrypt_one_page(struct f2fs_io_info *fio);
bool f2fs_should_update_inplace(struct inode *inode, struct f2fs_io_info *fio);
bool f2fs_should_update_outplace(struct inode *inode, struct f2fs_io_info *fio);
int f2fs_write_single_data_page(struct page *page, int *submitted,
				struct bio **bio, sector_t *last_block,
				struct writeback_control *wbc,
				enum iostat_type io_type,
				int compr_blocks, bool allow_balance);
void f2fs_write_failed(struct inode *inode, loff_t to);
void f2fs_invalidate_folio(struct folio *folio, size_t offset, size_t length);
bool f2fs_release_folio(struct folio *folio, gfp_t wait);
bool f2fs_overwrite_io(struct inode *inode, loff_t pos, size_t len);
void f2fs_clear_page_cache_dirty_tag(struct page *page);
int f2fs_init_post_read_processing(void);
void f2fs_destroy_post_read_processing(void);
int f2fs_init_post_read_wq(struct f2fs_sb_info *sbi);
void f2fs_destroy_post_read_wq(struct f2fs_sb_info *sbi);
extern const struct iomap_ops f2fs_iomap_ops;

/*
 * gc.c
 */
int f2fs_start_gc_thread(struct f2fs_sb_info *sbi);
void f2fs_stop_gc_thread(struct f2fs_sb_info *sbi);
block_t f2fs_start_bidx_of_node(unsigned int node_ofs, struct inode *inode);
int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control);
void f2fs_build_gc_manager(struct f2fs_sb_info *sbi);
int f2fs_gc_range(struct f2fs_sb_info *sbi,
		unsigned int start_seg, unsigned int end_seg,
		bool dry_run, unsigned int dry_run_sections);
int f2fs_resize_fs(struct file *filp, __u64 block_count);
int __init f2fs_create_garbage_collection_cache(void);
void f2fs_destroy_garbage_collection_cache(void);
/* victim selection function for cleaning and SSR */
int f2fs_get_victim(struct f2fs_sb_info *sbi, unsigned int *result,
			int gc_type, int type, char alloc_mode,
			unsigned long long age);

/*
 * recovery.c
 */
int f2fs_recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only);
bool f2fs_space_for_roll_forward(struct f2fs_sb_info *sbi);
int __init f2fs_create_recovery_cache(void);
void f2fs_destroy_recovery_cache(void);

/*
 * debug.c
 */
#ifdef CONFIG_F2FS_STAT_FS
struct f2fs_stat_info {};

static inline struct f2fs_stat_info *F2FS_STAT(struct f2fs_sb_info *sbi)
{}

#define stat_inc_cp_call_count(sbi, foreground)
#define stat_inc_cp_count(si)
#define stat_io_skip_bggc_count(sbi)
#define stat_other_skip_bggc_count(sbi)
#define stat_inc_dirty_inode(sbi, type)
#define stat_dec_dirty_inode(sbi, type)
#define stat_inc_total_hit(sbi, type)
#define stat_inc_rbtree_node_hit(sbi, type)
#define stat_inc_largest_node_hit(sbi)
#define stat_inc_cached_node_hit(sbi, type)
#define stat_inc_inline_xattr(inode)
#define stat_dec_inline_xattr(inode)
#define stat_inc_inline_inode(inode)
#define stat_dec_inline_inode(inode)
#define stat_inc_inline_dir(inode)
#define stat_dec_inline_dir(inode)
#define stat_inc_compr_inode(inode)
#define stat_dec_compr_inode(inode)
#define stat_add_compr_blocks(inode, blocks)
#define stat_sub_compr_blocks(inode, blocks)
#define stat_inc_swapfile_inode(inode)
#define stat_dec_swapfile_inode(inode)
#define stat_inc_atomic_inode(inode)
#define stat_dec_atomic_inode(inode)
#define stat_inc_meta_count(sbi, blkaddr)
#define stat_inc_seg_type(sbi, curseg)
#define stat_inc_block_count(sbi, curseg)
#define stat_inc_inplace_blocks(sbi)
#define stat_update_max_atomic_write(inode)
#define stat_inc_gc_call_count(sbi, foreground)
#define stat_inc_gc_sec_count(sbi, type, gc_type)
#define stat_inc_gc_seg_count(sbi, type, gc_type)

#define stat_inc_tot_blk_count(si, blks)

#define stat_inc_data_blk_count(sbi, blks, gc_type)

#define stat_inc_node_blk_count(sbi, blks, gc_type)

int f2fs_build_stats(struct f2fs_sb_info *sbi);
void f2fs_destroy_stats(struct f2fs_sb_info *sbi);
void __init f2fs_create_root_stats(void);
void f2fs_destroy_root_stats(void);
void f2fs_update_sit_info(struct f2fs_sb_info *sbi);
#else
#define stat_inc_cp_call_count
#define stat_inc_cp_count
#define stat_io_skip_bggc_count
#define stat_other_skip_bggc_count
#define stat_inc_dirty_inode
#define stat_dec_dirty_inode
#define stat_inc_total_hit
#define stat_inc_rbtree_node_hit
#define stat_inc_largest_node_hit
#define stat_inc_cached_node_hit
#define stat_inc_inline_xattr
#define stat_dec_inline_xattr
#define stat_inc_inline_inode
#define stat_dec_inline_inode
#define stat_inc_inline_dir
#define stat_dec_inline_dir
#define stat_inc_compr_inode
#define stat_dec_compr_inode
#define stat_add_compr_blocks
#define stat_sub_compr_blocks
#define stat_inc_swapfile_inode
#define stat_dec_swapfile_inode
#define stat_inc_atomic_inode
#define stat_dec_atomic_inode
#define stat_update_max_atomic_write
#define stat_inc_meta_count
#define stat_inc_seg_type
#define stat_inc_block_count
#define stat_inc_inplace_blocks
#define stat_inc_gc_call_count
#define stat_inc_gc_sec_count
#define stat_inc_gc_seg_count
#define stat_inc_tot_blk_count
#define stat_inc_data_blk_count
#define stat_inc_node_blk_count

static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { }
static inline void __init f2fs_create_root_stats(void) { }
static inline void f2fs_destroy_root_stats(void) { }
static inline void f2fs_update_sit_info(struct f2fs_sb_info *sbi) {}
#endif

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 page *ipage);
bool f2fs_may_inline_dentry(struct inode *inode);
void f2fs_do_read_inline_data(struct folio *folio, struct page *ipage);
void f2fs_truncate_inline_inode(struct inode *inode,
						struct page *ipage, u64 from);
int f2fs_read_inline_data(struct inode *inode, struct folio *folio);
int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page);
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 page *page);
int f2fs_recover_inline_data(struct inode *inode, struct page *npage);
struct f2fs_dir_entry *f2fs_find_in_inline_dir(struct inode *dir,
					const struct f2fs_filename *fname,
					struct page **res_page);
int f2fs_make_empty_inline_dir(struct inode *inode, struct inode *parent,
			struct page *ipage);
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 page *page, 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);
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 page *ipage);
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 page *ipage);
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);

/*
 * sysfs.c
 */
#define MIN_RA_MUL
#define MAX_RA_MUL

int __init f2fs_init_sysfs(void);
void f2fs_exit_sysfs(void);
int f2fs_register_sysfs(struct f2fs_sb_info *sbi);
void f2fs_unregister_sysfs(struct f2fs_sb_info *sbi);

/* verity.c */
extern const struct fsverity_operations f2fs_verityops;

/*
 * crypto support
 */
static inline bool f2fs_encrypted_file(struct inode *inode)
{}

static inline void f2fs_set_encrypted_inode(struct inode *inode)
{}

/*
 * Returns true if the reads of the inode's data need to undergo some
 * postprocessing step, like decryption or authenticity verification.
 */
static inline bool f2fs_post_read_required(struct inode *inode)
{}

static inline bool f2fs_used_in_atomic_write(struct inode *inode)
{}

static inline bool f2fs_meta_inode_gc_required(struct inode *inode)
{}

/*
 * compress.c
 */
#ifdef CONFIG_F2FS_FS_COMPRESSION
bool f2fs_is_compressed_page(struct page *page);
struct page *f2fs_compress_control_page(struct page *page);
int f2fs_prepare_compress_overwrite(struct inode *inode,
			struct page **pagep, pgoff_t index, void **fsdata);
bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
					pgoff_t index, unsigned copied);
int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock);
void f2fs_compress_write_end_io(struct bio *bio, struct page *page);
bool f2fs_is_compress_backend_ready(struct inode *inode);
bool f2fs_is_compress_level_valid(int alg, int lvl);
int __init f2fs_init_compress_mempool(void);
void f2fs_destroy_compress_mempool(void);
void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task);
void f2fs_end_read_compressed_page(struct page *page, bool failed,
				block_t blkaddr, bool in_task);
bool f2fs_cluster_is_empty(struct compress_ctx *cc);
bool f2fs_cluster_can_merge_page(struct compress_ctx *cc, pgoff_t index);
bool f2fs_all_cluster_page_ready(struct compress_ctx *cc, struct page **pages,
				int index, int nr_pages, bool uptodate);
bool f2fs_sanity_check_cluster(struct dnode_of_data *dn);
void f2fs_compress_ctx_add_page(struct compress_ctx *cc, struct page *page);
int f2fs_write_multi_pages(struct compress_ctx *cc,
						int *submitted,
						struct writeback_control *wbc,
						enum iostat_type io_type);
int f2fs_is_compressed_cluster(struct inode *inode, pgoff_t index);
void f2fs_update_read_extent_tree_range_compressed(struct inode *inode,
				pgoff_t fofs, block_t blkaddr,
				unsigned int llen, unsigned int c_len);
int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
				unsigned nr_pages, sector_t *last_block_in_bio,
				struct readahead_control *rac, bool for_write);
struct decompress_io_ctx *f2fs_alloc_dic(struct compress_ctx *cc);
void f2fs_decompress_end_io(struct decompress_io_ctx *dic, bool failed,
				bool in_task);
void f2fs_put_page_dic(struct page *page, bool in_task);
unsigned int f2fs_cluster_blocks_are_contiguous(struct dnode_of_data *dn,
						unsigned int ofs_in_node);
int f2fs_init_compress_ctx(struct compress_ctx *cc);
void f2fs_destroy_compress_ctx(struct compress_ctx *cc, bool reuse);
void f2fs_init_compress_info(struct f2fs_sb_info *sbi);
int f2fs_init_compress_inode(struct f2fs_sb_info *sbi);
void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi);
int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi);
void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi);
int __init f2fs_init_compress_cache(void);
void f2fs_destroy_compress_cache(void);
struct address_space *COMPRESS_MAPPING(struct f2fs_sb_info *sbi);
void f2fs_invalidate_compress_page(struct f2fs_sb_info *sbi, block_t blkaddr);
void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi, struct page *page,
						nid_t ino, block_t blkaddr);
bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi, struct page *page,
								block_t blkaddr);
void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi, nid_t ino);
#define inc_compr_inode_stat(inode)
#define add_compr_block_stat(inode, blocks)
#else
static inline bool f2fs_is_compressed_page(struct page *page) { return false; }
static inline bool f2fs_is_compress_backend_ready(struct inode *inode)
{
	if (!f2fs_compressed_file(inode))
		return true;
	/* not support compression */
	return false;
}
static inline bool f2fs_is_compress_level_valid(int alg, int lvl) { return false; }
static inline struct page *f2fs_compress_control_page(struct page *page)
{
	WARN_ON_ONCE(1);
	return ERR_PTR(-EINVAL);
}
static inline int __init f2fs_init_compress_mempool(void) { return 0; }
static inline void f2fs_destroy_compress_mempool(void) { }
static inline void f2fs_decompress_cluster(struct decompress_io_ctx *dic,
				bool in_task) { }
static inline void f2fs_end_read_compressed_page(struct page *page,
				bool failed, block_t blkaddr, bool in_task)
{
	WARN_ON_ONCE(1);
}
static inline void f2fs_put_page_dic(struct page *page, bool in_task)
{
	WARN_ON_ONCE(1);
}
static inline unsigned int f2fs_cluster_blocks_are_contiguous(
			struct dnode_of_data *dn, unsigned int ofs_in_node) { return 0; }
static inline bool f2fs_sanity_check_cluster(struct dnode_of_data *dn) { return false; }
static inline int f2fs_init_compress_inode(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_compress_inode(struct f2fs_sb_info *sbi) { }
static inline int f2fs_init_page_array_cache(struct f2fs_sb_info *sbi) { return 0; }
static inline void f2fs_destroy_page_array_cache(struct f2fs_sb_info *sbi) { }
static inline int __init f2fs_init_compress_cache(void) { return 0; }
static inline void f2fs_destroy_compress_cache(void) { }
static inline void f2fs_invalidate_compress_page(struct f2fs_sb_info *sbi,
				block_t blkaddr) { }
static inline void f2fs_cache_compressed_page(struct f2fs_sb_info *sbi,
				struct page *page, nid_t ino, block_t blkaddr) { }
static inline bool f2fs_load_compressed_page(struct f2fs_sb_info *sbi,
				struct page *page, block_t blkaddr) { return false; }
static inline void f2fs_invalidate_compress_pages(struct f2fs_sb_info *sbi,
							nid_t ino) { }
#define inc_compr_inode_stat
static inline void f2fs_update_read_extent_tree_range_compressed(
				struct inode *inode,
				pgoff_t fofs, block_t blkaddr,
				unsigned int llen, unsigned int c_len) { }
#endif

static inline int set_compress_context(struct inode *inode)
{}

static inline bool f2fs_disable_compressed_file(struct inode *inode)
{}

#define F2FS_FEATURE_FUNCS(name, flagname)

F2FS_FEATURE_FUNCS(encrypt, ENCRYPT);
F2FS_FEATURE_FUNCS(blkzoned, BLKZONED);
F2FS_FEATURE_FUNCS(extra_attr, EXTRA_ATTR);
F2FS_FEATURE_FUNCS(project_quota, PRJQUOTA);
F2FS_FEATURE_FUNCS(inode_chksum, INODE_CHKSUM);
F2FS_FEATURE_FUNCS(flexible_inline_xattr, FLEXIBLE_INLINE_XATTR);
F2FS_FEATURE_FUNCS(quota_ino, QUOTA_INO);
F2FS_FEATURE_FUNCS(inode_crtime, INODE_CRTIME);
F2FS_FEATURE_FUNCS(lost_found, LOST_FOUND);
F2FS_FEATURE_FUNCS(verity, VERITY);
F2FS_FEATURE_FUNCS(sb_chksum, SB_CHKSUM);
F2FS_FEATURE_FUNCS(casefold, CASEFOLD);
F2FS_FEATURE_FUNCS(compression, COMPRESSION);
F2FS_FEATURE_FUNCS(readonly, RO);

#ifdef CONFIG_BLK_DEV_ZONED
static inline bool f2fs_blkz_is_seq(struct f2fs_sb_info *sbi, int devi,
				    block_t blkaddr)
{}
#endif

static inline int f2fs_bdev_index(struct f2fs_sb_info *sbi,
				  struct block_device *bdev)
{}

static inline bool f2fs_hw_should_discard(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_bdev_support_discard(struct block_device *bdev)
{}

static inline bool f2fs_hw_support_discard(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_realtime_discard_enable(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_hw_is_readonly(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_dev_is_readonly(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_lfs_mode(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_valid_pinned_area(struct f2fs_sb_info *sbi,
					  block_t blkaddr)
{}

static inline bool f2fs_low_mem_mode(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_may_compress(struct inode *inode)
{}

static inline void f2fs_i_compr_blocks_update(struct inode *inode,
						u64 blocks, bool add)
{}

static inline bool f2fs_allow_multi_device_dio(struct f2fs_sb_info *sbi,
								int flag)
{}

static inline bool f2fs_need_verity(const struct inode *inode, pgoff_t idx)
{}

#ifdef CONFIG_F2FS_FAULT_INJECTION
extern int f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned long rate,
							unsigned long type);
#else
static inline int f2fs_build_fault_attr(struct f2fs_sb_info *sbi,
					unsigned long rate, unsigned long type)
{
	return 0;
}
#endif

static inline bool is_journalled_quota(struct f2fs_sb_info *sbi)
{}

static inline bool f2fs_block_unit_discard(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_io_schedule_timeout(long timeout)
{}

static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs,
					enum page_type type)
{}

static inline bool f2fs_is_readonly(struct f2fs_sb_info *sbi)
{}

static inline void f2fs_truncate_meta_inode_pages(struct f2fs_sb_info *sbi,
					block_t blkaddr, unsigned int cnt)
{}

static inline void f2fs_invalidate_internal_cache(struct f2fs_sb_info *sbi,
								block_t blkaddr)
{}

#define EFSBADCRC
#define EFSCORRUPTED

#endif /* _LINUX_F2FS_H */