mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
cache the value of file_inode() in struct file
Note that this thing does *not* contribute to inode refcount; it's pinned down by dentry. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
5e608671df
commit
dd37978c50
3 changed files with 6 additions and 2 deletions
|
|
@ -689,7 +689,7 @@ static int do_dentry_open(struct file *f,
|
|||
f->f_mode = FMODE_PATH;
|
||||
|
||||
path_get(&f->f_path);
|
||||
inode = file_inode(f);
|
||||
inode = f->f_inode = f->f_path.dentry->d_inode;
|
||||
if (f->f_mode & FMODE_WRITE) {
|
||||
error = __get_file_write_access(inode, f->f_path.mnt);
|
||||
if (error)
|
||||
|
|
@ -752,6 +752,7 @@ cleanup_file:
|
|||
path_put(&f->f_path);
|
||||
f->f_path.mnt = NULL;
|
||||
f->f_path.dentry = NULL;
|
||||
f->f_inode = NULL;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue