Skip to content

Commit

Permalink
f2fs: assign segments correctly for direct_io
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaegeuk Kim committed Nov 23, 2016
1 parent 9f0552e commit bdb7d96
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bdb7d96

Please sign in to comment.