f2fs: remove unnecessary IS_SWAPFILE check
authorhuangjianan@oppo.com <huangjianan@oppo.com>
Sat, 27 Feb 2021 12:02:29 +0000 (20:02 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 12 Mar 2021 21:16:43 +0000 (13:16 -0800)
Now swapfile in f2fs directly submit IO to blockdev according to
swapfile extents reported by f2fs when swapon, therefore there is
no need to check IS_SWAPFILE when exec filesystem operation.

Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Guo Weichao <guoweichao@oppo.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h

index 7c95818639a630e1bdcb59af77a38bc4b5d14346..1531463768bf6d401a45bb770fc0e6904a23e4ff 100644 (file)
@@ -1722,7 +1722,7 @@ static int get_data_block_dio_write(struct inode *inode, sector_t iblock,
        return __get_data_block(inode, iblock, bh_result, create,
                                F2FS_GET_BLOCK_DIO, NULL,
                                f2fs_rw_hint_to_seg_type(inode->i_write_hint),
-                               IS_SWAPFILE(inode) ? false : true);
+                               true);
 }
 
 static int get_data_block_dio(struct inode *inode, sector_t iblock,
index 99e243fd26d574daebad8fb9e2c48ddb1a625336..cd004424debcde29cc105abd14a135998192c482 100644 (file)
@@ -4177,8 +4177,7 @@ static inline bool f2fs_force_buffered_io(struct inode *inode,
                if (F2FS_IO_ALIGNED(sbi))
                        return true;
        }
-       if (is_sbi_flag_set(F2FS_I_SB(inode), SBI_CP_DISABLED) &&
-                                       !IS_SWAPFILE(inode))
+       if (is_sbi_flag_set(F2FS_I_SB(inode), SBI_CP_DISABLED))
                return true;
 
        return false;