From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 1/4] f2fs: use segment number for get_valid_blocks
Date: Mon, 10 Apr 2017 17:13:05 -0700 [thread overview]
Message-ID: <20170411001308.12881-1-jaegeuk@kernel.org> (raw)
This patch fixes to submit a segment number for get_valid_blocks.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/segment.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index b8a1bac9355d..39ef9cc0093b 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -80,6 +80,8 @@
GET_SEGNO_FROM_SEG0(sbi, blk_addr)))
#define GET_SECNO(sbi, segno) \
((segno) / (sbi)->segs_per_sec)
+#define GET_SEGNO_FROM_SECNO(sbi, secno) \
+ ((secno) * (sbi)->segs_per_sec)
#define GET_ZONENO_FROM_SEGNO(sbi, segno) \
(((segno) / (sbi)->segs_per_sec) / (sbi)->secs_per_zone)
@@ -720,8 +722,8 @@ static inline block_t sum_blk_addr(struct f2fs_sb_info *sbi, int base, int type)
static inline bool no_fggc_candidate(struct f2fs_sb_info *sbi,
unsigned int secno)
{
- if (get_valid_blocks(sbi, secno, sbi->segs_per_sec) >=
- sbi->fggc_threshold)
+ if (get_valid_blocks(sbi, GET_SEGNO_FROM_SECNO(sbi, secno),
+ sbi->segs_per_sec) >= sbi->fggc_threshold)
return true;
return false;
}
--
2.11.0
next reply other threads:[~2017-04-11 0:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-11 0:13 Jaegeuk Kim [this message]
2017-04-11 0:13 ` [PATCH 2/4] f2fs: clean up get_valid_blocks with consistent parameter Jaegeuk Kim
2017-04-11 0:13 ` [PATCH 3/4] f2fs: clean up some macros in terms of GET_SEGNO Jaegeuk Kim
2017-04-11 0:13 ` [PATCH 4/4] f2fs: avoid frequent checkpoint during f2fs_gc Jaegeuk Kim
2017-04-11 1:42 ` Chao Yu
2017-04-11 22:13 ` Jaegeuk Kim
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=20170411001308.12881-1-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).