Commit 63ec2b69 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Avoid unnecessary credential references in layoutget

Layoutget is just using the credential attached to the open context.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 61296507
...@@ -9177,7 +9177,7 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) ...@@ -9177,7 +9177,7 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout)
.rpc_message = &msg, .rpc_message = &msg,
.callback_ops = &nfs4_layoutget_call_ops, .callback_ops = &nfs4_layoutget_call_ops,
.callback_data = lgp, .callback_data = lgp,
.flags = RPC_TASK_ASYNC, .flags = RPC_TASK_ASYNC | RPC_TASK_CRED_NOREF,
}; };
struct pnfs_layout_segment *lseg = NULL; struct pnfs_layout_segment *lseg = NULL;
struct nfs4_exception exception = { struct nfs4_exception exception = {
......
...@@ -1073,7 +1073,7 @@ pnfs_alloc_init_layoutget_args(struct inode *ino, ...@@ -1073,7 +1073,7 @@ pnfs_alloc_init_layoutget_args(struct inode *ino,
lgp->args.ctx = get_nfs_open_context(ctx); lgp->args.ctx = get_nfs_open_context(ctx);
nfs4_stateid_copy(&lgp->args.stateid, stateid); nfs4_stateid_copy(&lgp->args.stateid, stateid);
lgp->gfp_flags = gfp_flags; lgp->gfp_flags = gfp_flags;
lgp->cred = get_cred(ctx->cred); lgp->cred = ctx->cred;
return lgp; return lgp;
} }
...@@ -1084,7 +1084,6 @@ void pnfs_layoutget_free(struct nfs4_layoutget *lgp) ...@@ -1084,7 +1084,6 @@ void pnfs_layoutget_free(struct nfs4_layoutget *lgp)
nfs4_free_pages(lgp->args.layout.pages, max_pages); nfs4_free_pages(lgp->args.layout.pages, max_pages);
if (lgp->args.inode) if (lgp->args.inode)
pnfs_put_layout_hdr(NFS_I(lgp->args.inode)->layout); pnfs_put_layout_hdr(NFS_I(lgp->args.inode)->layout);
put_cred(lgp->cred);
put_nfs_open_context(lgp->args.ctx); put_nfs_open_context(lgp->args.ctx);
kfree(lgp); kfree(lgp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment