From patchwork Wed Jul 5 19:01:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 116380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2097579vqx; Wed, 5 Jul 2023 12:45:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlFNYOVHM3Hve5wOrRTiC16CvkWmAlyojK18k1Cf3cy76IKpABQHDo+ux2yyJ3uo9lN6FWqw X-Received: by 2002:a05:6a20:2595:b0:126:5ffd:c5b7 with SMTP id k21-20020a056a20259500b001265ffdc5b7mr112585pzd.22.1688586307154; Wed, 05 Jul 2023 12:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688586307; cv=none; d=google.com; s=arc-20160816; b=0E0N2b88js+H2Wi+IW6hA05sRymZ7XMOZOCtdJhHvuBfF+BU8NF/CNuCqq96bYTfdn IRqj4/y7ZjxdNdZ4I5RZygbO3silqe/f03QAdk0m1g52muvEoXS/9JZ4vcWNp6IR8pom i7i3wM1BJvr/5ZZpbSgjRPliVL+CyftiC8ZH8YUoeasAz5t8hInr7wgN4flS/CodamFU 0NdDl3Ygfui0LQcZn6wMYRv5P+Sslm/FDnOO8JHkb/NCD4lTOkYFrqfYALhPP2B48wW/ xEw2U6j3UTEhNMsyEtN81tW8CnpyOEKReSNKqoa1Scer1d9QMSvLKeqsg2s5fVP1eot/ /THQ== 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=iVH0ODKj9xrYjsqkKlQRc5cSls88JQbMRsmihy29JVs=; fh=Nb5M9mUNR71fvhOUuW8lXNObXvR+P8mbgKOmxFjIIdI=; b=LCVmAw57i1l/WtSgi8/+hZ5FmTgLk0RiKwV89ROOG+38Sq6bwdcz1TVHbwhLsM0ivf +4XUayaBWN1SuYOk/u2uadtD1yOWmMPQvWfJUxwoxPVT/kxxmylajusC6+6BmWGJAqKf rspKtR5bI78EaIyD2dbA6pSPsFkhmf/MHHJb/GG5NZ1JOJU679cM3wTFSF2HRCZ1EJBW cu2upURQW97OUhEy0IGe7pzEb1/Gm1B8poJirpCocAI3OeKcQXVwEYD4grEX+M/i8GRy tuDMsz6ZreB83rK8NWVi0H97bMgbKeiLsYBpgy/q8+LFWh2yJs0sx/z9EotXLG0tpYCz S8IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CXrkzL2s; 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 q9-20020a056a00150900b00682c1cd974asi671545pfu.379.2023.07.05.12.44.53; Wed, 05 Jul 2023 12:45:07 -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=CXrkzL2s; 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 S233847AbjGETK2 (ORCPT + 99 others); Wed, 5 Jul 2023 15:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233740AbjGETIm (ORCPT ); Wed, 5 Jul 2023 15:08:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F338819A2; Wed, 5 Jul 2023 12:05:38 -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 568E161702; Wed, 5 Jul 2023 19:05:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0063AC433C7; Wed, 5 Jul 2023 19:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583934; bh=3sp7OmcXVbe5zYzTxLB6I6YtUeT1soXk8Hp0RuH3SJI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXrkzL2spbbappNHiT8iNIbL27Oyus1z08ocp1va0NyNPq9oRvpQ1kcmrnZeJJVkI F1v3lmptBoZi+Vc1Z0Ka9bpXjSDJdH1cjnhi87SQoeY5txF4eqSPlZf6aedJPdA3YI 6pV7JPX0/E8KkUivWlWkhH+qlm/XNCJo3IQcO5VFLRxClc1upAmSDdpZa+Zs3iwFrQ 4tfC78X0lU4Fh7+ArU2+Smf3jXdwJgPhcKFnmJz/t8i9ASJXMabyfeV4vdVf2Da0d0 iUzyljBH7cYr+75eftkoVsj8LLe/26Mg6zn63dRkqLwloGqFSa7MycG/KQ4Zy8FVfa 95WGghGW5aAOA== From: Jeff Layton To: Christian Brauner , Damien Le Moal , Naohiro Aota , Johannes Thumshirn Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 83/92] zonefs: convert to ctime accessor functions Date: Wed, 5 Jul 2023 15:01:48 -0400 Message-ID: <20230705190309.579783-81-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 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770611076059809537?= X-GMAIL-MSGID: =?utf-8?q?1770611076059809537?= 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: Damien Le Moal Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/zonefs/super.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index bbe44a26a8e5..eaaa23cf6d93 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -658,7 +658,8 @@ static struct inode *zonefs_get_file_inode(struct inode *dir, inode->i_ino = ino; inode->i_mode = z->z_mode; - inode->i_ctime = inode->i_mtime = inode->i_atime = dir->i_ctime; + inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, + inode_get_ctime(dir)); inode->i_uid = z->z_uid; inode->i_gid = z->z_gid; inode->i_size = z->z_wpoffset; @@ -694,7 +695,8 @@ static struct inode *zonefs_get_zgroup_inode(struct super_block *sb, inode->i_ino = ino; inode_init_owner(&nop_mnt_idmap, inode, root, S_IFDIR | 0555); inode->i_size = sbi->s_zgroup[ztype].g_nr_zones; - inode->i_ctime = inode->i_mtime = inode->i_atime = root->i_ctime; + inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, + inode_get_ctime(root)); inode->i_private = &sbi->s_zgroup[ztype]; set_nlink(inode, 2); @@ -1317,7 +1319,7 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) inode->i_ino = bdev_nr_zones(sb->s_bdev); inode->i_mode = S_IFDIR | 0555; - inode->i_ctime = inode->i_mtime = inode->i_atime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); inode->i_op = &zonefs_dir_inode_operations; inode->i_fop = &zonefs_dir_operations; inode->i_size = 2;