summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-07-11 14:19:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:02:57 -0400
commitc9c554f21490bbc96cc554f80024d27d09670480 (patch)
treef680bcb2253cf658a7a925d0eb20f2dff71c1f1f /mm
parent6b4e8085c0004382b985a5c005c685073630e746 (diff)
downloadlinux-c9c554f21490bbc96cc554f80024d27d09670480.tar.bz2
alloc_file(): switch to passing O_... flags instead of FMODE_... mode
... so that it could set both ->f_flags and ->f_mode, without callers having to set ->f_flags manually. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm')
-rw-r--r--mm/memfd.c2
-rw-r--r--mm/shmem.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/mm/memfd.c b/mm/memfd.c
index 27069518e3c5..2bb5e257080e 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -326,7 +326,7 @@ SYSCALL_DEFINE2(memfd_create,
goto err_fd;
}
file->f_mode |= FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE;
- file->f_flags |= O_RDWR | O_LARGEFILE;
+ file->f_flags |= O_LARGEFILE;
if (flags & MFD_ALLOW_SEALING) {
file_seals = memfd_file_seals_ptr(file);
diff --git a/mm/shmem.c b/mm/shmem.c
index 2cab84403055..84844e52bf24 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -3942,8 +3942,7 @@ static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name, l
if (IS_ERR(res))
goto put_path;
- res = alloc_file(&path, FMODE_WRITE | FMODE_READ,
- &shmem_file_operations);
+ res = alloc_file(&path, O_RDWR, &shmem_file_operations);
if (IS_ERR(res))
goto put_path;