Message ID | 20230705190309.579783-56-jlayton@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2090614vqx; Wed, 5 Jul 2023 12:30:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlGCZZYsgkUb/r3IlPH8z7UmOpUJhs0QL7/Yay51azZQRLqZxNAJuutWEhR5NPFonglGVgLY X-Received: by 2002:a17:902:b714:b0:1b7:fd82:973c with SMTP id d20-20020a170902b71400b001b7fd82973cmr15956788pls.39.1688585421827; Wed, 05 Jul 2023 12:30:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688585421; cv=none; d=google.com; s=arc-20160816; b=UlbjSCg0XSskZl6X2YNHSWFibpoZBVhPe9NvF0SaS/dPJqBkMMd7NYJRKJwby/k3PK mDLng4icDGPeRe1Iexnc11c6P9J0ze39EJmsF2nZv9MVDCGrvvayUaLbPXH2U/azcM0z YOxqlSprUlAj4CR42WZxz6s//U6tRQDbuq7suB8Hr/VkrF0Z0cvLjWPuvA90SIIkRr6N CSgxvQUvR/JXyfuT8tFghDv8rijzU6DKmoIaPRYejUutDDTYW+fPBPDjQ4KIA/h7fOkf d3e5ZEJZ8mhsFLyQPAnO8H8Q9ea8AQSndRhRCMiud3ROXC03YP74mz6AVtwTaBItNnry ulpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nTdTaIbmvSh8SsRtk1XTCyYftNObtDUPIRBPgePnYDE=; fh=RRVy51jN+A1SuyAuypdIEAgta+T/OkWqV5o26C13jt8=; b=G6pAoOKXffYgzzxAdxH773rqvw5YGpizb3EVLwhoLHVH/uRrEGo68XflO1kdFBtEkI NV3zNjIXKWLOLLP1CYRUsykXK9cbTgL6yuO5PGeYw0xHf3WQT1Hry9O4TV4BWo8JrQzy qQiNz6aZllC0jF6PuSNdUoJS2jbwpN1ZONMipo37/n3s43bJFLMIsDLCjW8MInHJ5W1g pBvkgt8b1hv0k1vS224WG1HPWHLQ/9+IoRwrlyDilpUBiJvvMNq23AgQzcKe9hAgK7h7 NHGwdHeNrchy6j6gRsjpJwy+9cObhylKNG2p6CWSbGL23PtDB0PQ4MPv0MBwookae4xD IhcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kan5Cvx9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902dad100b001b873d057afsi12845614plx.596.2023.07.05.12.30.06; Wed, 05 Jul 2023 12:30:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kan5Cvx9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234001AbjGETJ0 (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 15:09:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233964AbjGETIK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 15:08:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7323F30E9; Wed, 5 Jul 2023 12:04:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 504B7616C4; Wed, 5 Jul 2023 19:04:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B789BC433C9; Wed, 5 Jul 2023 19:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583888; bh=nz4OgBYlsMOKdpSoA1HyBKv/O9jg4R14AE4cRb0Uh3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kan5Cvx9lHLoy6XyRcibzCs0nKOnNBUGlFOzV8oieR+t/dvFwzCsGh20hoDsdk4uG 5nj1fIEwdvRV/XExVDTHN+tgIYw5xjbi3FNdnAXTzAidMKBG5gb3ZSOlqcAG5ynWW8 6DsZ2QUSoqTrENweGMCX5O6lnAQ3s7MO2oIJbJzXHMDzQe8P9H/NWaX8AFUX0dL7Im vLaSjakV661euyKtWFPx4JWUfFKDcykpk30buOIZmPKjnjPC8FfxMbx4EZm0RdgEM/ xVkXZS9LEUeNTNDr/tEOQSa0Rehaw3Yci6yxUulcbc52vKrvjp9JKzVxpRc7+knZd1 jidF2E09cGkYw== From: Jeff Layton <jlayton@kernel.org> To: Christian Brauner <brauner@kernel.org>, Chuck Lever <chuck.lever@oracle.com>, Neil Brown <neilb@suse.de>, Olga Kornievskaia <kolga@netapp.com>, Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com> Cc: Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH v2 58/92] nfsd: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:23 -0400 Message-ID: <20230705190309.579783-56-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705190309.579783-1-jlayton@kernel.org> References: <20230705185755.579053-1-jlayton@kernel.org> <20230705190309.579783-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770610147035846669?= X-GMAIL-MSGID: =?utf-8?q?1770610147035846669?= |
Series |
[v2,01/92] ibmvmc: update ctime in conjunction with mtime on write
|
|
Commit Message
Jeff Layton
July 5, 2023, 7:01 p.m. UTC
In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Acked-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@kernel.org> --- fs/nfsd/nfsctl.c | 2 +- fs/nfsd/vfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Wed 05-07-23 15:01:23, Jeff Layton wrote: > In later patches, we're going to change how the inode's ctime field is > used. Switch to using accessor functions instead of raw accesses of > inode->i_ctime. > > Acked-by: Chuck Lever <chuck.lever@oracle.com> > Signed-off-by: Jeff Layton <jlayton@kernel.org> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > --- > fs/nfsd/nfsctl.c | 2 +- > fs/nfsd/vfs.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c > index 1b8b1aab9a15..a53c5660a8c4 100644 > --- a/fs/nfsd/nfsctl.c > +++ b/fs/nfsd/nfsctl.c > @@ -1131,7 +1131,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode) > /* Following advice from simple_fill_super documentation: */ > inode->i_ino = iunique(sb, NFSD_MaxReserved); > inode->i_mode = mode; > - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); > + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); > switch (mode & S_IFMT) { > case S_IFDIR: > inode->i_fop = &simple_dir_operations; > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c > index 8a2321d19194..40a68bae88fc 100644 > --- a/fs/nfsd/vfs.c > +++ b/fs/nfsd/vfs.c > @@ -520,7 +520,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, > > nfsd_sanitize_attrs(inode, iap); > > - if (check_guard && guardtime != inode->i_ctime.tv_sec) > + if (check_guard && guardtime != inode_get_ctime(inode).tv_sec) > return nfserr_notsync; > > /* > -- > 2.41.0 >
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 1b8b1aab9a15..a53c5660a8c4 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1131,7 +1131,7 @@ static struct inode *nfsd_get_inode(struct super_block *sb, umode_t mode) /* Following advice from simple_fill_super documentation: */ inode->i_ino = iunique(sb, NFSD_MaxReserved); inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_fop = &simple_dir_operations; diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 8a2321d19194..40a68bae88fc 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -520,7 +520,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, nfsd_sanitize_attrs(inode, iap); - if (check_guard && guardtime != inode->i_ctime.tv_sec) + if (check_guard && guardtime != inode_get_ctime(inode).tv_sec) return nfserr_notsync; /*