All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: initialize both two copies of NAT and SIT area
@ 2015-07-23  1:43 Yunlei He
  2015-07-23 18:18 ` Jaegeuk Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Yunlei He @ 2015-07-23  1:43 UTC (permalink / raw)
  To: linux-f2fs-devel, jaegeuk

In the process of formatting, we zero out only one copy of NAT and
SIT area, but we use both of them when the filesystem is sucessfully
mounted. So I change the code to initialize both of two copies in mkfs.

Signed-off-by: Yunlei He <heyunlei@huawei.com>
---
 mkfs/f2fs_format.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index f879bca..b2b3549 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -389,7 +389,7 @@ static int f2fs_init_sit_area(void)
 	sit_seg_addr *= blk_size;
 
 	DBG(1, "\tFilling sit area at offset 0x%08"PRIx64"\n", sit_seg_addr);
-	for (index = 0; index < (get_sb(segment_count_sit) / 2); index++) {
+	for (index = 0; index < get_sb(segment_count_sit); index++) {
 		if (dev_fill(zero_buf, sit_seg_addr, seg_size)) {
 			MSG(1, "\tError: While zeroing out the sit area \
 					on disk!!!\n");
@@ -423,14 +423,14 @@ static int f2fs_init_nat_area(void)
 	nat_seg_addr *= blk_size;
 
 	DBG(1, "\tFilling nat area at offset 0x%08"PRIx64"\n", nat_seg_addr);
-	for (index = 0; index < get_sb(segment_count_nat) / 2; index++) {
+	for (index = 0; index < get_sb(segment_count_nat); index++) {
 		if (dev_fill(nat_buf, nat_seg_addr, seg_size)) {
 			MSG(1, "\tError: While zeroing out the nat area \
 					on disk!!!\n");
 			free(nat_buf);
 			return -1;
 		}
-		nat_seg_addr = nat_seg_addr + (2 * seg_size);
+		nat_seg_addr = nat_seg_addr + seg_size;
 	}
 
 	free(nat_buf);
-- 
1.9.1


------------------------------------------------------------------------------

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

end of thread, other threads:[~2015-07-24 16:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23  1:43 [PATCH] f2fs: initialize both two copies of NAT and SIT area Yunlei He
2015-07-23 18:18 ` Jaegeuk Kim
2015-07-24  9:55   ` He YunLei
2015-07-24 16:00     ` Jaegeuk Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.