aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-11-04 14:33:57 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-13 12:34:25 +0200
commitd688b49951cc137bbb24505cfc4482092046a18e (patch)
treef55ca970e8e92194eefd8513df8fe13df5bd7531
parent69499cedc9ed5300f4c8709706209cbc52976a78 (diff)
downloadandroid_kernel_m2note-d688b49951cc137bbb24505cfc4482092046a18e.tar.gz
f2fs: assign segments correctly for direct_io
Previously, we assigned CURSEG_WARM_DATA for direct_io, but if we have two or four logs, we do not use that type at all. Let's fix it. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/segment.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 607fce12b..f43f2a585 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1481,8 +1481,12 @@ void allocate_data_block(struct f2fs_sb_info *sbi, struct page *page,
struct curseg_info *curseg;
bool direct_io = (type == CURSEG_DIRECT_IO);
- type = direct_io ? CURSEG_WARM_DATA : type;
-
+ if (direct_io) {
+ if (sbi->active_logs <= 4)
+ type = CURSEG_HOT_DATA;
+ else
+ type = CURSEG_WARM_DATA;
+ }
curseg = CURSEG_I(sbi, type);
mutex_lock(&curseg->curseg_mutex);