summaryrefslogtreecommitdiffstats
path: root/fs/anon_inodes.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-22 23:20:48 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-22 23:20:48 +0100
commitfe35d4a0289a8d6efcacb57e9a377b845686df10 (patch)
tree05ff26e6658d3ddc6e4885059bbf018b1681bb3b /fs/anon_inodes.c
parentMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentjfs: Fix 32bit build warning (diff)
downloadlinux-fe35d4a0289a8d6efcacb57e9a377b845686df10.tar.xz
linux-fe35d4a0289a8d6efcacb57e9a377b845686df10.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: jfs: Fix 32bit build warning Remove obsolete comment in fs.h Sanitize f_flags helpers Fix f_flags/f_mode in case of lookup_instantiate_filp() from open(pathname, 3) anonfd: Allow making anon files read-only fs/compat_ioctl.c: fix build error when !BLOCK pohmelfs needs I_LOCK alloc_file(): simplify handling of mnt_clone_write() errors
Diffstat (limited to 'fs/anon_inodes.c')
-rw-r--r--fs/anon_inodes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 2c994591f4d7..9f0bf13291e5 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -121,13 +121,13 @@ struct file *anon_inode_getfile(const char *name,
d_instantiate(path.dentry, anon_inode_inode);
error = -ENFILE;
- file = alloc_file(&path, FMODE_READ | FMODE_WRITE, fops);
+ file = alloc_file(&path, OPEN_FMODE(flags), fops);
if (!file)
goto err_dput;
file->f_mapping = anon_inode_inode->i_mapping;
file->f_pos = 0;
- file->f_flags = O_RDWR | (flags & O_NONBLOCK);
+ file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
file->f_version = 0;
file->private_data = priv;