summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorChao Yu2015-01-28 10:48:42 +0100
committerJaegeuk Kim2015-02-12 02:04:38 +0100
commitcaf0047e7e1e60a7ad1d655d3b81b32e2dfb6095 (patch)
tree0d4725d944d54b437ac3fd7218794773197b1c2a /fs/f2fs/node.c
parentf2fs: clean up {in,de}create_sleep_time (diff)
downloadkernel-qcow2-linux-caf0047e7e1e60a7ad1d655d3b81b32e2dfb6095.tar.gz
kernel-qcow2-linux-caf0047e7e1e60a7ad1d655d3b81b32e2dfb6095.tar.xz
kernel-qcow2-linux-caf0047e7e1e60a7ad1d655d3b81b32e2dfb6095.zip
f2fs: merge flags in struct f2fs_sb_info
Currently, there are several variables with Boolean type as below: struct f2fs_sb_info { ... int s_dirty; bool need_fsck; bool s_closing; ... bool por_doing; ... } For this there are some issues: 1. there are some space of f2fs_sb_info is wasted due to aligning after Boolean type variables by compiler. 2. if we continuously add new flag into f2fs_sb_info, structure will be messed up. So in this patch, we try to: 1. switch s_dirty to Boolean type variable since it has two status 0/1. 2. merge s_dirty/need_fsck/s_closing/por_doing variables into s_flag. 3. introduce an enum type which can indicate different states of sbi. 4. use new introduced universal interfaces is_sbi_flag_set/{set,clear}_sbi_flag to operate flags for sbi. After that, above issues will be fixed. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index d7c143626705..05e6faa71cff 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -588,7 +588,7 @@ static void truncate_node(struct dnode_of_data *dn)
}
invalidate:
clear_node_page_dirty(dn->node_page);
- F2FS_SET_SB_DIRT(sbi);
+ set_sbi_flag(sbi, SBI_IS_DIRTY);
f2fs_put_page(dn->node_page, 1);
@@ -1284,7 +1284,7 @@ static int f2fs_write_node_page(struct page *page,
trace_f2fs_writepage(page, NODE);
- if (unlikely(sbi->por_doing))
+ if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
goto redirty_out;
if (unlikely(f2fs_cp_error(sbi)))
goto redirty_out;