Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3565834pxb; Mon, 16 Nov 2020 19:27:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGXh7GmPhx/vSnMw2XeuEubeUmAtHYHW0hvJ3urNl9kisWgIp/TQ3h/0NEkOvPdMe9RMto X-Received: by 2002:a17:906:4dc2:: with SMTP id f2mr17225408ejw.446.1605583639143; Mon, 16 Nov 2020 19:27:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605583639; cv=none; d=google.com; s=arc-20160816; b=GAp6rx9cPhg9pucwYUtHYcGS86C/fKIlZFRbcwUqEPMoC2MzfO44Zn3s5fDCp4daSd 02j1oR94FPkXfJFqLB7UcAPLQoiplXDqEESWuw3KpYi/9HwkZDISNwwk7LtDV/mRzvHJ DoqY6kdlugcXMoiWn9PwQAFtcCjXLMwyj+kvS/NwiSVeCexEPmhD/GxEZ3RQEOz0uRK6 2jEzMC/I8RThRjQM56pBJvrKobOX2EgJX6TcnVQX8n9myHfbvn4ArrvT8ifEB2GXSQkU FeFg7ut5hGCDaXTGvbw9fiTmbIKkxgd9Q5DLzTVSaNbSi25Ea/tI1qeJbowVp4KVw4b3 GuRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-filter; bh=Z1Pzv2xSuAjKA6ZghhHwaC+WfBuYjOmPja6Fys/yKpQ=; b=jsfoutTrWgM2RkyyQQ2N019HDFEPd7jk+5BIwzjVCUjUYpNlQQHRO1/cItN5Gaerjx 0fJDhwX00hoJ+ZlI9bunzouZlSrsj0LeW0z91aBA1W26BM77qNM3rHYmjDUMLjE9rQkN zHzSgKXWAgszLIhbM3LxLrBF5l1sIqgKh2u98vKMhwClCnCBL5BV8R/pQl+sqapdoB/H YBj9hOQBhhuBcqy5t68UrwxPZMgi5etmEyzcZ0m8yY3SGmXqg4cfCCyrwidcO53uzzbp om0U0QXU6WcV+ZiF2lbfakZ5xsLikDXjJllXDsg7G9xs+KgtNXZEXh0bgNxIZXzTn4nC aaRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u7si12483620ejo.361.2020.11.16.19.26.56; Mon, 16 Nov 2020 19:27:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbgKQDSJ (ORCPT + 99 others); Mon, 16 Nov 2020 22:18:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgKQDSJ (ORCPT ); Mon, 16 Nov 2020 22:18:09 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07E35C0613CF for ; Mon, 16 Nov 2020 19:18:09 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 911401C21; Mon, 16 Nov 2020 22:18:08 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 911401C21 From: "J. Bruce Fields" To: Jeff Layton Cc: Daire Byrne , Trond Myklebust , linux-cachefs , linux-nfs , "J. Bruce Fields" Subject: [PATCH 1/4] nfsd: move fill_{pre,post}_wcc to nfsfh.c Date: Mon, 16 Nov 2020 22:18:03 -0500 Message-Id: <1605583086-19869-1-git-send-email-bfields@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20201117031601.GB10526@fieldses.org> References: <20201117031601.GB10526@fieldses.org> Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: "J. Bruce Fields" These functions are actually used by NFSv4 code as well, and having them in nfs3xdr.c has caused some confusion. This is just cleanup, no change in behavior. Signed-off-by: J. Bruce Fields --- fs/nfsd/nfs3xdr.c | 49 ----------------------------------------------- fs/nfsd/nfsfh.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 2277f83da250..14efb3aba6b2 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c @@ -252,55 +252,6 @@ encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp) return encode_post_op_attr(rqstp, p, fhp); } -/* - * Fill in the pre_op attr for the wcc data - */ -void fill_pre_wcc(struct svc_fh *fhp) -{ - struct inode *inode; - struct kstat stat; - __be32 err; - - if (fhp->fh_pre_saved) - return; - - inode = d_inode(fhp->fh_dentry); - err = fh_getattr(fhp, &stat); - if (err) { - /* Grab the times from inode anyway */ - stat.mtime = inode->i_mtime; - stat.ctime = inode->i_ctime; - stat.size = inode->i_size; - } - - fhp->fh_pre_mtime = stat.mtime; - fhp->fh_pre_ctime = stat.ctime; - fhp->fh_pre_size = stat.size; - fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode); - fhp->fh_pre_saved = true; -} - -/* - * Fill in the post_op attr for the wcc data - */ -void fill_post_wcc(struct svc_fh *fhp) -{ - __be32 err; - - if (fhp->fh_post_saved) - printk("nfsd: inode locked twice during operation.\n"); - - err = fh_getattr(fhp, &fhp->fh_post_attr); - fhp->fh_post_change = nfsd4_change_attribute(&fhp->fh_post_attr, - d_inode(fhp->fh_dentry)); - if (err) { - fhp->fh_post_saved = false; - /* Grab the ctime anyway - set_change_info might use it */ - fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime; - } else - fhp->fh_post_saved = true; -} - /* * XDR decode functions */ diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index c81dbbad8792..b3b4e8809aa9 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -711,3 +711,52 @@ enum fsid_source fsid_source(struct svc_fh *fhp) return FSIDSOURCE_UUID; return FSIDSOURCE_DEV; } + +/* + * Fill in the pre_op attr for the wcc data + */ +void fill_pre_wcc(struct svc_fh *fhp) +{ + struct inode *inode; + struct kstat stat; + __be32 err; + + if (fhp->fh_pre_saved) + return; + + inode = d_inode(fhp->fh_dentry); + err = fh_getattr(fhp, &stat); + if (err) { + /* Grab the times from inode anyway */ + stat.mtime = inode->i_mtime; + stat.ctime = inode->i_ctime; + stat.size = inode->i_size; + } + + fhp->fh_pre_mtime = stat.mtime; + fhp->fh_pre_ctime = stat.ctime; + fhp->fh_pre_size = stat.size; + fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode); + fhp->fh_pre_saved = true; +} + +/* + * Fill in the post_op attr for the wcc data + */ +void fill_post_wcc(struct svc_fh *fhp) +{ + __be32 err; + + if (fhp->fh_post_saved) + printk("nfsd: inode locked twice during operation.\n"); + + err = fh_getattr(fhp, &fhp->fh_post_attr); + fhp->fh_post_change = nfsd4_change_attribute(&fhp->fh_post_attr, + d_inode(fhp->fh_dentry)); + if (err) { + fhp->fh_post_saved = false; + /* Grab the ctime anyway - set_change_info might use it */ + fhp->fh_post_attr.ctime = d_inode(fhp->fh_dentry)->i_ctime; + } else + fhp->fh_post_saved = true; +} -- 2.28.0