aboutsummaryrefslogtreecommitdiffstats
path: root/include/f2fs_fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/f2fs_fs.h')
-rw-r--r--include/f2fs_fs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index 53b8cb9..80ce918 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -221,6 +221,7 @@ enum {
#define F2FS_LOG_SECTORS_PER_BLOCK 3 /* 4KB: F2FS_BLKSIZE */
#define F2FS_BLKSIZE 4096 /* support only 4KB block */
#define F2FS_MAX_EXTENSION 64 /* # of extension entries */
+#define F2FS_BLK_ALIGN(x) (((x) + F2FS_BLKSIZE - 1) / F2FS_BLKSIZE)
#define NULL_ADDR 0x0U
#define NEW_ADDR -1U
@@ -456,6 +457,13 @@ struct f2fs_nat_block {
#define SIT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_sit_entry))
/*
+ * F2FS uses 4 bytes to represent block address. As a result, supported size of
+ * disk is 16 TB and it equals to 16 * 1024 * 1024 / 2 segments.
+ */
+#define F2FS_MAX_SEGMENT ((16 * 1024 * 1024) / 2)
+#define MAX_SIT_BITMAP_SIZE ((F2FS_MAX_SEGMENT / SIT_ENTRY_PER_BLOCK) / 8)
+
+/*
* Note that f2fs_sit_entry->vblocks has the following bit-field information.
* [15:10] : allocation type such as CURSEG_XXXX_TYPE
* [9:0] : valid block count