Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fb3f3b2 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

f2fs: updates on 4.15-rc1



Pull f2fs updates from Jaegeuk Kim:
"In this round, we introduce sysfile-based quota support which is
required for Android by default. In addition, we allow that users are
able to reserve some blocks in runtime to mitigate performance drops
in low free space.

Enhancements:
 - assign proper data segments according to write_hints given by user
 - issue cache_flush on dirty devices only among multiple devices
 - exploit cp_error flag and add more faults to enhance fault
   injection test
 - conduct more readaheads during f2fs_readdir
 - add a range for discard commands

Bug fixes:
 - fix zero stat->st_blocks when inline_data is set
 - drop crypto key and free stale memory pointer while evict_inode is
   failing
 - fix some corner cases in free space and segment management
 - fix wrong last_disk_size

This series includes lots of clean-ups and code enhancement in terms
of xattr operations, discard/flush command control. In addition, it
adds versatile debugfs entries to monitor f2fs status"

Cherry-picked from origin/upstream-f2fs-stable-linux-4.14.y:

7b538c1c f2fs: deny accessing encryption policy if encryption is off
c43ffa18 f2fs: inject fault in inc_valid_node_count
fa73e874 f2fs: expose quota information in debugfs
eb538327 f2fs: separate nat entry mem alloc from nat_tree_lock
a7c6829c f2fs: validate before set/clear free nat bitmap
eb84a567 f2fs: avoid opened loop codes in __add_ino_entry
793cdb93 f2fs: apply write hints to select the type of segments for buffered write
75a69567 f2fs: introduce scan_curseg_cache for cleanup
6180b68c f2fs: optimize the way of traversing free_nid_bitmap
221656e4 f2fs: keep scanning until enough free nids are acquired
0b0a1e72 f2fs: trace checkpoint reason in fsync()
af75a621 f2fs: keep isize once block is reserved cross EOF
3b96799d f2fs: avoid race in between GC and block exchange
c33a70d7 f2fs: save a multiplication for last_nid calculation
4c8fdcd5 f2fs: fix summary info corruption
ff95a94d f2fs: remove dead code in update_meta_page
c7f08b50 f2fs: remove unneeded semicolon
91d56034 f2fs: don't bother with inode->i_version
270e78cf f2fs: check curseg space before foreground GC
d3ad907d f2fs: use rw_semaphore to protect SIT cache
d9e1a6b6 f2fs: support quota sys files
3aec74eb f2fs: add quota_ino feature infra
cf943558 f2fs: optimize __update_nat_bits
e56a876f f2fs: modify for accurate fggc node io stat
a39d96b9 Revert "f2fs: handle dirty segments inside refresh_sit_entry"
0ccccb38 f2fs: add a function to move nid
cd3b86fc f2fs: export SSR allocation threshold
ca50229b f2fs: give correct trimmed blocks in fstrim
73b8db88 f2fs: support bio allocation error injection
b8a938e4 f2fs: support get_page error injection
f2b91f22 f2fs: add missing sysfs description
6cef5570 f2fs: support soft block reservation
cef5e716 f2fs: handle error case when adding xattr entry
a7848c0d f2fs: support flexible inline xattr size
c6314306 f2fs: show current cp state
032d1409 f2fs: add missing quota_initialize
f241f66c f2fs: show # of dirty segments via sysfs
1687d9f0 f2fs: stop all the operations by cp_error flag
f793a2c2 f2fs: remove several redundant assignments
fb000836 f2fs: avoid using timespec
a4b9ed20 f2fs: fix to correct no_fggc_candidate
bc69d560 Revert "f2fs: return wrong error number on f2fs_quota_write"
f49f4124 f2fs: remove obsolete pointer for truncate_xattr_node
c6bfa17c f2fs: retry ENOMEM for quota_read|write
5e14327f f2fs: limit # of inmemory pages
a064458a f2fs: update ctx->pos correctly when hitting hole in directory
372b93f9 f2fs: relocate readahead codes in readdir()
457e9c03 f2fs: allow readdir() to be interrupted
2d1af27c f2fs: trace f2fs_readdir
7bbdc74b f2fs: trace f2fs_lookup
76e8f606 f2fs: skip searching non-exist range in truncate_hole
2f18884d f2fs: avoid stale fi->gdirty_list pointer
0dbf4fd4 f2fs/crypto: drop crypto key at evict_inode only
8c582763 f2fs: fix to avoid race when accessing last_disk_size
c2e2eec6 f2fs: Fix bool initialization/comparison
ab0a7977 f2fs: give up CP_TRIMMED_FLAG if it drops discards
001cc0b0 f2fs: trace f2fs_remove_discard
c72699d2 f2fs: reduce cmd_lock coverage in __issue_discard_cmd
0eeceeb2 f2fs: split discard policy
775d0e58 f2fs: wrap discard policy
77b5bf3a f2fs: support issuing/waiting discard in range
6b50d3ec f2fs: fix to flush multiple device in checkpoint
5483b178 f2fs: enhance multiple device flush
06800576 f2fs: fix to show ino management cache size correctly
a815ce99 f2fs: drop FI_UPDATE_WRITE tag after f2fs_issue_flush
3257c657 f2fs: obsolete ALLOC_NID_LIST list
d54bf9da f2fs: convert inline data for direct I/O & FI_NO_PREALLOC
32c57300 f2fs: allow readpages with NULL file pointer
dba2b454 f2fs: show flush list status in sysfs
fae7dc47 f2fs: introduce read_xattr_block
148edd02 f2fs: introduce read_inline_xattr
b735df5e Revert "f2fs: reuse nids more aggressively"
13e34cba Revert "f2fs: node segment is prior to data segment selected victim"
a76d81af f2fs: fix to clear FI_NO_PREALLOC

Bug: 70801385
Change-Id: I3b8e0c21f4f8d52b669776fce41df77a4363d473
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@google.com>
parent cc43e740
Loading
Loading
Loading
Loading
+36 −1
Original line number Diff line number Diff line
@@ -51,6 +51,18 @@ Description:
		 Controls the dirty page count condition for the in-place-update
		 policies.

What:		/sys/fs/f2fs/<disk>/min_hot_blocks
Date:		March 2017
Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
Description:
		 Controls the dirty page count condition for redefining hot data.

What:		/sys/fs/f2fs/<disk>/min_ssr_sections
Date:		October 2017
Contact:	"Chao Yu" <yuchao0@huawei.com>
Description:
		 Controls the fee section threshold to trigger SSR allocation.

What:		/sys/fs/f2fs/<disk>/max_small_discards
Date:		November 2013
Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
@@ -102,6 +114,12 @@ Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
Description:
		 Controls the idle timing.

What:		/sys/fs/f2fs/<disk>/iostat_enable
Date:		August 2017
Contact:	"Chao Yu" <yuchao0@huawei.com>
Description:
		 Controls to enable/disable IO stat.

What:		/sys/fs/f2fs/<disk>/ra_nid_pages
Date:		October 2015
Contact:	"Chao Yu" <chao2.yu@samsung.com>
@@ -122,6 +140,12 @@ Contact: "Shuoran Liu" <liushuoran@huawei.com>
Description:
		 Shows total written kbytes issued to disk.

What:		/sys/fs/f2fs/<disk>/feature
Date:		July 2017
Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
Description:
		 Shows all enabled features in current device.

What:		/sys/fs/f2fs/<disk>/inject_rate
Date:		May 2016
Contact:	"Sheng Yong" <shengyong1@huawei.com>
@@ -138,7 +162,18 @@ What: /sys/fs/f2fs/<disk>/reserved_blocks
Date:		June 2017
Contact:	"Chao Yu" <yuchao0@huawei.com>
Description:
		 Controls current reserved blocks in system.
		 Controls target reserved blocks in system, the threshold
		 is soft, it could exceed current available user space.

What:		/sys/fs/f2fs/<disk>/current_reserved_blocks
Date:		October 2017
Contact:	"Yunlong Song" <yunlong.song@huawei.com>
Contact:	"Chao Yu" <yuchao0@huawei.com>
Description:
		 Shows current reserved blocks in system, it may be temporarily
		 smaller than target_reserved_blocks, but will gradually
		 increase to target_reserved_blocks when more free blocks are
		 freed by user later.

What:		/sys/fs/f2fs/<disk>/gc_urgent
Date:		August 2017
+3 −0
Original line number Diff line number Diff line
@@ -250,6 +250,9 @@ static int __f2fs_set_acl(struct inode *inode, int type,

int f2fs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
{
	if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
		return -EIO;

	return __f2fs_set_acl(inode, type, acl, NULL);
}

+49 −15
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ struct kmem_cache *inode_entry_slab;
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
{
	set_ckpt_flags(sbi, CP_ERROR_FLAG);
	sbi->sb->s_flags |= MS_RDONLY;
	if (!end_io)
		f2fs_flush_merged_writes(sbi);
}
@@ -401,24 +400,23 @@ const struct address_space_operations f2fs_meta_aops = {
#endif
};

static void __add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
static void __add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino,
						unsigned int devidx, int type)
{
	struct inode_management *im = &sbi->im[type];
	struct ino_entry *e, *tmp;

	tmp = f2fs_kmem_cache_alloc(ino_entry_slab, GFP_NOFS);
retry:

	radix_tree_preload(GFP_NOFS | __GFP_NOFAIL);

	spin_lock(&im->ino_lock);
	e = radix_tree_lookup(&im->ino_root, ino);
	if (!e) {
		e = tmp;
		if (radix_tree_insert(&im->ino_root, ino, e)) {
			spin_unlock(&im->ino_lock);
			radix_tree_preload_end();
			goto retry;
		}
		if (unlikely(radix_tree_insert(&im->ino_root, ino, e)))
			f2fs_bug_on(sbi, 1);

		memset(e, 0, sizeof(struct ino_entry));
		e->ino = ino;

@@ -426,6 +424,10 @@ static void __add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
		if (type != ORPHAN_INO)
			im->ino_num++;
	}

	if (type == FLUSH_INO)
		f2fs_set_bit(devidx, (char *)&e->dirty_device);

	spin_unlock(&im->ino_lock);
	radix_tree_preload_end();

@@ -454,7 +456,7 @@ static void __remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
void add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
{
	/* add new dirty ino entry into list */
	__add_ino_entry(sbi, ino, type);
	__add_ino_entry(sbi, ino, 0, type);
}

void remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
@@ -480,7 +482,7 @@ void release_ino_entry(struct f2fs_sb_info *sbi, bool all)
	struct ino_entry *e, *tmp;
	int i;

	for (i = all ? ORPHAN_INO: APPEND_INO; i <= UPDATE_INO; i++) {
	for (i = all ? ORPHAN_INO : APPEND_INO; i < MAX_INO_ENTRY; i++) {
		struct inode_management *im = &sbi->im[i];

		spin_lock(&im->ino_lock);
@@ -494,6 +496,27 @@ void release_ino_entry(struct f2fs_sb_info *sbi, bool all)
	}
}

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

bool is_dirty_device(struct f2fs_sb_info *sbi, nid_t ino,
					unsigned int devidx, int type)
{
	struct inode_management *im = &sbi->im[type];
	struct ino_entry *e;
	bool is_dirty = false;

	spin_lock(&im->ino_lock);
	e = radix_tree_lookup(&im->ino_root, ino);
	if (e && f2fs_test_bit(devidx, (char *)&e->dirty_device))
		is_dirty = true;
	spin_unlock(&im->ino_lock);
	return is_dirty;
}

int acquire_orphan_inode(struct f2fs_sb_info *sbi)
{
	struct inode_management *im = &sbi->im[ORPHAN_INO];
@@ -530,7 +553,7 @@ void release_orphan_inode(struct f2fs_sb_info *sbi)
void add_orphan_inode(struct inode *inode)
{
	/* add new orphan ino entry into list */
	__add_ino_entry(F2FS_I_SB(inode), inode->i_ino, ORPHAN_INO);
	__add_ino_entry(F2FS_I_SB(inode), inode->i_ino, 0, ORPHAN_INO);
	update_inode_page(inode);
}

@@ -554,7 +577,7 @@ static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
		return err;
	}

	__add_ino_entry(sbi, ino, ORPHAN_INO);
	__add_ino_entry(sbi, ino, 0, ORPHAN_INO);

	inode = f2fs_iget_retry(sbi->sb, ino);
	if (IS_ERR(inode)) {
@@ -590,6 +613,9 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi)
	block_t start_blk, orphan_blocks, i, j;
	unsigned int s_flags = sbi->sb->s_flags;
	int err = 0;
#ifdef CONFIG_QUOTA
	int quota_enabled;
#endif

	if (!is_set_ckpt_flags(sbi, CP_ORPHAN_PRESENT_FLAG))
		return 0;
@@ -602,8 +628,9 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi)
#ifdef CONFIG_QUOTA
	/* Needed for iput() to work correctly and not trash data */
	sbi->sb->s_flags |= MS_ACTIVE;

	/* Turn on quotas so that they are updated correctly */
	f2fs_enable_quota_files(sbi);
	quota_enabled = f2fs_enable_quota_files(sbi, s_flags & MS_RDONLY);
#endif

	start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi);
@@ -631,6 +658,7 @@ int recover_orphan_inodes(struct f2fs_sb_info *sbi)
out:
#ifdef CONFIG_QUOTA
	/* Turn quotas off */
	if (quota_enabled)
		f2fs_quota_off_umount(sbi->sb);
#endif
	sbi->sb->s_flags = s_flags; /* Restore MS_RDONLY status */
@@ -986,7 +1014,7 @@ int f2fs_sync_inode_meta(struct f2fs_sb_info *sbi)
				update_inode_page(inode);
			iput(inode);
		}
	};
	}
	return 0;
}

@@ -1146,6 +1174,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
	struct super_block *sb = sbi->sb;
	struct curseg_info *seg_i = CURSEG_I(sbi, CURSEG_HOT_NODE);
	u64 kbytes_written;
	int err;

	/* Flush all the NAT/SIT pages */
	while (get_pages(sbi, F2FS_DIRTY_META)) {
@@ -1239,6 +1268,11 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
	if (unlikely(f2fs_cp_error(sbi)))
		return -EIO;

	/* flush all device cache */
	err = f2fs_flush_device_cache(sbi);
	if (err)
		return err;

	/* write out checkpoint buffer at block 0 */
	update_meta_page(sbi, ckpt, start_blk++);

+26 −11
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ static struct bio *__bio_alloc(struct f2fs_sb_info *sbi, block_t blk_addr,
{
	struct bio *bio;

	bio = f2fs_bio_alloc(npages);
	bio = f2fs_bio_alloc(sbi, npages, true);

	f2fs_target_device(sbi, blk_addr, bio);
	bio->bi_end_io = is_read ? f2fs_read_end_io : f2fs_write_end_io;
@@ -419,8 +419,8 @@ int f2fs_submit_page_write(struct f2fs_io_info *fio)

	bio_page = fio->encrypted_page ? fio->encrypted_page : fio->page;

	/* set submitted = 1 as a return value */
	fio->submitted = 1;
	/* set submitted = true as a return value */
	fio->submitted = true;

	inc_page_count(sbi, WB_DATA_TYPE(bio_page));

@@ -474,7 +474,7 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr,
		f2fs_wait_on_block_writeback(sbi, blkaddr);
	}

	bio = bio_alloc(GFP_KERNEL, min_t(int, nr_pages, BIO_MAX_PAGES));
	bio = f2fs_bio_alloc(sbi, min_t(int, nr_pages, BIO_MAX_PAGES), false);
	if (!bio) {
		if (ctx)
			fscrypt_release_ctx(ctx);
@@ -834,6 +834,13 @@ int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from)
	struct f2fs_map_blocks map;
	int err = 0;

	/* convert inline data for Direct I/O*/
	if (iocb->ki_flags & IOCB_DIRECT) {
		err = f2fs_convert_inline_inode(inode);
		if (err)
			return err;
	}

	if (is_inode_flag_set(inode, FI_NO_PREALLOC))
		return 0;

@@ -846,15 +853,11 @@ int f2fs_preallocate_blocks(struct kiocb *iocb, struct iov_iter *from)

	map.m_next_pgofs = NULL;

	if (iocb->ki_flags & IOCB_DIRECT) {
		err = f2fs_convert_inline_inode(inode);
		if (err)
			return err;
	if (iocb->ki_flags & IOCB_DIRECT)
		return f2fs_map_blocks(inode, &map, 1,
			__force_buffered_io(inode, WRITE) ?
				F2FS_GET_BLOCK_PRE_AIO :
				F2FS_GET_BLOCK_PRE_DIO);
	}
	if (iocb->ki_pos + iov_iter_count(from) > MAX_INLINE_DATA(inode)) {
		err = f2fs_convert_inline_inode(inode);
		if (err)
@@ -1335,7 +1338,7 @@ static int f2fs_read_data_pages(struct file *file,
			struct address_space *mapping,
			struct list_head *pages, unsigned nr_pages)
{
	struct inode *inode = file->f_mapping->host;
	struct inode *inode = mapping->host;
	struct page *page = list_last_entry(pages, struct page, lru);

	trace_f2fs_readpages(inode, page, nr_pages);
@@ -1496,6 +1499,7 @@ static int __write_data_page(struct page *page, bool *submitted,
	int err = 0;
	struct f2fs_io_info fio = {
		.sbi = sbi,
		.ino = inode->i_ino,
		.type = DATA,
		.op = REQ_OP_WRITE,
		.op_flags = wbc_to_write_flags(wbc),
@@ -1567,8 +1571,11 @@ static int __write_data_page(struct page *page, bool *submitted,
			err = do_write_data_page(&fio);
		}
	}

	down_write(&F2FS_I(inode)->i_sem);
	if (F2FS_I(inode)->last_disk_size < psize)
		F2FS_I(inode)->last_disk_size = psize;
	up_write(&F2FS_I(inode)->i_sem);

done:
	if (err && err != -ENOENT)
@@ -1948,6 +1955,12 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
	}
	trace_f2fs_write_begin(inode, pos, len, flags);

	if (f2fs_is_atomic_file(inode) &&
			!available_free_memory(sbi, INMEM_PAGES)) {
		err = -ENOMEM;
		goto fail;
	}

	/*
	 * We should check this at this moment to avoid deadlock on inode page
	 * and #0 page. The locking rule for inline_data conversion should be:
@@ -1963,7 +1976,7 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
	 * Do not use grab_cache_page_write_begin() to avoid deadlock due to
	 * wait_for_stable_page. Will wait that below with our IO control.
	 */
	page = pagecache_get_page(mapping, index,
	page = f2fs_pagecache_get_page(mapping, index,
				FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS);
	if (!page) {
		err = -ENOMEM;
@@ -2025,6 +2038,8 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
fail:
	f2fs_put_page(page, 1);
	f2fs_write_failed(mapping, pos + len);
	if (f2fs_is_atomic_file(inode))
		drop_inmem_pages_all(sbi);
	return err;
}

+23 −8
Original line number Diff line number Diff line
@@ -45,9 +45,18 @@ static void update_general_status(struct f2fs_sb_info *sbi)
	si->ndirty_dent = get_pages(sbi, F2FS_DIRTY_DENTS);
	si->ndirty_meta = get_pages(sbi, F2FS_DIRTY_META);
	si->ndirty_data = get_pages(sbi, F2FS_DIRTY_DATA);
	si->ndirty_qdata = get_pages(sbi, F2FS_DIRTY_QDATA);
	si->ndirty_imeta = get_pages(sbi, F2FS_DIRTY_IMETA);
	si->ndirty_dirs = sbi->ndirty_inode[DIR_INODE];
	si->ndirty_files = sbi->ndirty_inode[FILE_INODE];

	si->nquota_files = 0;
	if (f2fs_sb_has_quota_ino(sbi->sb)) {
		for (i = 0; i < MAXQUOTAS; i++) {
			if (f2fs_qf_ino(sbi->sb, i))
				si->nquota_files++;
		}
	}
	si->ndirty_all = sbi->ndirty_inode[DIRTY_META];
	si->inmem_pages = get_pages(sbi, F2FS_INMEM_PAGES);
	si->aw_cnt = atomic_read(&sbi->aw_cnt);
@@ -61,6 +70,8 @@ static void update_general_status(struct f2fs_sb_info *sbi)
			atomic_read(&SM_I(sbi)->fcc_info->issued_flush);
		si->nr_flushing =
			atomic_read(&SM_I(sbi)->fcc_info->issing_flush);
		si->flush_list_empty =
			llist_empty(&SM_I(sbi)->fcc_info->issue_list);
	}
	if (SM_I(sbi) && SM_I(sbi)->dcc_info) {
		si->nr_discarded =
@@ -96,9 +107,9 @@ static void update_general_status(struct f2fs_sb_info *sbi)
	si->dirty_nats = NM_I(sbi)->dirty_nat_cnt;
	si->sits = MAIN_SEGS(sbi);
	si->dirty_sits = SIT_I(sbi)->dirty_sentries;
	si->free_nids = NM_I(sbi)->nid_cnt[FREE_NID_LIST];
	si->free_nids = NM_I(sbi)->nid_cnt[FREE_NID];
	si->avail_nids = NM_I(sbi)->available_nids;
	si->alloc_nids = NM_I(sbi)->nid_cnt[ALLOC_NID_LIST];
	si->alloc_nids = NM_I(sbi)->nid_cnt[PREALLOC_NID];
	si->bg_gc = sbi->bg_gc;
	si->util_free = (int)(free_user_blocks(sbi) >> sbi->log_blocks_per_seg)
		* 100 / (int)(sbi->user_block_count >> sbi->log_blocks_per_seg)
@@ -231,14 +242,14 @@ static void update_mem_info(struct f2fs_sb_info *sbi)
	}

	/* free nids */
	si->cache_mem += (NM_I(sbi)->nid_cnt[FREE_NID_LIST] +
				NM_I(sbi)->nid_cnt[ALLOC_NID_LIST]) *
	si->cache_mem += (NM_I(sbi)->nid_cnt[FREE_NID] +
				NM_I(sbi)->nid_cnt[PREALLOC_NID]) *
				sizeof(struct free_nid);
	si->cache_mem += NM_I(sbi)->nat_cnt * sizeof(struct nat_entry);
	si->cache_mem += NM_I(sbi)->dirty_nat_cnt *
					sizeof(struct nat_entry_set);
	si->cache_mem += si->inmem_pages * sizeof(struct inmem_pages);
	for (i = 0; i <= ORPHAN_INO; i++)
	for (i = 0; i < MAX_INO_ENTRY; i++)
		si->cache_mem += sbi->im[i].ino_num * sizeof(struct ino_entry);
	si->cache_mem += atomic_read(&sbi->total_ext_tree) *
						sizeof(struct extent_tree);
@@ -262,9 +273,10 @@ static int stat_show(struct seq_file *s, void *v)
	list_for_each_entry(si, &f2fs_stat_list, stat_list) {
		update_general_status(si->sbi);

		seq_printf(s, "\n=====[ partition info(%pg). #%d, %s]=====\n",
		seq_printf(s, "\n=====[ partition info(%pg). #%d, %s, CP: %s]=====\n",
			si->sbi->sb->s_bdev, i++,
			f2fs_readonly(si->sbi->sb) ? "RO": "RW");
			f2fs_readonly(si->sbi->sb) ? "RO": "RW",
			f2fs_cp_error(si->sbi) ? "Error": "Good");
		seq_printf(s, "[SB: 1] [CP: 2] [SIT: %d] [NAT: %d] ",
			   si->sit_area_segs, si->nat_area_segs);
		seq_printf(s, "[SSA: %d] [MAIN: %d",
@@ -349,10 +361,11 @@ static int stat_show(struct seq_file *s, void *v)
		seq_printf(s, "  - Inner Struct Count: tree: %d(%d), node: %d\n",
				si->ext_tree, si->zombie_tree, si->ext_node);
		seq_puts(s, "\nBalancing F2FS Async:\n");
		seq_printf(s, "  - IO (CP: %4d, Data: %4d, Flush: (%4d %4d), "
		seq_printf(s, "  - IO (CP: %4d, Data: %4d, Flush: (%4d %4d %4d), "
			"Discard: (%4d %4d)) cmd: %4d undiscard:%4u\n",
			   si->nr_wb_cp_data, si->nr_wb_data,
			   si->nr_flushing, si->nr_flushed,
			   si->flush_list_empty,
			   si->nr_discarding, si->nr_discarded,
			   si->nr_discard_cmd, si->undiscard_blks);
		seq_printf(s, "  - inmem: %4d, atomic IO: %4d (Max. %4d), "
@@ -365,6 +378,8 @@ static int stat_show(struct seq_file *s, void *v)
			   si->ndirty_dent, si->ndirty_dirs, si->ndirty_all);
		seq_printf(s, "  - datas: %4d in files:%4d\n",
			   si->ndirty_data, si->ndirty_files);
		seq_printf(s, "  - quota datas: %4d in quota files:%4d\n",
			   si->ndirty_qdata, si->nquota_files);
		seq_printf(s, "  - meta: %4d in %4d\n",
			   si->ndirty_meta, si->meta_pages);
		seq_printf(s, "  - imeta: %4d\n",
Loading