mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
mark struct file that had write access grabbed by open()
new flag in ->f_mode - FMODE_WRITER. Set by do_dentry_open() in case when it has grabbed write access, checked by __fput() to decide whether it wants to drop the sucker. Allows to stop bothering with mnt_clone_write() in alloc_file(), along with fewer special_file() checks. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
0ccb286346
commit
83f936c75e
4 changed files with 11 additions and 41 deletions
|
|
@ -414,9 +414,7 @@ EXPORT_SYMBOL_GPL(mnt_clone_write);
|
|||
*/
|
||||
int __mnt_want_write_file(struct file *file)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
|
||||
if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode))
|
||||
if (!(file->f_mode & FMODE_WRITER))
|
||||
return __mnt_want_write(file->f_path.mnt);
|
||||
else
|
||||
return mnt_clone_write(file->f_path.mnt);
|
||||
|
|
|
|||
Loading…
Reference in a new issue