linux/fs/f2fs/checkpoint.c

// SPDX-License-Identifier: GPL-2.0
/*
 * fs/f2fs/checkpoint.c
 *
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *             http://www.samsung.com/
 */
#include <linux/fs.h>
#include <linux/bio.h>
#include <linux/mpage.h>
#include <linux/writeback.h>
#include <linux/blkdev.h>
#include <linux/f2fs_fs.h>
#include <linux/pagevec.h>
#include <linux/swap.h>
#include <linux/kthread.h>

#include "f2fs.h"
#include "node.h"
#include "segment.h"
#include "iostat.h"
#include <trace/events/f2fs.h>

#define DEFAULT_CHECKPOINT_IOPRIO

static struct kmem_cache *ino_entry_slab;
struct kmem_cache *f2fs_inode_entry_slab;

void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
						unsigned char reason)
{}

/*
 * We guarantee no failure on the returned page.
 */
struct page *f2fs_grab_meta_page(struct f2fs_sb_info *sbi, pgoff_t index)
{}

static struct page *__get_meta_page(struct f2fs_sb_info *sbi, pgoff_t index,
							bool is_meta)
{}

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)
{}

/* for POR only */
struct page *f2fs_get_tmp_page(struct f2fs_sb_info *sbi, pgoff_t index)
{}

static bool __is_bitmap_valid(struct f2fs_sb_info *sbi, block_t blkaddr,
							int type)
{}

static bool __f2fs_is_valid_blkaddr(struct f2fs_sb_info *sbi,
					block_t blkaddr, int type)
{}

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)
{}

/*
 * Readahead CP/NAT/SIT/SSA/POR pages
 */
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)
{}

static int __f2fs_write_meta_page(struct page *page,
				struct writeback_control *wbc,
				enum iostat_type io_type)
{}

static int f2fs_write_meta_page(struct page *page,
				struct writeback_control *wbc)
{}

static int f2fs_write_meta_pages(struct address_space *mapping,
				struct writeback_control *wbc)
{}

long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
				long nr_to_write, enum iostat_type io_type)
{}

static bool f2fs_dirty_meta_folio(struct address_space *mapping,
		struct folio *folio)
{}

const struct address_space_operations f2fs_meta_aops =;

static void __add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino,
						unsigned int devidx, int type)
{}

static void __remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int 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)
{}

/* mode should be APPEND_INO, UPDATE_INO or TRANS_DIR_INO */
bool f2fs_exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode)
{}

void f2fs_release_ino_entry(struct f2fs_sb_info *sbi, bool all)
{}

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)
{}

static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
{}

int f2fs_recover_orphan_inodes(struct f2fs_sb_info *sbi)
{}

static void write_orphan_inodes(struct f2fs_sb_info *sbi, block_t start_blk)
{}

static __u32 f2fs_checkpoint_chksum(struct f2fs_sb_info *sbi,
						struct f2fs_checkpoint *ckpt)
{}

static int get_checkpoint_version(struct f2fs_sb_info *sbi, block_t cp_addr,
		struct f2fs_checkpoint **cp_block, struct page **cp_page,
		unsigned long long *version)
{}

static struct page *validate_checkpoint(struct f2fs_sb_info *sbi,
				block_t cp_addr, unsigned long long *version)
{}

int f2fs_get_valid_checkpoint(struct f2fs_sb_info *sbi)
{}

static void __add_dirty_inode(struct inode *inode, enum inode_type type)
{}

static void __remove_dirty_inode(struct inode *inode, enum inode_type type)
{}

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)
{}

static int f2fs_sync_inode_meta(struct f2fs_sb_info *sbi)
{}

static void __prepare_cp_block(struct f2fs_sb_info *sbi)
{}

static bool __need_flush_quota(struct f2fs_sb_info *sbi)
{}

/*
 * Freeze all the FS-operations for checkpoint.
 */
static int block_operations(struct f2fs_sb_info *sbi)
{}

static void unblock_operations(struct f2fs_sb_info *sbi)
{}

void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type)
{}

static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)
{}

static void commit_checkpoint(struct f2fs_sb_info *sbi,
	void *src, block_t blk_addr)
{}

static inline u64 get_sectors_written(struct block_device *bdev)
{}

u64 f2fs_get_sectors_written(struct f2fs_sb_info *sbi)
{}

static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
{}

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)
{}

static int __write_checkpoint_sync(struct f2fs_sb_info *sbi)
{}

static void __checkpoint_and_complete_reqs(struct f2fs_sb_info *sbi)
{}

static int issue_checkpoint_thread(void *data)
{}

static void flush_remained_ckpt_reqs(struct f2fs_sb_info *sbi,
		struct ckpt_req *wait_req)
{}

static void init_ckpt_req(struct ckpt_req *req)
{}

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_flush_ckpt_thread(struct f2fs_sb_info *sbi)
{}

void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi)
{}