From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com
Cc: miaoxie@huawei.com, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs-tools: do not count free_segs in flush_sit_entries
Date: Wed, 13 Jun 2018 18:13:59 +0800 [thread overview]
Message-ID: <20180613101359.1184-1-shengyong1@huawei.com> (raw)
In-Reply-To: <20180613015150.197854-2-shengyong1@huawei.com>
flush_sit_entries() is always called before write_checkpoint(). Since
free_segs is counted in write_checkpoint, there is no need to do that
in flush_sit_entries. Besides, the value of free_segs may be not
correct if we skip uptodate seg_entries.
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
fsck/mount.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index 68278c5..80a4849 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1867,11 +1867,9 @@ void flush_journal_entries(struct f2fs_sb_info *sbi)
void flush_sit_entries(struct f2fs_sb_info *sbi)
{
- struct f2fs_checkpoint *cp = F2FS_CKPT(sbi);
struct sit_info *sit_i = SIT_I(sbi);
struct f2fs_sit_block *sit_blk;
unsigned int segno = 0;
- u32 free_segs = 0;
sit_blk = calloc(BLOCK_SZ, 1);
ASSERT(sit_blk);
@@ -1891,14 +1889,9 @@ void flush_sit_entries(struct f2fs_sb_info *sbi)
sit->vblocks = cpu_to_le16((se->type << SIT_VBLOCKS_SHIFT) |
se->valid_blocks);
rewrite_current_sit_page(sbi, segno, sit_blk);
-
- if (se->valid_blocks == 0x0 &&
- !IS_CUR_SEGNO(sbi, segno, NO_CHECK_TYPE))
- free_segs++;
}
free(sit_blk);
- set_cp(free_segment_count, free_segs);
}
int find_next_free_block(struct f2fs_sb_info *sbi, u64 *to, int left, int type)
--
2.17.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next prev parent reply other threads:[~2018-06-13 10:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 1:51 [PATCH 1/2] sload.f2fs: update sit entries of cursegs Sheng Yong
2018-06-13 1:51 ` [RFC PATCH 2/2] fsck.f2fs: introduce fsck_chk_curseg_info Sheng Yong
2018-06-13 10:13 ` Sheng Yong [this message]
2018-06-19 12:12 ` [PATCH] f2fs-tools: do not count free_segs in flush_sit_entries Chao Yu
2018-06-19 12:11 ` [RFC PATCH 2/2] fsck.f2fs: introduce fsck_chk_curseg_info Chao Yu
2018-06-20 11:12 ` [PATCH v2] " Sheng Yong
2018-06-21 6:12 ` Chao Yu
2018-06-19 12:07 ` [PATCH 1/2] sload.f2fs: update sit entries of cursegs Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180613101359.1184-1-shengyong1@huawei.com \
--to=shengyong1@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=miaoxie@huawei.com \
--cc=yuchao0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).