summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorHyunchul Lee <cheol.lee@lge.com>2017-11-28 09:23:00 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2018-01-02 19:27:29 -0800
commitd5097be55c21c103d2227591708425aab2e9682d (patch)
tree04633656e6a00f6728ac9ff85423a83a443b55f9 /fs/f2fs/file.c
parent20bb2479be49296ca324d7d9dfafad4816e7958c (diff)
downloadlinux-stable-d5097be55c21c103d2227591708425aab2e9682d.tar.gz
linux-stable-d5097be55c21c103d2227591708425aab2e9682d.tar.bz2
linux-stable-d5097be55c21c103d2227591708425aab2e9682d.zip
f2fs: apply write hints to select the type of segment for direct write
When blocks are allocated for direct write, select the type of segment using the kiocb hint. But if an inode has FI_NO_ALLOC, use the inode hint. Signed-off-by: Hyunchul Lee <cheol.lee@lge.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index d2bd2138514c..6db8a46b2b73 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1418,7 +1418,8 @@ static int expand_inode_data(struct inode *inode, loff_t offset,
loff_t len, int mode)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
- struct f2fs_map_blocks map = { .m_next_pgofs = NULL };
+ struct f2fs_map_blocks map = { .m_next_pgofs = NULL,
+ .m_seg_type = NO_CHECK_TYPE };
pgoff_t pg_end;
loff_t new_size = i_size_read(inode);
loff_t off_end;
@@ -2066,7 +2067,8 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi,
struct f2fs_defragment *range)
{
struct inode *inode = file_inode(filp);
- struct f2fs_map_blocks map = { .m_next_pgofs = NULL };
+ struct f2fs_map_blocks map = { .m_next_pgofs = NULL,
+ .m_seg_type = NO_CHECK_TYPE };
struct extent_info ei = {0,0,0};
pgoff_t pg_start, pg_end;
unsigned int blk_per_seg = sbi->blocks_per_seg;