aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorChangman Lee <cm224.lee@samsung.com>2014-05-11 23:27:43 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-06-04 00:34:30 -0400
commit1dbe4152168d44fa164edbdc9f1243de70b98f7a (patch)
tree205318206e29db519ad1aad5e8042ae879c77184 /fs/f2fs/f2fs.h
parentbac4eef6537a663585f3fb3d633a629c72e3b73d (diff)
f2fs: large volume support
f2fs's cp has one page which consists of struct f2fs_checkpoint and version bitmap of sit and nat. To support lots of segments, we need more blocks for sit bitmap. So let's arrange sit bitmap as following: +-----------------+------------+ | f2fs_checkpoint | sit bitmap | | + nat bitmap | | +-----------------+------------+ 0 4k N blocks Signed-off-by: Changman Lee <cm224.lee@samsung.com> [Jaegeuk Kim: simple code change for readability] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 676a2c6ccec7..9684b1f77a7d 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -764,9 +764,18 @@ static inline unsigned long __bitmap_size(struct f2fs_sb_info *sbi, int flag)
764static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag) 764static inline void *__bitmap_ptr(struct f2fs_sb_info *sbi, int flag)
765{ 765{
766 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); 766 struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
767 int offset = (flag == NAT_BITMAP) ? 767 int offset;
768
769 if (le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload) > 0) {
770 if (flag == NAT_BITMAP)
771 return &ckpt->sit_nat_version_bitmap;
772 else
773 return ((unsigned char *)ckpt + F2FS_BLKSIZE);
774 } else {
775 offset = (flag == NAT_BITMAP) ?
768 le32_to_cpu(ckpt->sit_ver_bitmap_bytesize) : 0; 776 le32_to_cpu(ckpt->sit_ver_bitmap_bytesize) : 0;
769 return &ckpt->sit_nat_version_bitmap + offset; 777 return &ckpt->sit_nat_version_bitmap + offset;
778 }
770} 779}
771 780
772static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi) 781static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)