diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-09-23 17:38:08 +0200 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-12-03 05:37:45 +0100 |
commit | 4d796d751cefdb942a54c570bd3087d8be3bb893 (patch) | |
tree | 52d97c2b7a3a6d8d3b67cdec678fd11c56ef5db9 /fs/nfs/nfs4proc.c | |
parent | NFSv4: Add a generic structure for managing layout-private information (diff) | |
download | linux-4d796d751cefdb942a54c570bd3087d8be3bb893.tar.xz linux-4d796d751cefdb942a54c570bd3087d8be3bb893.zip |
pNFS: Allow layout drivers to manage private data in struct nfs4_layoutreturn
Cleanup to allow layout drivers to attach private data to layoutreturn,
and manage the data.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1c629f5e1ae5..f992281c9b29 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3039,6 +3039,7 @@ struct nfs4_closedata { struct { struct nfs4_layoutreturn_args arg; struct nfs4_layoutreturn_res res; + struct nfs4_xdr_opaque_data ld_private; u32 roc_barrier; bool roc; } lr; @@ -3267,6 +3268,7 @@ int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait) if (IS_ERR(calldata->arg.seqid)) goto out_free_calldata; calldata->arg.fmode = 0; + calldata->lr.arg.ld_private = &calldata->lr.ld_private; calldata->res.fattr = &calldata->fattr; calldata->res.seqid = calldata->arg.seqid; calldata->res.server = server; @@ -5599,6 +5601,7 @@ struct nfs4_delegreturndata { struct { struct nfs4_layoutreturn_args arg; struct nfs4_layoutreturn_res res; + struct nfs4_xdr_opaque_data ld_private; u32 roc_barrier; bool roc; } lr; @@ -5735,6 +5738,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co data->res.fattr = &data->fattr; data->res.server = server; data->res.lr_ret = -NFS4ERR_NOMATCHING_LAYOUT; + data->lr.arg.ld_private = &data->lr.ld_private; nfs_fattr_init(data->res.fattr); data->timestamp = jiffies; data->rpc_status = 0; @@ -8633,6 +8637,8 @@ static void nfs4_layoutreturn_release(void *calldata) nfs4_sequence_free_slot(&lrp->res.seq_res); pnfs_put_layout_hdr(lrp->args.layout); nfs_iput_and_deactive(lrp->inode); + if (lrp->ld_private.ops && lrp->ld_private.ops->free) + lrp->ld_private.ops->free(&lrp->ld_private); kfree(calldata); dprintk("<-- %s\n", __func__); } |