linux/fs/f2fs/node.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * fs/f2fs/node.h
 *
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *             http://www.samsung.com/
 */
/* start node id of a node block dedicated to the given node id */
#define START_NID(nid)

/* node block offset on the NAT area dedicated to the given start node id */
#define NAT_BLOCK_OFFSET(start_nid)

/* # of pages to perform synchronous readahead before building free nids */
#define FREE_NID_PAGES
#define MAX_FREE_NIDS

/* size of free nid batch when shrinking */
#define SHRINK_NID_BATCH_SIZE

#define DEF_RA_NID_PAGES

/* maximum readahead size for node during getting data blocks */
#define MAX_RA_NODE

/* control the memory footprint threshold (10MB per 1GB ram) */
#define DEF_RAM_THRESHOLD

/* control dirty nats ratio threshold (default: 10% over max nid count) */
#define DEF_DIRTY_NAT_RATIO_THRESHOLD
/* control total # of nats */
#define DEF_NAT_CACHE_THRESHOLD

/* control total # of node writes used for roll-fowrad recovery */
#define DEF_RF_NODE_BLOCKS

/* vector size for gang look-up from nat cache that consists of radix tree */
#define NAT_VEC_SIZE

/* return value for read_node_page */
#define LOCKED_PAGE

/* check pinned file's alignment status of physical blocks */
#define FILE_NOT_ALIGNED

/* For flag in struct node_info */
enum {};

/*
 * For node information
 */
struct node_info {};

struct nat_entry {};

#define nat_get_nid(nat)
#define nat_set_nid(nat, n)
#define nat_get_blkaddr(nat)
#define nat_set_blkaddr(nat, b)
#define nat_get_ino(nat)
#define nat_set_ino(nat, i)
#define nat_get_version(nat)
#define nat_set_version(nat, v)

#define inc_node_version(version)

static inline void copy_node_info(struct node_info *dst,
						struct node_info *src)
{}

static inline void set_nat_flag(struct nat_entry *ne,
				unsigned int type, bool set)
{}

static inline bool get_nat_flag(struct nat_entry *ne, unsigned int type)
{}

static inline void nat_reset_flag(struct nat_entry *ne)
{}

static inline void node_info_from_raw_nat(struct node_info *ni,
						struct f2fs_nat_entry *raw_ne)
{}

static inline void raw_nat_from_node_info(struct f2fs_nat_entry *raw_ne,
						struct node_info *ni)
{}

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

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

enum mem_type {};

struct nat_entry_set {};

struct free_nid {};

static inline void next_free_nid(struct f2fs_sb_info *sbi, nid_t *nid)
{}

/*
 * inline functions
 */
static inline void get_nat_bitmap(struct f2fs_sb_info *sbi, void *addr)
{}

static inline pgoff_t current_nat_addr(struct f2fs_sb_info *sbi, nid_t start)
{}

static inline pgoff_t next_nat_addr(struct f2fs_sb_info *sbi,
						pgoff_t block_addr)
{}

static inline void set_to_next_nat(struct f2fs_nm_info *nm_i, nid_t start_nid)
{}

static inline nid_t ino_of_node(struct page *node_page)
{}

static inline nid_t nid_of_node(struct page *node_page)
{}

static inline unsigned int ofs_of_node(struct page *node_page)
{}

static inline __u64 cpver_of_node(struct page *node_page)
{}

static inline block_t next_blkaddr_of_node(struct page *node_page)
{}

static inline void fill_node_footer(struct page *page, nid_t nid,
				nid_t ino, unsigned int ofs, bool reset)
{}

static inline void copy_node_footer(struct page *dst, struct page *src)
{}

static inline void fill_node_footer_blkaddr(struct page *page, block_t blkaddr)
{}

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

/*
 * f2fs assigns the following node offsets described as (num).
 * N = NIDS_PER_BLOCK
 *
 *  Inode block (0)
 *    |- direct node (1)
 *    |- direct node (2)
 *    |- indirect node (3)
 *    |            `- direct node (4 => 4 + N - 1)
 *    |- indirect node (4 + N)
 *    |            `- direct node (5 + N => 5 + 2N - 1)
 *    `- double indirect node (5 + 2N)
 *                 `- indirect node (6 + 2N)
 *                       `- direct node
 *                 ......
 *                 `- indirect node ((6 + 2N) + x(N + 1))
 *                       `- direct node
 *                 ......
 *                 `- indirect node ((6 + 2N) + (N - 1)(N + 1))
 *                       `- direct node
 */
static inline bool IS_DNODE(struct page *node_page)
{}

static inline int set_nid(struct page *p, int off, nid_t nid, bool i)
{}

static inline nid_t get_nid(struct page *p, int off, bool i)
{}

/*
 * Coldness identification:
 *  - Mark cold files in f2fs_inode_info
 *  - Mark cold node blocks in their node footer
 *  - Mark cold data pages in page cache
 */

static inline int is_node(struct page *page, int type)
{}

#define is_cold_node(page)
#define is_fsync_dnode(page)
#define is_dent_dnode(page)

static inline void set_cold_node(struct page *page, bool is_dir)
{}

static inline void set_mark(struct page *page, int mark, int type)
{}
#define set_dentry_mark(page, mark)
#define set_fsync_mark(page, mark)