linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to enable readahead last NAT block
@ 2014-04-17  9:20 Chao Yu
  2014-04-18  2:15 ` [f2fs-dev] " Jaegeuk Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2014-04-17  9:20 UTC (permalink / raw)
  To: ???; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

We skip reading last one of NAT blocks when readahead them since max value of
valid block is calculated incorrectly. We should fix this problem to avoid it.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
 fs/f2fs/checkpoint.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 744c68b..75189b1 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -77,7 +77,7 @@ inline int get_max_meta_blks(struct f2fs_sb_info *sbi, int type)
 {
 	switch (type) {
 	case META_NAT:
-		return NM_I(sbi)->max_nid / NAT_ENTRY_PER_BLOCK;
+		return (NM_I(sbi)->max_nid + 3) / NAT_ENTRY_PER_BLOCK;
 	case META_SIT:
 		return SIT_BLK_CNT(sbi);
 	case META_SSA:
-- 
1.7.9.5



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-18  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17  9:20 [PATCH] f2fs: fix to enable readahead last NAT block Chao Yu
2014-04-18  2:15 ` [f2fs-dev] " Jaegeuk Kim
2014-04-18  3:17   ` Chao Yu
2014-04-18  5:58     ` Jaegeuk Kim

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).