summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-06-08 18:58:04 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 16:04:18 +0200
commitaad888f828fec1e7160b67f122172e7ab7f82e03 (patch)
tree2f8e5e3c691ae5ecd6e03de48e4912d6f383cb37 /fs/open.c
parentnow we can fold open_check_o_direct() into do_dentry_open() (diff)
downloadlinux-aad888f828fec1e7160b67f122172e7ab7f82e03.tar.xz
linux-aad888f828fec1e7160b67f122172e7ab7f82e03.zip
switch all remaining checks for FILE_OPENED to FMODE_OPENED
... and don't bother with setting FILE_OPENED at all. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/open.c b/fs/open.c
index ee893240d199..d2030a3c5c52 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -846,15 +846,10 @@ int finish_open(struct file *file, struct dentry *dentry,
int (*open)(struct inode *, struct file *),
int *opened)
{
- int error;
- BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
+ BUG_ON(file->f_mode & FMODE_OPENED); /* once it's opened, it's opened */
file->f_path.dentry = dentry;
- error = do_dentry_open(file, d_backing_inode(dentry), open);
- if (!error)
- *opened |= FILE_OPENED;
-
- return error;
+ return do_dentry_open(file, d_backing_inode(dentry), open);
}
EXPORT_SYMBOL(finish_open);