summaryrefslogtreecommitdiff
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2018-02-18 19:50:49 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2018-03-13 02:05:50 +0300
commit079396270b0f1e98496ef7672dd754bdd42574dc (patch)
treed43fd93275089f03879da9315eafb5cf6b90b854 /fs/f2fs/f2fs.h
parent69babac019337b35aae5644ccf8089243c749d4c (diff)
downloadlinux-079396270b0f1e98496ef7672dd754bdd42574dc.tar.xz
f2fs: add mount option for segment allocation policy
This patch adds an mount option, "alloc_mode=%s" having two options, "default" and "reuse". In "alloc_mode=reuse" case, f2fs starts to allocate segments from 0'th segment all the time to reassign segments. It'd be useful for small-sized eMMC parts. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 3bb4e943454a..833c9bc06d03 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1043,6 +1043,11 @@ enum {
WHINT_MODE_FS, /* pass down hints with F2FS policy */
};
+enum {
+ ALLOC_MODE_DEFAULT, /* stay default */
+ ALLOC_MODE_REUSE, /* reuse segments as much as possible */
+};
+
struct f2fs_sb_info {
struct super_block *sb; /* pointer to VFS super block */
struct proc_dir_entry *s_proc; /* proc entry */
@@ -1229,6 +1234,9 @@ struct f2fs_sb_info {
#endif
/* For which write hints are passed down to block layer */
int whint_mode;
+
+ /* segment allocation policy */
+ int alloc_mode;
};
#ifdef CONFIG_F2FS_FAULT_INJECTION