@@ -301,9 +301,8 @@ init_layout(struct nfs4_layout *lp,
struct nfs4_layout_state *ls,
struct nfs4_file *fp,
struct nfs4_client *clp,
- struct svc_fh *current_fh,
- struct nfsd4_layout_seg *seg,
- stateid_t *stateid)
+ struct nfsd4_pnfs_layoutget *lgp,
+ struct nfsd4_pnfs_layoutget_res *res)
{
dprintk("pNFS %s: lp %p ls %p clp %p fp %p ino %p\n", __func__,
lp, ls, clp, fp, fp->fi_inode);
@@ -311,10 +310,10 @@ init_layout(struct nfs4_layout *lp,
get_nfs4_file(fp);
lp->lo_client = clp;
lp->lo_file = fp;
- memcpy(&lp->lo_seg, seg, sizeof(lp->lo_seg));
+ memcpy(&lp->lo_seg, &res->lg_seg, sizeof(lp->lo_seg));
get_layout_state(ls); /* put on destroy_layout */
lp->lo_state = ls;
- update_layout_stateid(ls, stateid);
+ update_layout_stateid(ls, &lgp->lg_sid);
list_add_tail(&lp->lo_perclnt, &clp->cl_layouts);
list_add_tail(&lp->lo_perfile, &fp->fi_layouts);
dprintk("pNFS %s end\n", __func__);
@@ -829,7 +828,7 @@ nfs4_pnfs_get_layout(struct nfsd4_pnfs_layoutget *lgp,
goto out_freelayout;
/* Can't merge, so let's initialize this new layout */
- init_layout(lp, ls, fp, clp, lgp->lg_fhp, &res.lg_seg, &lgp->lg_sid);
+ init_layout(lp, ls, fp, clp, lgp, &res);
out_unlock:
if (ls)
put_layout_state(ls);
Instead of passing all parameters individually, of which one was unused. Pass the structures these originate from. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> --- fs/nfsd/nfs4pnfsd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)