]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: use shmem_kernel_file_setup in xfile_create
authorChristoph Hellwig <hch@lst.de>
Mon, 19 Feb 2024 06:27:18 +0000 (07:27 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Wed, 21 Feb 2024 06:06:52 +0000 (11:36 +0530)
shmem_kernel_file_setup is equivalent to shmem_file_setup except that it
already sets the S_PRIVATE flag.  Use it instead of open coding the
logic.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/scrub/xfile.c

index e649558351bc5acdc4028300ebd8b5ec4bb37d01..99a2b48f5662e67ec4086c53b7b175b8d35affe5 100644 (file)
@@ -68,7 +68,7 @@ xfile_create(
        if (!xf)
                return -ENOMEM;
 
-       xf->file = shmem_file_setup(description, isize, VM_NORESERVE);
+       xf->file = shmem_kernel_file_setup(description, isize, VM_NORESERVE);
        if (IS_ERR(xf->file)) {
                error = PTR_ERR(xf->file);
                goto out_xfile;
@@ -85,7 +85,7 @@ xfile_create(
                            FMODE_LSEEK;
        xf->file->f_flags |= O_RDWR | O_LARGEFILE | O_NOATIME;
        inode = file_inode(xf->file);
-       inode->i_flags |= S_PRIVATE | S_NOCMTIME | S_NOATIME;
+       inode->i_flags |= S_NOCMTIME | S_NOATIME;
        inode->i_mode &= ~0177;
        inode->i_uid = GLOBAL_ROOT_UID;
        inode->i_gid = GLOBAL_ROOT_GID;