diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-20 15:28:46 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-29 13:24:18 -0400 |
commit | b5bcdda32736b94a7d178d156d80a69f536ad468 (patch) | |
tree | c42d7265bb18d691d80edaf27b3f97bad46fb1f7 /fs | |
parent | 5c33b183a36500a5b0a3c53c11c431f0fec6efc8 (diff) |
take grabbing f->f_path to do_dentry_open()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/open.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -654,6 +654,7 @@ static int do_dentry_open(struct file *f, | |||
654 | if (unlikely(f->f_flags & O_PATH)) | 654 | if (unlikely(f->f_flags & O_PATH)) |
655 | f->f_mode = FMODE_PATH; | 655 | f->f_mode = FMODE_PATH; |
656 | 656 | ||
657 | path_get(&f->f_path); | ||
657 | inode = f->f_path.dentry->d_inode; | 658 | inode = f->f_path.dentry->d_inode; |
658 | if (f->f_mode & FMODE_WRITE) { | 659 | if (f->f_mode & FMODE_WRITE) { |
659 | error = __get_file_write_access(inode, f->f_path.mnt); | 660 | error = __get_file_write_access(inode, f->f_path.mnt); |
@@ -739,9 +740,7 @@ int finish_open(struct file *file, struct dentry *dentry, | |||
739 | int error; | 740 | int error; |
740 | BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ | 741 | BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ |
741 | 742 | ||
742 | mntget(file->f_path.mnt); | 743 | file->f_path.dentry = dentry; |
743 | file->f_path.dentry = dget(dentry); | ||
744 | |||
745 | error = do_dentry_open(file, open, current_cred()); | 744 | error = do_dentry_open(file, open, current_cred()); |
746 | if (!error) | 745 | if (!error) |
747 | *opened |= FILE_OPENED; | 746 | *opened |= FILE_OPENED; |
@@ -784,7 +783,6 @@ struct file *dentry_open(const struct path *path, int flags, | |||
784 | 783 | ||
785 | f->f_flags = flags; | 784 | f->f_flags = flags; |
786 | f->f_path = *path; | 785 | f->f_path = *path; |
787 | path_get(&f->f_path); | ||
788 | error = do_dentry_open(f, NULL, cred); | 786 | error = do_dentry_open(f, NULL, cred); |
789 | if (!error) { | 787 | if (!error) { |
790 | error = open_check_o_direct(f); | 788 | error = open_check_o_direct(f); |