Skip to content

Commit

Permalink
nfs: path_{get,put}() cleanups
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jan Blunck authored and Trond Myklebust committed May 16, 2008
1 parent 3110ff8 commit 31f31db
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 1 addition & 2 deletions fs/nfs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 31f31db

Please sign in to comment.