From patchwork Wed Aug 5 21:13:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 6953121 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F631C05AC for ; Wed, 5 Aug 2015 21:14:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6117420443 for ; Wed, 5 Aug 2015 21:13:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67923205D8 for ; Wed, 5 Aug 2015 21:13:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752763AbbHEVNz (ORCPT ); Wed, 5 Aug 2015 17:13:55 -0400 Received: from mail-yk0-f169.google.com ([209.85.160.169]:33941 "EHLO mail-yk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495AbbHEVNy (ORCPT ); Wed, 5 Aug 2015 17:13:54 -0400 Received: by ykax123 with SMTP id x123so46813090yka.1 for ; Wed, 05 Aug 2015 14:13:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HcIAYICx9INATiRdJLslFReZ+jDQowNlP8OCgfzF31g=; b=W4NzXVOAfq7sTAdyxMP/Gj5Nhj8/HpdJT1lS7aLAMB7X5GdejCsNzRqUQENk+dzI9H mSPWVqwgHp4xhGpfYw7QaySuEH2vdBOivH7a412P6HE8LASPh/okPt/gUh8scVh8OeVv 6mBlFgQXuXCLaqaGM1SShM/Do6orU1cUFiB3mTLR/KCDXlsXitUP49ZJyZchtoA6WR4e J1d8HqlHk8OgUvLy/aP8QR7xuBfy49H3fPKfvS1AkFIJ6Ig502uqqweAn0bkO4hZijLb uJuJD4mIWI8Qew8YH6Ys3hVoZy9nivAwucOGOxNJ+rI9JYPJlPAScr0ByMSmtCNQAk5X UKbw== X-Gm-Message-State: ALoCoQlr2CgoOM682NviBqKCW/6C1RC8GXu+gmLOwl1C/PrV38sREf7kohtmuCjyObFphk1cKOi1 X-Received: by 10.129.57.193 with SMTP id g184mr10996851ywa.45.1438809233463; Wed, 05 Aug 2015 14:13:53 -0700 (PDT) Received: from tlielax.poochiereds.net (cpe-45-37-211-243.nc.res.rr.com. [45.37.211.243]) by smtp.googlemail.com with ESMTPSA id p81sm3975306ywe.19.2015.08.05.14.13.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 14:13:53 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 14/18] nfsd: have _fh_update take a knfsd_fh instead of a svc_fh Date: Wed, 5 Aug 2015 17:13:32 -0400 Message-Id: <1438809216-4846-15-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1438809216-4846-1-git-send-email-jeff.layton@primarydata.com> References: <1438264341-18048-1-git-send-email-jeff.layton@primarydata.com> <1438809216-4846-1-git-send-email-jeff.layton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This also mandates that we pass in the fh_maxsize parm as a separate value. Signed-off-by: Jeff Layton Reviewed-by: Christoph Hellwig --- fs/nfsd/nfsfh.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 350041a40fe5..a945500db17c 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -388,20 +388,20 @@ out: * an inode. In this case a call to fh_update should be made * before the fh goes out on the wire ... */ -static void _fh_update(struct svc_fh *fhp, struct svc_export *exp, - struct dentry *dentry) +static void _fh_update(struct knfsd_fh *kfh, int fh_maxsize, + struct svc_export *exp, struct dentry *dentry) { if (dentry != exp->ex_path.dentry) { - struct fid *fid = (struct fid *) - (fhp->fh_handle.fh_fsid + fhp->fh_handle.fh_size/4 - 1); - int maxsize = (fhp->fh_maxsize - fhp->fh_handle.fh_size)/4; + struct fid *fid = + (struct fid *)(kfh->fh_fsid + kfh->fh_size/4 - 1); + int maxsize = (fh_maxsize - kfh->fh_size)/4; int subtreecheck = !(exp->ex_flags & NFSEXP_NOSUBTREECHECK); - fhp->fh_handle.fh_fileid_type = + kfh->fh_fileid_type = exportfs_encode_fh(dentry, fid, &maxsize, subtreecheck); - fhp->fh_handle.fh_size += maxsize * 4; + kfh->fh_size += maxsize * 4; } else { - fhp->fh_handle.fh_fileid_type = FILEID_ROOT; + kfh->fh_fileid_type = FILEID_ROOT; } } @@ -574,7 +574,8 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, exp->ex_fsid, exp->ex_uuid); if (inode) - _fh_update(fhp, exp, dentry); + _fh_update(&fhp->fh_handle, fhp->fh_maxsize, + exp, dentry); if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) { fh_put(fhp); return nfserr_opnotsupp; @@ -605,7 +606,8 @@ fh_update(struct svc_fh *fhp) if (fhp->fh_handle.fh_fileid_type != FILEID_ROOT) return 0; - _fh_update(fhp, fhp->fh_export, dentry); + _fh_update(&fhp->fh_handle, fhp->fh_maxsize, + fhp->fh_export, dentry); if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) return nfserr_opnotsupp; }