nfs: path_{get,put}() cleanups
authorJan Blunck <jblunck@suse.de>
Fri, 2 May 2008 20:42:45 +0000 (13:42 -0700)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 16 May 2008 16:43:30 +0000 (09:43 -0700)
Here are some more places where path_{get,put}() can be used instead of
dput()/mntput() pair.

Signed-off-by: Jan Blunck <jblunck@suse.de>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/inode.c
fs/nfs/namespace.c
fs/nfs/nfs4proc.c

index 421d338c698cffdbc2ab67faad958ef112240a6c..596c5d8e86f4783f78699ae685911958699162d5 100644 (file)
@@ -541,8 +541,7 @@ static void __put_nfs_open_context(struct nfs_open_context *ctx, int wait)
        }
        if (ctx->cred != NULL)
                put_rpccred(ctx->cred);
-       dput(ctx->path.dentry);
-       mntput(ctx->path.mnt);
+       path_put(&ctx->path);
        kfree(ctx);
 }
 
index fca518006a52f57bbedb4337f298aa94396fb0f8..2f285ef76399f227283146fc15d05a30508f6dbd 100644 (file)
@@ -137,8 +137,7 @@ static void * nfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
                        goto out_follow;
                goto out_err;
        }
-       mntput(nd->path.mnt);
-       dput(nd->path.dentry);
+       path_put(&nd->path);
        nd->path.mnt = mnt;
        nd->path.dentry = dget(mnt->mnt_root);
        schedule_delayed_work(&nfs_automount_task, nfs_mountpoint_expiry_timeout);
index f533318b005fcc6588b21e64c2e93ed71970fc3f..1293e0acd82b7ab80604a9077277f0f4f97c333d 100644 (file)
@@ -306,8 +306,7 @@ static void nfs4_opendata_free(struct kref *kref)
                nfs4_put_open_state(p->state);
        nfs4_put_state_owner(p->owner);
        dput(p->dir);
-       dput(p->path.dentry);
-       mntput(p->path.mnt);
+       path_put(&p->path);
        kfree(p);
 }
 
@@ -1210,8 +1209,7 @@ static void nfs4_free_closedata(void *data)
        nfs4_put_open_state(calldata->state);
        nfs_free_seqid(calldata->arg.seqid);
        nfs4_put_state_owner(sp);
-       dput(calldata->path.dentry);
-       mntput(calldata->path.mnt);
+       path_put(&calldata->path);
        kfree(calldata);
 }