Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd4b046 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 16650422
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1422,8 +1422,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);