summaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-06-08 12:58:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:04:18 -0400
commitaad888f828fec1e7160b67f122172e7ab7f82e03 (patch)
tree2f8e5e3c691ae5ecd6e03de48e4912d6f383cb37 /fs/open.c
parent69527c554f82d4bca4b154ccc06ad1554806bdc0 (diff)
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,
846 int (*open)(struct inode *, struct file *), 846 int (*open)(struct inode *, struct file *),
847 int *opened) 847 int *opened)
848{ 848{
849 int error; 849 BUG_ON(file->f_mode & FMODE_OPENED); /* once it's opened, it's opened */
850 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
851 850
852 file->f_path.dentry = dentry; 851 file->f_path.dentry = dentry;
853 error = do_dentry_open(file, d_backing_inode(dentry), open); 852 return do_dentry_open(file, d_backing_inode(dentry), open);
854 if (!error)
855 *opened |= FILE_OPENED;
856
857 return error;
858} 853}
859EXPORT_SYMBOL(finish_open); 854EXPORT_SYMBOL(finish_open);
860 855