]> git.baikalelectronics.ru Git - kernel.git/commitdiff
f2fs: allow compression for mmap files in compress_mode=user
authorSungjong Seo <sj1557.seo@samsung.com>
Tue, 24 May 2022 01:29:11 +0000 (10:29 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 25 May 2022 06:06:38 +0000 (23:06 -0700)
Since commit 7c1c191e44c1 ("f2fs: let's allow compression for mmap files"),
it has been allowed to compress mmap files. However, in compress_mode=user,
it is not allowed yet. To keep the same concept in both compress_modes,
f2fs_ioc_(de)compress_file() should also allow it.

Let's remove checking mmap files in f2fs_ioc_(de)compress_file() so that
the compression for mmap files is also allowed in compress_mode=user.

Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c

index 7aac53ac5acfb3fd6893421e3628b4893c70408a..a05d842a7e7222751ec7326b727fcb41ae3c319a 100644 (file)
@@ -3945,11 +3945,6 @@ static int f2fs_ioc_decompress_file(struct file *filp, unsigned long arg)
                goto out;
        }
 
-       if (f2fs_is_mmap_file(inode)) {
-               ret = -EBUSY;
-               goto out;
-       }
-
        ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
        if (ret)
                goto out;
@@ -4017,11 +4012,6 @@ static int f2fs_ioc_compress_file(struct file *filp, unsigned long arg)
                goto out;
        }
 
-       if (f2fs_is_mmap_file(inode)) {
-               ret = -EBUSY;
-               goto out;
-       }
-
        ret = filemap_write_and_wait_range(inode->i_mapping, 0, LLONG_MAX);
        if (ret)
                goto out;