aboutsummaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-06-03 19:29:38 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:33:46 +0200
commit67ad20a34ebac06858174a6955aa2fdfe1c5209a (patch)
treea4c4bd5e0ffc422ffa18d36ba9bae78581b9ec9c /fs/f2fs/segment.h
parentce775c5d4ed2e729a6d51b03fe8045ba4805b42e (diff)
f2fs: introduce mode=lfs mount option
This mount option is to enable original log-structured filesystem forcefully. So, there should be no random writes for main area. Especially, this supports host-managed SMR device. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 43c6d0bab..1e7148897 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -469,6 +469,10 @@ static inline bool need_SSR(struct f2fs_sb_info *sbi)
{
int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
+
+ if (test_opt(sbi, LFS))
+ return false;
+
return free_sections(sbi) <= (node_secs + 2 * dent_secs +
reserved_sections(sbi) + 1);
}
@@ -532,6 +536,9 @@ static inline bool need_inplace_update(struct inode *inode)
if (S_ISDIR(inode->i_mode) || f2fs_is_atomic_file(inode))
return false;
+ if (test_opt(sbi, LFS))
+ return false;
+
if (policy & (0x1 << F2FS_IPU_FORCE))
return true;
if (policy & (0x1 << F2FS_IPU_SSR) && need_SSR(sbi))