From patchwork Wed Jun 21 14:45:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13287464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6DC87EB64D7 for ; Wed, 21 Jun 2023 14:52:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232816AbjFUOwD (ORCPT ); Wed, 21 Jun 2023 10:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232541AbjFUOvJ (ORCPT ); Wed, 21 Jun 2023 10:51:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87FD9297A; Wed, 21 Jun 2023 07:48:56 -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 3513C6157D; Wed, 21 Jun 2023 14:48:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF8D0C433C8; Wed, 21 Jun 2023 14:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358935; bh=yXfyQtQPyFnbI0/t7pxhgaeRi23yNtnNHB31Is0ROsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zikb5bQrZZ4adTjpZX6DNnbhDJetBS2mQuMZQRL0i61azi5O4Uw3AwN5SiZSNX+5e dx7jn2pngpzPhRHYvmnInXYrUh1JEyB6KpxtXJ03t2TvEPrfb8Kc8v0HdlzSG4A+FQ 7j6w/ygMjpJFHgBo95wK5ckr3MeyX8M6faRrIcYrpLnmwBIf8paFRSNyUJ6f9mFS9b Rr2NQDCXIozgEJBmFhZnhhZcUFU/3DNCu/aq1iVSs+LynqCYRYWTRBMdj/3alvkTj/ cW2T2wtNFMWf/vFQ0Cjvt1asr50P6/J7idF5gsZTgBy8zThmDFlfGFMDHuvykHHHJN yv37X8WeFyRCA== From: Jeff Layton To: Christian Brauner , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey Cc: Al Viro , Jan Kara , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 46/79] nfsd: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:59 -0400 Message-ID: <20230621144735.55953-45-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230621144735.55953-1-jlayton@kernel.org> References: <20230621144507.55591-1-jlayton@kernel.org> <20230621144735.55953-1-jlayton@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org In later patches, we're going to change how the ctime.tv_nsec field is utilized. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton Acked-by: Chuck Lever --- 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..bebb65d3ad6b 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_ctime_set_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 59b7d60ae33e..febdfdf16ec1 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_ctime_peek(inode).tv_sec) return nfserr_notsync; /*