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>
This commit is contained in:
parent
aa5c014466
commit
a56aaa02b1
3 changed files with 5 additions and 3 deletions
|
@ -5770,7 +5770,7 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
|
||||||
{
|
{
|
||||||
struct nfs4_layoutreturn *lrp = calldata;
|
struct nfs4_layoutreturn *lrp = calldata;
|
||||||
struct nfs_server *server;
|
struct nfs_server *server;
|
||||||
struct pnfs_layout_hdr *lo = NFS_I(lrp->args.inode)->layout;
|
struct pnfs_layout_hdr *lo = lrp->args.layout;
|
||||||
|
|
||||||
dprintk("--> %s\n", __func__);
|
dprintk("--> %s\n", __func__);
|
||||||
|
|
||||||
|
@ -5799,7 +5799,7 @@ static void nfs4_layoutreturn_release(void *calldata)
|
||||||
struct nfs4_layoutreturn *lrp = calldata;
|
struct nfs4_layoutreturn *lrp = calldata;
|
||||||
|
|
||||||
dprintk("--> %s\n", __func__);
|
dprintk("--> %s\n", __func__);
|
||||||
put_layout_hdr(NFS_I(lrp->args.inode)->layout);
|
put_layout_hdr(lrp->args.layout);
|
||||||
kfree(calldata);
|
kfree(calldata);
|
||||||
dprintk("<-- %s\n", __func__);
|
dprintk("<-- %s\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
|
@ -667,6 +667,7 @@ _pnfs_return_layout(struct inode *ino)
|
||||||
lrp->args.stateid = stateid;
|
lrp->args.stateid = stateid;
|
||||||
lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id;
|
lrp->args.layout_type = NFS_SERVER(ino)->pnfs_curr_ld->id;
|
||||||
lrp->args.inode = ino;
|
lrp->args.inode = ino;
|
||||||
|
lrp->args.layout = lo;
|
||||||
lrp->clp = NFS_SERVER(ino)->nfs_client;
|
lrp->clp = NFS_SERVER(ino)->nfs_client;
|
||||||
|
|
||||||
status = nfs4_proc_layoutreturn(lrp);
|
status = nfs4_proc_layoutreturn(lrp);
|
||||||
|
|
|
@ -269,9 +269,10 @@ struct nfs4_layoutcommit_data {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nfs4_layoutreturn_args {
|
struct nfs4_layoutreturn_args {
|
||||||
__u32 layout_type;
|
struct pnfs_layout_hdr *layout;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
nfs4_stateid stateid;
|
nfs4_stateid stateid;
|
||||||
|
__u32 layout_type;
|
||||||
struct nfs4_sequence_args seq_args;
|
struct nfs4_sequence_args seq_args;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue