diff options
author | Bart Van Assche <bvanassche@acm.org> | 2022-06-23 11:12:07 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2022-07-21 19:27:52 -0700 |
commit | c89be7a8915086a1b99ca6f80f3ffa36a26ae680 (patch) | |
tree | ec8bc31454651e60a6e008a77b1a4a411991c751 | |
parent | 5317d184f49960f57398afb39264416805311a3f (diff) | |
download | f2fs-tools-c89be7a8915086a1b99ca6f80f3ffa36a26ae680.tar.gz |
Use F2FS_BLKSIZE for dev_read_block() buffers
Use F2FS_BLKSIZE instead of PAGE_SIZE for dev_read_block() buffers since
dev_read_block() reads F2FS_BLKSIZE bytes.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/mount.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fsck/mount.c b/fsck/mount.c index 108e123..cc871fe 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1115,7 +1115,7 @@ static void *get_checkpoint_version(block_t cp_addr) { void *cp_page; - cp_page = malloc(PAGE_SIZE); + cp_page = malloc(F2FS_BLKSIZE); ASSERT(cp_page); if (dev_read_block(cp_page, cp_addr) < 0) @@ -1821,7 +1821,7 @@ static void read_compacted_summaries(struct f2fs_sb_info *sbi) start = start_sum_block(sbi); - kaddr = (char *)malloc(PAGE_SIZE); + kaddr = malloc(F2FS_BLKSIZE); ASSERT(kaddr); ret = dev_read_block(kaddr, start++); @@ -1856,7 +1856,7 @@ static void read_compacted_summaries(struct f2fs_sb_info *sbi) if (offset + SUMMARY_SIZE <= PAGE_CACHE_SIZE - SUM_FOOTER_SIZE) continue; - memset(kaddr, 0, PAGE_SIZE); + memset(kaddr, 0, F2FS_BLKSIZE); ret = dev_read_block(kaddr, start++); ASSERT(ret >= 0); offset = 0; |