From: Jaegeuk Kim Date: Fri, 4 Nov 2016 21:33:57 +0000 (-0700) Subject: f2fs: assign segments correctly for direct_io X-Git-Tag: v4.14-rc1~1902^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bdb7d964c4fb73078ab21c20e8c7b7bf7e641bb6;p=platform%2Fkernel%2Flinux-rpi.git 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 --- diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 5e7e311..7fb7dd3 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1501,8 +1501,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);