diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-06-15 11:59:10 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-12 13:40:29 -0400 |
commit | a56aaa02b1f723e28b41d339ddff02e958d32d43 (patch) | |
tree | 3e24ad69ceb5ee66e53baec133ef7bb950795c54 | |
parent | aa5c01446610f0305f96251d0f9621866b8e5a14 (diff) |
NFSv4.1: Clean up layoutreturn
Since we take a reference to it, we really ought to pass the a pointer to
the layout header in the arguments instead of assuming that
NFS_I(inode)->layout will forever point to the correct object.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 1 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 325706f73eea..93ef77666efc 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5770,7 +5770,7 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata) | |||
5770 | { | 5770 | { |
5771 | struct nfs4_layoutreturn *lrp = calldata; | 5771 | struct nfs4_layoutreturn *lrp = calldata; |
5772 | struct nfs_server *server; | 5772 | struct nfs_server *server; |
5773 | struct pnfs_layout_hdr *lo = NFS_I(lrp->args.inode)->layout; | 5773 | struct pnfs_layout_hdr *lo = lrp->args.layout; |
5774 | 5774 | ||
5775 | dprintk("--> %s\n", __func__); | 5775 | dprintk("--> %s\n", __func__); |
5776 | 5776 | ||
@@ -5799,7 +5799,7 @@ static void nfs4_layoutreturn_release(void *calldata) | |||
5799 | struct nfs4_layoutreturn *lrp = calldata; | 5799 | struct nfs4_layoutreturn *lrp = calldata; |
5800 | 5800 | ||
5801 | dprintk("--> %s\n", __func__); | 5801 | dprintk("--> %s\n", __func__); |
5802 | put_layout_hdr(NFS_I(lrp->args.inode)->layout); | 5802 | put_layout_hdr(lrp->args.layout); |
5803 | kfree(calldata); | 5803 | kfree(calldata); |
5804 | dprintk("<-- %s\n", __func__); | 5804 | dprintk("<-- %s\n", __func__); |
5805 | } | 5805 | } |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index a7dc3367a857..5fc2e5d755a5 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -667,6 +667,7 @@ _pnfs_return_layout(struct inode *ino) | |||
667 | lrp->args.stateid = stateid; | 667 | lrp->args.stateid = stateid; |
668 | lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id; | 668 | lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id; |
669 | lrp->args.inode = ino; | 669 | lrp->args.inode = ino; |
670 | lrp->args.layout = lo; | ||
670 | lrp->clp = NFS_SERVER(ino)->nfs_client; | 671 | lrp->clp = NFS_SERVER(ino)->nfs_client; |
671 | 672 | ||
672 | status = nfs4_proc_layoutreturn(lrp); | 673 | status = nfs4_proc_layoutreturn(lrp); |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 209455561749..956d3576df7f 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -269,9 +269,10 @@ struct nfs4_layoutcommit_data { | |||
269 | }; | 269 | }; |
270 | 270 | ||
271 | struct nfs4_layoutreturn_args { | 271 | struct nfs4_layoutreturn_args { |
272 | __u32 layout_type; | 272 | struct pnfs_layout_hdr *layout; |
273 | struct inode *inode; | 273 | struct inode *inode; |
274 | nfs4_stateid stateid; | 274 | nfs4_stateid stateid; |
275 | __u32 layout_type; | ||
275 | struct nfs4_sequence_args seq_args; | 276 | struct nfs4_sequence_args seq_args; |
276 | }; | 277 | }; |
277 | 278 | ||