From patchwork Thu Sep 13 23:34:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 1454651 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 084F04025E for ; Thu, 13 Sep 2012 23:35:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758971Ab2IMXfK (ORCPT ); Thu, 13 Sep 2012 19:35:10 -0400 Received: from natasha.panasas.com ([67.152.220.90]:36013 "EHLO natasha.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756032Ab2IMXfJ (ORCPT ); Thu, 13 Sep 2012 19:35:09 -0400 Received: from zenyatta.panasas.com (zenyatta.int.panasas.com [172.17.28.63]) by natasha.panasas.com (8.13.1/8.13.1) with ESMTP id q8DNZ83I012562; Thu, 13 Sep 2012 19:35:08 -0400 Received: from localhost (172.17.142.245) by zenyatta.int.panasas.com (172.17.28.63) with Microsoft SMTP Server (TLS) id 14.1.355.2; Thu, 13 Sep 2012 19:34:27 -0400 From: Boaz Harrosh To: Benny Halevy , NFS list , open-osd Subject: [PATCH 03/10] SQUASHME: pnfsd: Pass less arguments to init_layout() Date: Fri, 14 Sep 2012 02:34:57 +0300 Message-ID: <1347579297-21513-1-git-send-email-bharrosh@panasas.com> X-Mailer: git-send-email 1.7.10.2.677.gb6bc67f In-Reply-To: <50526B39.3000802@panasas.com> References: <50526B39.3000802@panasas.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Instead of passing all parameters individually, of which one was unused. Pass the structures these originate from. Signed-off-by: Boaz Harrosh --- fs/nfsd/nfs4pnfsd.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c index 509b260..f0e193a 100644 --- a/fs/nfsd/nfs4pnfsd.c +++ b/fs/nfsd/nfs4pnfsd.c @@ -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);