aboutsummaryrefslogtreecommitdiff
path: root/include/linux/f2fs_fs.h
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-02-23 10:53:49 +0800
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:35:04 +0200
commit9cac8b4fdcca0ce6f49d0f0fb0bd19d21f486f94 (patch)
treeecaddddc391b44a9606b2a463a6970e66d2330b2 /include/linux/f2fs_fs.h
parentd7459ffee9d77c6947d47da2c0d12b58eadb7c5b (diff)
f2fs: introduce free nid bitmap
In scenario of intensively node allocation, free nids will be ran out soon, then it needs to stop to load free nids by traversing NAT blocks, in worse case, if NAT blocks does not be cached in memory, it generates IOs which slows down our foreground operations. In order to speed up node allocation, in this patch we introduce a new free_nid_bitmap array, so there is an bitmap table for each NAT block, Once the NAT block is loaded, related bitmap cache will be switched on, and bitmap will be set during traversing nat entries in NAT block, later we can query and update nid usage status in memory completely. With such implementation, I expect performance of node allocation can be improved in the long-term after filesystem image is mounted. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Conflicts: include/linux/f2fs_fs.h
Diffstat (limited to 'include/linux/f2fs_fs.h')
-rw-r--r--include/linux/f2fs_fs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index ae5c0c2c8..acdeb7390 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -278,7 +278,8 @@ struct f2fs_node {
/*
* For NAT entries
*/
-#define NAT_ENTRY_PER_BLOCK (PAGE_CACHE_SIZE / sizeof(struct f2fs_nat_entry))
+#define NAT_ENTRY_PER_BLOCK (PAGE_SIZE / sizeof(struct f2fs_nat_entry))
+#define NAT_ENTRY_BITMAP_SIZE ((NAT_ENTRY_PER_BLOCK + 7) / 8)
struct f2fs_nat_entry {
__u8 version; /* latest version of cached nat entry */