NFS: Replace vfsmount and dentry in nfs_open_context with struct path
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
@@ -462,8 +462,8 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str
|
||||
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
|
||||
if (ctx != NULL) {
|
||||
atomic_set(&ctx->count, 1);
|
||||
ctx->dentry = dget(dentry);
|
||||
ctx->vfsmnt = mntget(mnt);
|
||||
ctx->path.dentry = dget(dentry);
|
||||
ctx->path.mnt = mntget(mnt);
|
||||
ctx->cred = get_rpccred(cred);
|
||||
ctx->state = NULL;
|
||||
ctx->lockowner = current->files;
|
||||
@@ -484,7 +484,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx)
|
||||
{
|
||||
if (atomic_dec_and_test(&ctx->count)) {
|
||||
if (!list_empty(&ctx->list)) {
|
||||
struct inode *inode = ctx->dentry->d_inode;
|
||||
struct inode *inode = ctx->path.dentry->d_inode;
|
||||
spin_lock(&inode->i_lock);
|
||||
list_del(&ctx->list);
|
||||
spin_unlock(&inode->i_lock);
|
||||
@@ -493,8 +493,8 @@ void put_nfs_open_context(struct nfs_open_context *ctx)
|
||||
nfs4_close_state(ctx->state, ctx->mode);
|
||||
if (ctx->cred != NULL)
|
||||
put_rpccred(ctx->cred);
|
||||
dput(ctx->dentry);
|
||||
mntput(ctx->vfsmnt);
|
||||
dput(ctx->path.dentry);
|
||||
mntput(ctx->path.mnt);
|
||||
kfree(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user