aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 05:55:37 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:37 -0400
commita4a3bdd778715999ddfeefdc52ab76254580fa76 (patch)
treecd154e1bbcf2d899c30309fa179e5fc5de968d58
parentd95852777bc8ba6b3ad3397d495c5f9dd8ca8383 (diff)
kill opendata->{mnt,dentry}
->filp->f_path is there for purpose... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/internal.h2
-rw-r--r--fs/namei.c15
-rw-r--r--fs/open.c6
3 files changed, 9 insertions, 14 deletions
diff --git a/fs/internal.h b/fs/internal.h
index ae69a3b150d7..09003a02292d 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -83,8 +83,6 @@ extern struct super_block *user_get_super(dev_t);
83 * open.c 83 * open.c
84 */ 84 */
85struct opendata { 85struct opendata {
86 struct dentry *dentry;
87 struct vfsmount *mnt;
88 struct file *filp; 86 struct file *filp;
89}; 87};
90struct open_flags { 88struct open_flags {
diff --git a/fs/namei.c b/fs/namei.c
index f0dae0057ec9..af83ede92a4f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2269,14 +2269,11 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
2269 if (nd->flags & LOOKUP_DIRECTORY) 2269 if (nd->flags & LOOKUP_DIRECTORY)
2270 open_flag |= O_DIRECTORY; 2270 open_flag |= O_DIRECTORY;
2271 2271
2272 od->dentry = DENTRY_NOT_SET; 2272 od->filp->f_path.dentry = DENTRY_NOT_SET;
2273 od->mnt = nd->path.mnt; 2273 od->filp->f_path.mnt = nd->path.mnt;
2274 error = dir->i_op->atomic_open(dir, dentry, od, open_flag, mode, 2274 error = dir->i_op->atomic_open(dir, dentry, od, open_flag, mode,
2275 opened); 2275 opened);
2276 if (error < 0) { 2276 if (error < 0) {
2277 if (WARN_ON(od->dentry != DENTRY_NOT_SET))
2278 dput(od->dentry);
2279
2280 if (create_error && error == -ENOENT) 2277 if (create_error && error == -ENOENT)
2281 error = create_error; 2278 error = create_error;
2282 filp = ERR_PTR(error); 2279 filp = ERR_PTR(error);
@@ -2290,13 +2287,13 @@ static struct file *atomic_open(struct nameidata *nd, struct dentry *dentry,
2290 } 2287 }
2291 2288
2292 if (error) { /* returned 1, that is */ 2289 if (error) { /* returned 1, that is */
2293 if (WARN_ON(od->dentry == DENTRY_NOT_SET)) { 2290 if (WARN_ON(od->filp->f_path.dentry == DENTRY_NOT_SET)) {
2294 filp = ERR_PTR(-EIO); 2291 filp = ERR_PTR(-EIO);
2295 goto out; 2292 goto out;
2296 } 2293 }
2297 if (od->dentry) { 2294 if (od->filp->f_path.dentry) {
2298 dput(dentry); 2295 dput(dentry);
2299 dentry = od->dentry; 2296 dentry = od->filp->f_path.dentry;
2300 } 2297 }
2301 goto looked_up; 2298 goto looked_up;
2302 } 2299 }
@@ -2607,7 +2604,7 @@ finish_open_created:
2607 error = may_open(&nd->path, acc_mode, open_flag); 2604 error = may_open(&nd->path, acc_mode, open_flag);
2608 if (error) 2605 if (error)
2609 goto exit; 2606 goto exit;
2610 od->mnt = nd->path.mnt; 2607 od->filp->f_path.mnt = nd->path.mnt;
2611 filp = finish_open(od, nd->path.dentry, NULL, opened); 2608 filp = finish_open(od, nd->path.dentry, NULL, opened);
2612 if (IS_ERR(filp)) { 2609 if (IS_ERR(filp)) {
2613 if (filp == ERR_PTR(-EOPENSTALE)) 2610 if (filp == ERR_PTR(-EOPENSTALE))
diff --git a/fs/open.c b/fs/open.c
index c87f98201c29..2b1654d8bfbd 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -788,10 +788,10 @@ struct file *finish_open(struct opendata *od, struct dentry *dentry,
788 struct file *res; 788 struct file *res;
789 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */ 789 BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
790 790
791 mntget(od->mnt); 791 mntget(od->filp->f_path.mnt);
792 dget(dentry); 792 dget(dentry);
793 793
794 res = do_dentry_open(dentry, od->mnt, od->filp, open, current_cred()); 794 res = do_dentry_open(dentry, od->filp->f_path.mnt, od->filp, open, current_cred());
795 if (!IS_ERR(res)) 795 if (!IS_ERR(res))
796 *opened |= FILE_OPENED; 796 *opened |= FILE_OPENED;
797 797
@@ -810,7 +810,7 @@ EXPORT_SYMBOL(finish_open);
810 */ 810 */
811void finish_no_open(struct opendata *od, struct dentry *dentry) 811void finish_no_open(struct opendata *od, struct dentry *dentry)
812{ 812{
813 od->dentry = dentry; 813 od->filp->f_path.dentry = dentry;
814} 814}
815EXPORT_SYMBOL(finish_no_open); 815EXPORT_SYMBOL(finish_no_open);
816 816