mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
introduce FMODE_OPENED
basically, "is that instance set up enough for regular fput(), or do we want put_filp() for that one". NOTE: the only alloc_file() caller that could be followed by put_filp() is in arch/ia64/kernel/perfmon.c, which is (Kconfig-level) broken. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
9481769208
commit
f5d11409e6
3 changed files with 5 additions and 1 deletions
|
@ -749,7 +749,7 @@ static int do_dentry_open(struct file *f,
|
|||
f->f_wb_err = filemap_sample_wb_err(f->f_mapping);
|
||||
|
||||
if (unlikely(f->f_flags & O_PATH)) {
|
||||
f->f_mode = FMODE_PATH;
|
||||
f->f_mode = FMODE_PATH | FMODE_OPENED;
|
||||
f->f_op = &empty_fops;
|
||||
return 0;
|
||||
}
|
||||
|
@ -793,6 +793,7 @@ static int do_dentry_open(struct file *f,
|
|||
if (error)
|
||||
goto cleanup_all;
|
||||
}
|
||||
f->f_mode |= FMODE_OPENED;
|
||||
if ((f->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ)
|
||||
i_readcount_inc(inode);
|
||||
if ((f->f_mode & FMODE_READ) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue