f2fs: allow direct io of pinned files for zoned storage
authorDaeho Jeong <daehojeong@google.com>
Thu, 11 Apr 2024 18:37:53 +0000 (11:37 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sun, 14 Apr 2024 15:18:23 +0000 (15:18 +0000)
Since the allocation happens in conventional LU for zoned storage, we
can allow direct io for that.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 7fbdb7863778fbbb5431d5f9ba3b64c9e46d558a..ac1ae85f3cc3d70c055ca5812598018cb80f2e8e 100644 (file)
@@ -833,7 +833,8 @@ static bool f2fs_force_buffered_io(struct inode *inode, int rw)
         * for blkzoned device, fallback direct IO to buffered IO, so
         * all IOs can be serialized by log-structured write.
         */
-       if (f2fs_sb_has_blkzoned(sbi) && (rw == WRITE))
+       if (f2fs_sb_has_blkzoned(sbi) && (rw == WRITE) &&
+           !f2fs_is_pinned_file(inode))
                return true;
        if (is_sbi_flag_set(sbi, SBI_CP_DISABLED))
                return true;