From patchwork Wed Jun 21 14:45:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111069 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424666vqr; Wed, 21 Jun 2023 07:56:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fxafKW3PBgFTCwuK+9ATBZcxKrnwP1gJyUhroVR2cnzLjHDco//B8OMRrr5g2Fgm7yC7Z X-Received: by 2002:a05:6a20:3945:b0:119:4141:6989 with SMTP id r5-20020a056a20394500b0011941416989mr28127230pzg.13.1687359399289; Wed, 21 Jun 2023 07:56:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359399; cv=none; d=google.com; s=arc-20160816; b=ZQI8BpEX+lr3iuFL1fzc9ePLcr+G71BVSmIXzq4dfa0jQzrtz94lgdm1xDe3dWvau3 dLIje38GasVnU5NMFwHFxH3mrun2IUM+qt4b1XW3alC08oaJvRUxQVZlf06za1FGH4c0 nryHrl5GcoFo5ZetSscuyzr02JzJZbOmkS81Tj/oy9mq7M6BWKSKjJzm38jMj9ga1pTB s9zT9G1UpAcS2cXg9wooFgCaqPgbNipG36W5UKtMUayaFX5Z/dtD1/q/hVRLH39qQoKr sidx8XgGmwTXc3Kg7vWf5X5UfWKQ1VplAj0yD3hLMBqlaQJrd/MnxC2VLtmxMRVk0ug8 EO0A== 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=yPywnJW/XIFFDrzugFk47zW2K46iAhENo+A0DXMHv+4=; b=mTuuDJUr1LqIoHnoxTNam8g13OJgQgTT/dSyfM4zIR06L6ToXoR7HDHCGcIGe+xsvb +1RFR+5/g9bK+AZoPGebTj/kVvDRKBIUcjD97NcxJoDOUM20DTXSCbtTnpa2NM0OKU4u W6HOYphau3gjrDKTJ6zRkGa+fmM9Vpge524NV2mUa2MNyAzIFpt7TdOKD/n6MKNEn9fk yMwLd+Qqwlzjn3E1Z0TCfpoR6wUTrW9OC6zqfgLUb4+wXgcSyTMkBwOs/FJ7p2vhwkcA wS50mx4qqrOEUcHIVFP+0LZBJ7OFA+8TVaF1/yThFftGJxVhrhLB9oUg8g9p0QXSl14Q /MNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=apsvDESF; 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 w64-20020a638243000000b0054fd77fe97asi4039667pgd.267.2023.06.21.07.56.24; Wed, 21 Jun 2023 07:56:39 -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=apsvDESF; 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 S231873AbjFUOrq (ORCPT + 99 others); Wed, 21 Jun 2023 10:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231862AbjFUOro (ORCPT ); Wed, 21 Jun 2023 10:47:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CFAE1A4 for ; Wed, 21 Jun 2023 07:47:39 -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 AED8C612B7 for ; Wed, 21 Jun 2023 14:47:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23E28C433C8; Wed, 21 Jun 2023 14:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358858; bh=bzR7/1XJEIemADYzLdVmp2GJuPxiemqZax02bnmC8A8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=apsvDESFYNY1TpMvSGosQO2z3bJqW4Kph5UjSvjfKDTsgEYbyILjfGmRpZ7Fxs2p6 kgPoUpMfwKkjICoAs3xmkX1U2ytcdytNIRhzXdRTXAG/ebH2o/wuRjQBeQ6FGQLXtI svLWx2c2FR8OJf71H5cNhK2axngVltHtMt/F0lG5i5mu/O/iXbjp7UVf0LELA2G3xA IKuKYbdepj6ConwJGldJUSPih+8g9I6PKAJkjOz+HOI2ERfdy+4pNzLBMubfHsHKNB J7QNRQSYVi/gm/JYgLLiugC4nH1GxcXCwl4QdGmmlNLp1LgDQnTSmTRJ9hC2ZJuFPZ sFBmbxHPVVXmA== From: Jeff Layton To: Christian Brauner , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy Cc: Al Viro , Jan Kara , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 02/79] spufs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:15 -0400 Message-ID: <20230621144735.55953-1-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230621144507.55591-1-jlayton@kernel.org> References: <20230621144507.55591-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?1769324569473517466?= X-GMAIL-MSGID: =?utf-8?q?1769324569473517466?= 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 Reviewed-by: Jan Kara Acked-by: Jeremy Kerr --- arch/powerpc/platforms/cell/spufs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index ea807aa0c31a..55418395bd9a 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c @@ -86,7 +86,7 @@ spufs_new_inode(struct super_block *sb, umode_t mode) inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); out: return inode; } From patchwork Wed Jun 21 14:45:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424817vqr; Wed, 21 Jun 2023 07:56:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6/hMJkLr9xv0RUKOq3XVYcU/Ct6Gk5kqpzGQoXwFVWExHENcCQYT/8Nvd3Qe1pWrge8Tqv X-Received: by 2002:a17:90b:a4f:b0:25e:112c:c5e9 with SMTP id gw15-20020a17090b0a4f00b0025e112cc5e9mr9432217pjb.12.1687359417001; Wed, 21 Jun 2023 07:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359416; cv=none; d=google.com; s=arc-20160816; b=AxPykZXbgldHjKusoDS5N4jt1EU8S/3+cm5STYMyS7a00D8GsFevIx4bMrOThqFcQk fP/061RBRzP73tlNMHKxJ/VaBQ5SsD1xEerR4eBnLs1mXC5YAHqteLRDgeTAgAltzpqP azKGD+ISQhPAik5RAiKKKIR5fsvInBT/Bp9fgBDNoc/bcAQTGPefSgX7jdNFZoUtSx8Z FcU20902fOpvWtXslEWe5zPmKuPUOKaeOn7/dG416XTeiOGfw1YjKq3GaqApE3nEiTTj 2zFMnd+t6sDBCLTUQCAnzHQ+HLyXK3DcyqB87areims1gqs3MvdKmMqKqRMSfTnSACUy vZSg== 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=HgyKn+JQqL1b+P9SKqpeaNM/e/LPE5T28ZXWGdDb/jY=; b=qmZcEYtAvzClyvt80ThGZrFyC3U5RI4eAdnX2gSP0LNa2TRPV5w709AHlrG4p2uK9o 71zJyfMewCMSacFKmdzHKRXxoqhuLrB/bcCx5rN0Twvdfv4R1tWbadu4DhHLlCztxEiD GkM1IEy9c4a1DBL4v/L6Ri2iYDCLCAOe/DEef5L8X964Sv08MNpF3WI08ouxKYgxhshH 8o0tEI2n93vjlhmzeoqWYeSMIQjR00tm3l0fkmpl9BbCS/ZpmPHZzwjvwWKPF+V4gyKW SaWLp+OAljRSLhmWWQjnsISZ4uekZnwvsAs5+a83wfL+TTcTZnPJAZE4kF+OFT3SxKqU +swQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b0fWvZzi; 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 a8-20020a17090ad80800b0024bccf6609dsi12248011pjv.114.2023.06.21.07.56.42; Wed, 21 Jun 2023 07:56:56 -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=b0fWvZzi; 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 S232022AbjFUOru (ORCPT + 99 others); Wed, 21 Jun 2023 10:47:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbjFUOrq (ORCPT ); Wed, 21 Jun 2023 10:47:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C05051997; Wed, 21 Jun 2023 07:47:40 -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 54D236157B; Wed, 21 Jun 2023 14:47:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBE5AC433C0; Wed, 21 Jun 2023 14:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358859; bh=SerVS37LZ+M9Q1DrVXe11/DarECztwBfuFbsJZAaL/s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b0fWvZziCaDEPNv8e772X/4hR0ZOvdZvEbjB6p+JeCO+zyl3Iy6ikH62A+bQP/ydN cQaq5bP9anibGG10Aqrfckh6kUGFswV7aHPM/cPOiBKX89C9oUvTA4YvJDulF5h3cb OVap2sebFw8Yly04wHw1ihAaQQcVQwegi11RFHA400KxId71KUhWQhzZPZ/NV+VaS8 MmV6ItyfcBfC5wEQqDJJdt8SnF7Ym6jI/6ZzH+Ebt+3JPW1vY505jC90DjKbbiNbkw hoEAoBTSoHXOD+TcvXEp6S8970563oPpdjqLM7HAhbgLR8bwiAOQzZVSo7pbf7GZsE 9Us5QMgUSJ8JA== From: Jeff Layton To: Christian Brauner , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle Cc: Al Viro , Jan Kara , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/79] s390: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:16 -0400 Message-ID: <20230621144735.55953-2-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 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?1769324588267346774?= X-GMAIL-MSGID: =?utf-8?q?1769324588267346774?= 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 Reviewed-by: Jan Kara --- arch/s390/hypfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index ee919bfc8186..30fa336ec63e 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c @@ -53,7 +53,7 @@ static void hypfs_update_update(struct super_block *sb) struct inode *inode = d_inode(sb_info->update_file); sb_info->last_update = ktime_get_seconds(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); } /* directory tree removal functions */ @@ -101,7 +101,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode) ret->i_mode = mode; ret->i_uid = hypfs_info->uid; ret->i_gid = hypfs_info->gid; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_ctime_set_current(ret); if (S_ISDIR(mode)) set_nlink(ret, 2); } From patchwork Wed Jun 21 14:45:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111079 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4425836vqr; Wed, 21 Jun 2023 07:58:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OQ8dtAZQjgz+60GqQvpk5Zc1o7G5rqaqHb32aSacoa+TavqEJB1v027W1beSBFp7mvcMZ X-Received: by 2002:a05:6870:e1c3:b0:1a2:7f63:9920 with SMTP id g3-20020a056870e1c300b001a27f639920mr10593819oab.26.1687359532241; Wed, 21 Jun 2023 07:58:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359532; cv=none; d=google.com; s=arc-20160816; b=o40VDyUMAO/STH5jxWljlqNBLhDQ3Hybpm+rxZEVacAJ0sKNOgMGf+O95FNM7ICswb m85pvjB4XPPNX0B4OWQ2ryKP2coxNgdecLA5LH74JTUmG4nP4zptkzACxISa5t6b6l7W RCmTeIPqccs10hOkyX00lyKIDX2jT1zVtjmc/xfKtV+5+x7D3PYB5SuE0x7/5aAaiyR7 pXg8xn4HrfTW22jZjfnfddP8l+XUidE/ATwL6v+YkXOYLlM1qHNRZfTiqQ82hGAa2e2u IBQo/sTDl6BhREAKWT9netLvOdAV1p93ejGo4m3JzAHSC6MXyWZZjRNp7U9rK7sWxkZN pc/w== 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=b/GkEzFcoQwFroERWDSYmBv3G3lv62iAG55kL4sPyYI=; b=HPEtkprhiXgo1tQQvbEKT3ffWRPvsAhK1gLr/qJOBHWi6fpmc3PwwY3POxHn38F63V uuQpk3CPttepfxBRwByqAHnQnmopLFvnxqaGdDUv4y9KyweXzs/KP6OBfJ3ob5+40eU4 eZZaQlx8zWSHuSP93nabY/SzfP8sv9HLTx4eUVzvv48CQsx4PvKIwS/dqqUGlqM4cy6v Dg9O3oElm9xrS7vYHyQibtcXugWDThd8e51OwzKDbN07GP1vABbV94nuXRJ5FynxzfJE SjG9ycX0AvNOryFcYnymsGDelR9dh2N7eMWsUnqgara8xeD3+Qcxx9S2Ob1Bf28xbQjV iZ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kdwQL++z; 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 rj3-20020a17090b3e8300b0025ef1357d96si4894546pjb.67.2023.06.21.07.58.29; Wed, 21 Jun 2023 07:58:52 -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=kdwQL++z; 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 S232109AbjFUOr4 (ORCPT + 99 others); Wed, 21 Jun 2023 10:47:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbjFUOrt (ORCPT ); Wed, 21 Jun 2023 10:47:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 851DD19AA for ; Wed, 21 Jun 2023 07:47:42 -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 1CCA86158B for ; Wed, 21 Jun 2023 14:47:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80C7CC433C8; Wed, 21 Jun 2023 14:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358861; bh=+ZbVNnWFJyrnkyx7x/5Q61rWw0/EOzbgoTsZmaMWSrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kdwQL++zke5r0Tkn8M0bI30T5o5R4QI5cpiziRr7IQWMdP1/4cAEvIXkgekYm3QBd SOkh53XgsgFrozB7y1c0+GgLUCbLWCKuAr8dIDZwC8xQqNNhJcymT3Dhp7lOScmZg3 0LpZI25nGxG7UreHahXG49KK4wpOwExNxw5i0OSqsco1t1s5IJ3uevQuLYFAqZ1SHb v3r0KXlzurc8J8mXT+dfCBtL1tYFr9/BT+AKFWhdxjzUMDYRDWUJTS1w/MHYTyUYuX W2bJNm244PhLGaKE19TZEi+gG2wfxf+XHFIDysoYWeeBIukRG36l0E9cpwIMqKzfQv AvMi/JdB3qNUQ== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman , =?utf-8?q?Arve_Hj=C3=B8nne?= =?utf-8?q?v=C3=A5g?= , Todd Kjos , Martijn Coenen , Joel Fernandes , Carlos Llamas , Suren Baghdasaryan Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 04/79] binderfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:17 -0400 Message-ID: <20230621144735.55953-3-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324709043424236?= X-GMAIL-MSGID: =?utf-8?q?1769324709043424236?= 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: Greg Kroah-Hartman Reviewed-by: Jan Kara --- drivers/android/binderfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 76e7d6676657..b6b1220e1e55 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -153,7 +153,7 @@ static int binderfs_binder_device_create(struct inode *ref_inode, goto err; inode->i_ino = minor + INODE_OFFSET; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); init_special_inode(inode, S_IFCHR | 0600, MKDEV(MAJOR(binderfs_dev), minor)); inode->i_fop = &binder_fops; @@ -432,7 +432,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) } inode->i_ino = SECOND_INODE; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); init_special_inode(inode, S_IFCHR | 0600, MKDEV(MAJOR(binderfs_dev), minor)); inode->i_fop = &binder_ctl_fops; @@ -474,7 +474,7 @@ static struct inode *binderfs_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_ino = iunique(sb, BINDERFS_MAX_MINOR + INODE_OFFSET); ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_ctime_set_current(ret); } return ret; } @@ -703,7 +703,7 @@ static int binderfs_fill_super(struct super_block *sb, struct fs_context *fc) inode->i_ino = FIRST_INODE; inode->i_fop = &simple_dir_operations; inode->i_mode = S_IFDIR | 0755; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_op = &binderfs_dir_inode_operations; set_nlink(inode, 2); From patchwork Wed Jun 21 14:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4427833vqr; Wed, 21 Jun 2023 08:01:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Zu4Sbki2dKPPdwBx1LjbDyJmQZTcqMq2c64+/505OLJuNdVWB+aiBRe4ik6pu6BiEaGXx X-Received: by 2002:a17:903:41ce:b0:1b6:6a14:3734 with SMTP id u14-20020a17090341ce00b001b66a143734mr12147954ple.29.1687359690001; Wed, 21 Jun 2023 08:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359689; cv=none; d=google.com; s=arc-20160816; b=u27Omu04yvOBmgqGR2NNPT8eGfR9Ty6Gm10J+msImzc0P9xJyHL7p10NwrQ7rlm6eM 1FIreKAD4lIw8KHJgzUt9UJY+f35r8LAEDrN84q8I1V5eRBM+2BFWsLbgjDaJqVTlH8x H2Qx45br7FvvKtZ190OhJlwrKPZ31uWjHaRB7mSPUPOY2b1S2fLxJxYELzmE4XbjhqYc uMmL7gv4Kg2pRWcdP3LPd7vwp1mZjzZNLyoyhEJIROh5RS9GnzOAMUMWk9rZupGS6vhn oNDHj4/Z9NCLxy+wB93BcxHkTa4z5Ptzcuad39TB9SC+RnSorVFEgHLcfsxdZAuJ7mw1 wz6g== 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=ChZJ8B8mHFhLUr90zUJ0FKgQMq8lUZNTPPHp5jYNvvo=; b=sc/v+TD1MJuDVQO70wQt6ieoatf2KMYsL0J6BBT9tpl38trgawreOfQLYKWBFHhVdw 9KrospyX9OAeXxgSedd4NSgqjyg1GufliE4nro4I5ndTHpDen0B4OPmfytjUz267/nra 4OL6rSfC6Vq+rRDG5a5xnkUgHdxWauuaN94ghVbMq+f9rUU5alfRPMm3ue93w/JHaUuU 8s9OGHTFZlQupzfQQaz01uiL1nLmzQgX+2gk2tknzJOgnMPU+rZLNCTL8AVZzEt35vza mV59uFHxlaWsIeiC9N7ZRKx7OFa5U/wampnkgT4yOEw/uL4fwHs/cgvhneMtsY7ZTEUc CZaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d46xo6y5; 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 l8-20020a170903244800b001b66f1d121bsi4698547pls.255.2023.06.21.08.01.09; Wed, 21 Jun 2023 08:01:29 -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=d46xo6y5; 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 S232073AbjFUOr6 (ORCPT + 99 others); Wed, 21 Jun 2023 10:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbjFUOrz (ORCPT ); Wed, 21 Jun 2023 10:47:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 011EEE7D; Wed, 21 Jun 2023 07:47:43 -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 924EF61596; Wed, 21 Jun 2023 14:47:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B6AEC433C8; Wed, 21 Jun 2023 14:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358863; bh=vRI8BU25UMybNjK9RylAc8XYw1FYSkUTNGSxgGVyJWE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d46xo6y5DaQEs5JFdSRiHff6Mo5y6Z5mT1OphxfwCSbnSrJtI76TQEuZ/Q8jKtpDy o0tTD5jOQ0iICSnNGAPobGPlCyNxb+ZyiDmDOgdRV2LDO6srHwuJkCwFn/f2Ppa2nr 3slorsLnW4QY5wE9rRl3qXOfxHr7+FPfm/5skrEqHsjuvIrfFUsJSqYkkScSLvIwQu dnUMoEUIlp1w2564MSmUyCc3MRCLv7b+uP4P9MHIRD5/yPErUFAoiKEGy9dZ2XD1n4 8dQ71TFSr4LWl0R/RJ4GPOlWw5v0E6FL4X1RSUCzAn8dTf6gc2PATCg2pV669E/eiU jnSyooZWhhgrg== From: Jeff Layton To: Christian Brauner , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky Cc: Al Viro , Jan Kara , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/79] qib_fs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:18 -0400 Message-ID: <20230621144735.55953-4-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 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?1769324873962412044?= X-GMAIL-MSGID: =?utf-8?q?1769324873962412044?= 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 Reviewed-by: Jan Kara Acked-by: Dennis Dalessandro --- drivers/infiniband/hw/qib/qib_fs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c index a973905afd13..db008f2884e4 100644 --- a/drivers/infiniband/hw/qib/qib_fs.c +++ b/drivers/infiniband/hw/qib/qib_fs.c @@ -64,9 +64,7 @@ static int qibfs_mknod(struct inode *dir, struct dentry *dentry, inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; inode->i_blocks = 0; - inode->i_atime = current_time(inode); - inode->i_mtime = inode->i_atime; - inode->i_ctime = inode->i_atime; + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations; From patchwork Wed Jun 21 14:45:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111109 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4441004vqr; Wed, 21 Jun 2023 08:17:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60iL4vs34YMwP9sRaoWsHN95ILTlwBJXck4vVTyB6JUt3iyeh1WBNyNcSQl779wv63GdYd X-Received: by 2002:a17:902:6ac5:b0:1ae:3991:e4f9 with SMTP id i5-20020a1709026ac500b001ae3991e4f9mr14042168plt.61.1687360635609; Wed, 21 Jun 2023 08:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360635; cv=none; d=google.com; s=arc-20160816; b=kKqfZqijzkjPaPrHcy1s+UHGdmoU0L061blQZ2Suz0pPJWeKwLFyDB8cXmPA0R4f3q gEX/U0bsbuSuA7NlPQPOUmC1gSS4FGH3stbHuSq0uvSC85DJLCzj00zj3eY3jRD3Cpw7 pkHBCmYTUK528scqe3vXFbT7KMMJoj2Rs+rrxYaKxfdxKWa8ReKueDMGR3LiF9Epx7tP 9bGlfLtBpINVsQnW+FsS5rHOxbgYYcShnc0Jy9vTJcEG6abnT29TawYjCsLbYVVq6w1A xLoxemkyp1Kan58G+gve+Y9fXbcvPzNrasB5DmbPF/Bq46X0h4bfIMYvqyo4sQnRULth MYSg== 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=cXwNZ2PdJ9fHjz0RiViAUiLoHwKgsRe6GOyWPM60n38=; b=XNBNm3GD95C4h85TJJ2u6Mb1wTOGCLyHtFPWI6zcE0aJ06cIn2ATk973HlGRGXAgSh ceekWvwmXR1nnnE2n0a66g3z476XrRf2fImIsoH0RMeat9QeiKj3xLAnpeoPorq4ky6P Y+Ch7lREVcuPH56PSkz/qrSuDawFrByby+l5NZ4enpp9FkLXxOLcasuHmBGrTY2HoIzy 4GYovClLb7fp5ZzQ6SZ1pBwdnDKocetFia0Ld5MMOCDzIjEbHWrVtm4OeGIL3uJjVOFd mX1ui0n4nb+ppbWF1piSnQ6s7dlowfZ2jK2tdUTn9wZT6jClVh5+ej4rBXiLanNc+bjp Fl7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FrdS7vqW; 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 m7-20020a170902768700b001b11168bde3si4219998pll.521.2023.06.21.08.16.52; Wed, 21 Jun 2023 08:17:15 -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=FrdS7vqW; 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 S232083AbjFUOsC (ORCPT + 99 others); Wed, 21 Jun 2023 10:48:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232103AbjFUOr4 (ORCPT ); Wed, 21 Jun 2023 10:47:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C504619BF for ; Wed, 21 Jun 2023 07:47:45 -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 3DC8661572 for ; Wed, 21 Jun 2023 14:47:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD689C433C8; Wed, 21 Jun 2023 14:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358864; bh=6wKzjV0iuSpON8C45UbhnIMmtp9G0BRhhSUZHcR54lA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FrdS7vqWpKiQdnYN0QemIPBA3NvZyxGcwHQDdZFaFqeDLoz/JJlfvups7Ioz3oweJ zyYTHTOf/ECjQWtQX/OiaLvkpd6acM0Fr0My0yp2m/bRYwvPIs5u0m2CLB6BuSUcur oX2edGgW/L/9ExKADvspyrGqTRJTo6NmYs/ciQYpdzT/P5wfdBhofpJgqTJR07kOXH P3q9SitH3OOFJ04P4VaOgOokp71nRgY3YWYxBYBHuh5QSEYbrvehzHkmx3XpjhQKYR cue+W4mm3ItFgUgUCarVFBDrB4SunIIQ+AaMBGL4Mk748xhGrCdeHjVuO7YAcKiFCp idcRa318maj2w== From: Jeff Layton To: Christian Brauner , Arnd Bergmann , Greg Kroah-Hartman , Brad Warrum , Ritu Agarwal Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 06/79] ibm: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:19 -0400 Message-ID: <20230621144735.55953-5-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 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?1769325865775061878?= X-GMAIL-MSGID: =?utf-8?q?1769325865775061878?= 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: Greg Kroah-Hartman Reviewed-by: Jan Kara --- drivers/misc/ibmasm/ibmasmfs.c | 2 +- drivers/misc/ibmvmc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 35fec1bf1b3d..34d41b2a0d89 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -139,7 +139,7 @@ static struct inode *ibmasmfs_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_ino = get_next_ino(); ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_ctime_set_current(ret); } return ret; } diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index d7c7f0305257..b69c978c2590 100644 --- a/drivers/misc/ibmvmc.c +++ b/drivers/misc/ibmvmc.c @@ -1124,7 +1124,7 @@ static ssize_t ibmvmc_write(struct file *file, const char *buffer, goto out; inode = file_inode(file); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); dev_dbg(adapter->dev, "write: file = 0x%lx, count = 0x%lx\n", From patchwork Wed Jun 21 14:45:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111060 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4421717vqr; Wed, 21 Jun 2023 07:51:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4o00zDWHeKCRmkMFPiZFC+jdocbAFBculHHcwqs2J2nqiwS4ZfGZjk/iaajADEhxmgLfzQ X-Received: by 2002:a9d:4e97:0:b0:6b5:8da0:c321 with SMTP id v23-20020a9d4e97000000b006b58da0c321mr5688206otk.7.1687359079109; Wed, 21 Jun 2023 07:51:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359079; cv=none; d=google.com; s=arc-20160816; b=M7YZtvsc4bhf/ByHfkcJeAvBlCPbzDfSMJKjADNQFY3B8pQjUc1pWhay1aWNyehNNu waVKM7WtIgz5UUb/PnHJPL0g/3RvDuQ55Z7hi5TJmui4wJgd4EgsN6IyHwlPnOkpVKgp k/qG5YIbHCImJ0WatlsuS5bQH8xfjYSJCXD5Zxecq7TzIK1lui5cWfJCRz6jn1Zg2znl o5sP4afTjJ4CEnNVn7ByHQn1rx+FlgzwhB/frlkrI4EWmevdhnyTTtEnNTIDMiXiVPSE Uq0ju2Fz1LL4Lfgn6jiIPzaOeW+HdFH01CfV1aTshs9uRKUEtZGiFwnf6ItN1gULISA9 3eUA== 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=r3fOPr0TmsuvzoGaltOHum5c/bEt0DdO6tZNF5fYHt8=; b=fGUCz0wLZ7deixnqz5HpF928m1kjgBIAaPjfbCfcOCT94xSFTCnwwoIWRBs7NNsd4z wryygvTDdbzk2c7XQJC7rrTj50b4up/6UqY8dXF4tA6xhe5UuFygqe5jog/QsmBRWZ8j JtGER62t4pxBuUqAltBt+dLeamk0oqEUZqXOCp3jCybG5bztwWotpWxL/p/urpOqs1o7 jOWF52Eex1Ie1hDnJEDm7VCVvzypnLqhBMatuc/gVv6KgDtyxsCdoJm7EwdXUggK6P7b CTPItXkBW23+HQIJN5mIMKSQQOSSFM6mQDb6ORKE4eWmltuK8MHnXkIPMfNED3Gdm3tm iQKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mioKTqZY; 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 w189-20020a6382c6000000b0055338995061si4160583pgd.754.2023.06.21.07.51.03; Wed, 21 Jun 2023 07:51:19 -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=mioKTqZY; 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 S232272AbjFUOsG (ORCPT + 99 others); Wed, 21 Jun 2023 10:48:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjFUOr5 (ORCPT ); Wed, 21 Jun 2023 10:47:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60DA41997; Wed, 21 Jun 2023 07:47:47 -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 E21AC6157E; Wed, 21 Jun 2023 14:47:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B79CBC433C0; Wed, 21 Jun 2023 14:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358866; bh=F3dY/2KLU5GOMIGa42l18TYXTzOkj60bdKGA2MB7kkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mioKTqZYyXJZavUYjcubhAf8oDBomkt74YuPWSA09CAcJuHtjWYu58SB4Z3985pYl 9rU5LxQy2mip8BeoycVEc8K0Y2pmMxS0Tlq+9SwjwKNf1UsqVYl9jhv4FcDRPADbKI 491CPsalfGoUC3xZ2srE9Ot53iuzMqb4CpFDRwKPoQQlYaruIT9GF+q2EJamLI8KTB xBGNVi1fOZ7dtG39nR+YmVdEtg0IiQ/DBo1cOK89vpa3Jr0WXQn1fokdnQLmxlz3Is YyRaE/xiud5UkfOYTmAqwP8rnqRnxkH4w9BLQmRmqc2ICOWr/8PRBzs37A0SOQKudr H6GYBb/gkUn9g== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman Cc: Al Viro , Jan Kara , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 07/79] usb: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:20 -0400 Message-ID: <20230621144735.55953-6-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324233877061207?= X-GMAIL-MSGID: =?utf-8?q?1769324233877061207?= 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: Greg Kroah-Hartman Reviewed-by: Jan Kara --- drivers/usb/core/devio.c | 16 ++++++++-------- drivers/usb/gadget/function/f_fs.c | 6 +----- drivers/usb/gadget/legacy/inode.c | 3 +-- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 1a16a8bdea60..02f718e0deaf 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -2642,21 +2642,21 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL\n", __func__); ret = proc_control(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_BULK: snoop(&dev->dev, "%s: BULK\n", __func__); ret = proc_bulk(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_RESETEP: snoop(&dev->dev, "%s: RESETEP\n", __func__); ret = proc_resetep(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_RESET: @@ -2668,7 +2668,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); ret = proc_clearhalt(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_GETDRIVER: @@ -2695,7 +2695,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB\n", __func__); ret = proc_submiturb(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; #ifdef CONFIG_COMPAT @@ -2703,14 +2703,14 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL32\n", __func__); ret = proc_control_compat(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_BULK32: snoop(&dev->dev, "%s: BULK32\n", __func__); ret = proc_bulk_compat(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_DISCSIGNAL32: @@ -2722,7 +2722,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); ret = proc_submiturb_compat(ps, p); if (ret >= 0) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); break; case USBDEVFS_IOCTL32: diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index f41a385a5c42..756c78043a04 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1377,16 +1377,12 @@ ffs_sb_make_inode(struct super_block *sb, void *data, inode = new_inode(sb); if (inode) { - struct timespec64 ts = current_time(inode); - inode->i_ino = get_next_ino(); inode->i_mode = perms->mode; inode->i_uid = perms->uid; inode->i_gid = perms->gid; - inode->i_atime = ts; - inode->i_mtime = ts; - inode->i_ctime = ts; inode->i_private = data; + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); if (fops) inode->i_fop = fops; if (iops) diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index 28249d0bf062..b83a68feb316 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -1969,8 +1969,7 @@ gadgetfs_make_inode (struct super_block *sb, inode->i_mode = mode; inode->i_uid = make_kuid(&init_user_ns, default_uid); inode->i_gid = make_kgid(&init_user_ns, default_gid); - inode->i_atime = inode->i_mtime = inode->i_ctime - = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_private = data; inode->i_fop = fops; } From patchwork Wed Jun 21 14:45:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4430252vqr; Wed, 21 Jun 2023 08:04:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ccGp8Gkgb/tVBlXIVr8mUvU7F4BcurpIg1rVvMNU9yVnY1aiY6IeV7k5XaQgUkdu8peJ3 X-Received: by 2002:a9d:7a93:0:b0:6b5:87ae:60be with SMTP id l19-20020a9d7a93000000b006b587ae60bemr6961423otn.37.1687359841266; Wed, 21 Jun 2023 08:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359841; cv=none; d=google.com; s=arc-20160816; b=qA/FwiROBbB4kfcKSuMrnAMIJ+WJrtJ2szDYPT8ZD9bQOMugnAEXj1AvFRd5ogPIWu 57FDZfeNX4VbRXn/rZd+yK0mKjg00buFujeVdnx2J2KXQbAWRu6JTjMuhl1GG5xo2oxD 3TJ7oS/GU1ukCoH8FOIKk72Q1qXibjmocq/aTdob6UdM7uud3loNeSKyQ6lvY3f987fW ZLex3VEEfYclUUSeizGJhsZWV2LzpxwHs42uJbNisUemPItZYIbMvT0GJfBmsEtrZhvs fArikTGBFIpMd5ytIr0RvTn5npxpT01vMg4UjKluNazTNOTTaUuDkxiChlDkOZaUCCLn o7Iw== 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=Nc173qFszw3W4LIxGzCvieCpInBM3vAgDi3oavEp4cE=; b=acXnMGIF6l2K9MrnA3uSN46kliNZpXJkVzBqYkDOTG8Fx+86y+2eWbq9YAj6anHmxC VwIOB4ej+nTj58xiWaTMXK6XZG+lxsUrH7AaLIi85KlmHI4NOT/KuEEGZKRMUG2P7Scs xc4eD+ipu+2nFgBWqyKWcxvFNOe2ynMg+1lGhex18erSu4COguejlqJzrvfpe6dPo42R HECe0gJcHUOFnu+lQ3dzwMdE/pvhSgHCeSKGu4rMz7PIM+Us28+fXxqpnJkd5yWZzMDe ehIg0YFX0zmbMfZ6zjET+007VmrgN8yGMOqMYbrRjTSmpQtnnbQ4ETnpbmRK4ffDi/c9 g0pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jyBusIDy; 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 l17-20020a637011000000b0054fd9e9b862si4259912pgc.232.2023.06.21.08.03.44; Wed, 21 Jun 2023 08:04:01 -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=jyBusIDy; 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 S232079AbjFUOsN (ORCPT + 99 others); Wed, 21 Jun 2023 10:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232055AbjFUOr6 (ORCPT ); Wed, 21 Jun 2023 10:47:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 199011BCA for ; Wed, 21 Jun 2023 07:47: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 A7CE96157F for ; Wed, 21 Jun 2023 14:47:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E541C433C8; Wed, 21 Jun 2023 14:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358868; bh=3RYKe34tfhw7qCFMfdSwp5DfFyxQfIY9Egtj5X0ni8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyBusIDy9RnwXDykjRdGdrB37HI23tNaNH9Kn/r/H6n8AyQH5L4VxdrwYFJSGDkUG x4GDrOg2uiVQZXTS2OPbIDfoTTTKeulq9Cwe7YOcnFbTqQoi+UTVrFAZima3ScB2T6 4u8Ho/LD0CpUZfgqeTqip9pYeUUHj4B5eaD5lq2d8HHplRzhLvnGY+J59+rBAUvrHw YZEfFfLZ/H35s4BTKT1HaohpIU7HNSajR7+4ovllzIRvDbDTdnuTF7c6DWvrDDNjFe rhOeAI/MlrU03RU0BV7Fw8m+fvDGGsWo2j/+BBeq157CrCYzqGSh0b4IXNeb881V8y 2FVi6HnOyrfJw== From: Jeff Layton To: Christian Brauner , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: Al Viro , Jan Kara , v9fs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 08/79] 9p: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:21 -0400 Message-ID: <20230621144735.55953-7-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 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?1769325032860377640?= X-GMAIL-MSGID: =?utf-8?q?1769325032860377640?= 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 Reviewed-by: Jan Kara --- fs/9p/vfs_inode.c | 6 ++++-- fs/9p/vfs_inode_dotl.c | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 36b466e35887..098e4c7160a8 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -261,7 +261,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); inode->i_blocks = 0; inode->i_rdev = rdev; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_mapping->a_ops = &v9fs_addr_operations; inode->i_private = NULL; @@ -1153,12 +1153,14 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, umode_t mode; struct v9fs_session_info *v9ses = sb->s_fs_info; struct v9fs_inode *v9inode = V9FS_I(inode); + struct timespec64 ctime = { .tv_sec = stat->mtime, + .tv_nsec = 0 }; set_nlink(inode, 1); inode->i_atime.tv_sec = stat->atime; inode->i_mtime.tv_sec = stat->mtime; - inode->i_ctime.tv_sec = stat->mtime; + inode_ctime_set(inode, ctime); inode->i_uid = v9ses->dfltuid; inode->i_gid = v9ses->dfltgid; diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 5361cd2d7996..0041b5fc4407 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -640,14 +640,15 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, { umode_t mode; struct v9fs_inode *v9inode = V9FS_I(inode); + struct timespec64 ctime = { .tv_sec = stat->st_ctime_sec, + .tv_nsec = stat->st_ctime_nsec }; if ((stat->st_result_mask & P9_STATS_BASIC) == P9_STATS_BASIC) { inode->i_atime.tv_sec = stat->st_atime_sec; inode->i_atime.tv_nsec = stat->st_atime_nsec; inode->i_mtime.tv_sec = stat->st_mtime_sec; inode->i_mtime.tv_nsec = stat->st_mtime_nsec; - inode->i_ctime.tv_sec = stat->st_ctime_sec; - inode->i_ctime.tv_nsec = stat->st_ctime_nsec; + inode_ctime_set(inode, ctime); inode->i_uid = stat->st_uid; inode->i_gid = stat->st_gid; set_nlink(inode, stat->st_nlink); @@ -668,10 +669,8 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, inode->i_mtime.tv_sec = stat->st_mtime_sec; inode->i_mtime.tv_nsec = stat->st_mtime_nsec; } - if (stat->st_result_mask & P9_STATS_CTIME) { - inode->i_ctime.tv_sec = stat->st_ctime_sec; - inode->i_ctime.tv_nsec = stat->st_ctime_nsec; - } + if (stat->st_result_mask & P9_STATS_CTIME) + inode_ctime_set(inode, ctime); if (stat->st_result_mask & P9_STATS_UID) inode->i_uid = stat->st_uid; if (stat->st_result_mask & P9_STATS_GID) From patchwork Wed Jun 21 14:45:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111074 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424870vqr; Wed, 21 Jun 2023 07:57:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5icZqi5OMllChqTWADrPTN2SIKjrR05tGA2r1OOA9xAIKIQb0npNAPBM0rFqHh4PLpCCEQ X-Received: by 2002:a05:6a20:4407:b0:122:7e30:5747 with SMTP id ce7-20020a056a20440700b001227e305747mr6486044pzb.11.1687359422456; Wed, 21 Jun 2023 07:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359422; cv=none; d=google.com; s=arc-20160816; b=ixaP27h7AqDaZ7QxorjdOR7fMIa//fWmoGD5JSEKz1KelKZJ4HAUljgAHG74rvvi/C s6yztbFUMfBWJiwcJf24RiptyV9izT8YHeN1nMugVkQxuU3yWAyR7pft2upzMIBcQstf 4oIwZfThjOY6o9hG9/xKGeRst/vGkIdyUwDpnKfQi4WbFYoe2fK4rTjubPLJDlMP7DnC QV/NK92v+fTcmtQa6jIoLduAwzN/ZrNkej+gRRhN/gRtzlQ7o4FYxWhq5Vnuh9K3njWp tZFVKWPDN1Ukirhbqes9lgs+MCP0Z+j+0q//mDE4PPKALNhOF8EuiC83AVBZVMmz3VDC RXXw== 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=xLSx96NXLpWaKzK8X4XhgbBdyHeFmQoEDEqLuhkwJlI=; b=gn9J0OGjPdzNt21W/Na0AxNeuHlVpDQT3I6P3j54TFTwj0dryrYGJYxIgbBvbInKLe g+evPren5iiDq3Uyn3J1CzFztNZcaMH8MKv9k8szJQZkBSnWy6uMd6/rCeaEyuKbRbZX 0CDmLxDC+eA6rw5zksYwpgAkhD6LdFaA0jd07M5sSCqbW+bftXYiraRG/7PPmszLNz3i NUZZ1fcO6ylseGeVhAyHXccteLh6YzODmAdgqiyY9dDZXgBLyslDPxCAKhGSDVbKjTWU n/2EET9m2Dl6MHh8rhjy6VOK0TPYrwOMDtkgyejCgvsz7Q0khLqyo5t2d93TopLtVeiJ hYUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="r/+pHBDD"; 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 k11-20020aa79d0b000000b0066870e149a8si4129157pfp.234.2023.06.21.07.56.47; Wed, 21 Jun 2023 07:57:02 -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="r/+pHBDD"; 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 S231955AbjFUOsS (ORCPT + 99 others); Wed, 21 Jun 2023 10:48:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229797AbjFUOsA (ORCPT ); Wed, 21 Jun 2023 10:48:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F891BD2 for ; Wed, 21 Jun 2023 07:47:50 -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 CC600612B7 for ; Wed, 21 Jun 2023 14:47:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C63CBC433C0; Wed, 21 Jun 2023 14:47:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358869; bh=DdJ7C6tlCKMPlU8UZxtXIicsEOsFNUURmBliNnYmY1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r/+pHBDDfoDhN/xguQZStTpUaZ1Mqa+zGXrGzOwW3M1J4WigOpi5Uz1+Eg9n+jqYw 7dhKcbgZ6VYFg0JN79rteiBp+9Zon9lIuQTUVoNtPjrvWqhNJ6qRMg9cIZI+tCtLvS tqqdBCzeb37YJ7jAdyyExdnPSTGDSGtMFjZ/6so2LCCf4gUHptJutqwxSke7dKXr/j 8a1a964AWfU7qr+rtuNWlNTtOXgtJX+I/3o8v+X47b3fdzOutAqbYqyqUE4ZPgmiuT z1Y/o1/ZEmJthIp0SIWZEzVkbB3F70OyZD6FqMO/Avkyz9jT2aXwF+tHvD00RHlgf6 J1x1PR1+H+/mw== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 09/79] adfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:22 -0400 Message-ID: <20230621144735.55953-8-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 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?1769324593444980805?= X-GMAIL-MSGID: =?utf-8?q?1769324593444980805?= 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 Reviewed-by: Jan Kara --- fs/adfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index c3ac613d0975..266191e6b80c 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -270,7 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj) inode->i_mode = adfs_atts2mode(sb, inode); adfs_adfs2unix_time(&inode->i_mtime, inode); inode->i_atime = inode->i_mtime; - inode->i_ctime = inode->i_mtime; + inode_ctime_set(inode, inode->i_mtime); if (S_ISDIR(inode->i_mode)) { inode->i_op = &adfs_dir_inode_operations; @@ -331,7 +331,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, if (ia_valid & ATTR_ATIME) inode->i_atime = attr->ia_atime; if (ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_ctime_set(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { ADFS_I(inode)->attr = adfs_mode2atts(sb, inode, attr->ia_mode); inode->i_mode = adfs_atts2mode(sb, inode); From patchwork Wed Jun 21 14:45:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111081 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4427561vqr; Wed, 21 Jun 2023 08:01:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6O1WBq2Vhj42CqNztV1m0Qg4wtF8IebKT5EzpcWYFSX0PQLDRhuow6wsn2Y7Ay1CURxZ4E X-Received: by 2002:a05:6a00:2341:b0:668:992b:cb1a with SMTP id j1-20020a056a00234100b00668992bcb1amr5767575pfj.19.1687359675170; Wed, 21 Jun 2023 08:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359675; cv=none; d=google.com; s=arc-20160816; b=ukq/bMzyBDgFlclBjl7pA3XTdZkjxJZXWbbZs17SdvGpzsnkwPhs0qLy8oEanrJ0PD /Y2HIum2DMEILrdenz2jzmtNYUGZ+kfgC9N5DGVg8+Y95URq3PB/32cTZZEUGn+osrpP cW+a3M16KRqgUa81+q5vlHxlPXB++Zo0HZp1+2+V8lV/drwpgff0eo+pHnCSkAn2I1Q6 fjIhNAfeNC98ay5ixad8QENCVF34ydmFy5sHj8Z567EPxybSn/Q1NyPyybzVhURHLzE6 jbYPC8fNI/JxxSs1l44ELO9XcdVlIu6Q7lC0VCubTdOtdJAMOTK46RmCfEKmihTbunis 3/og== 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=93fLjUvImvEsxeUpHI/963IYWESzYXWj2sCakPlI9Bc=; b=p0+XBUPWNjWEMiRgwtbhZErVkDyLPgdCJb1uDiE5bsvmkW7+f9v6c0RFljzXgtfGo9 QmY051f1zHSDfVNnFi3LCJEONfq9QwsHFLQpBdT9ABFlm6LyfDYnal2B0eoHWGavqzR9 MTqhye0lQ5BPALSdbYlVLXIHnveglO1PiazBOqPI18sr9EU21TWC7+bW//DBwyCpTw+G Pwh09+9cW9A6ZUKi1ukNLPCUALsjoP/wZN2ejH94T7+N0fHICszdPvgSe9N3fJLdGIhz j2pdfvEIOCMi6TSXodERinxaCQNuUWzOxiDD8Ljm4oJZqs+sJB2s5RetwLJ7kjnDLW3i 5U7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kAPwnqrX; 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 q11-20020aa7842b000000b006686fe3fe4bsi4291503pfn.154.2023.06.21.08.01.01; Wed, 21 Jun 2023 08:01:15 -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=kAPwnqrX; 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 S232334AbjFUOsd (ORCPT + 99 others); Wed, 21 Jun 2023 10:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbjFUOsE (ORCPT ); Wed, 21 Jun 2023 10:48:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDF6C19B5; Wed, 21 Jun 2023 07:47:51 -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 555B06158B; Wed, 21 Jun 2023 14:47:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2393CC433C8; Wed, 21 Jun 2023 14:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358870; bh=zjL6z/vnFxpxtgI4/XfP4lAW/58HKOouZybNdXVfuiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kAPwnqrXpALw4aQmCmtwf9RniMMfRQxvQCvKKS4/9gtuDGXdXkogQeHgWodP2vogM 4xAX04jXo3HyFoUsvtgGU/lLzBuLA1NTOdB5Pz8R87fD1W2j/Am5/BxUMtwLSKs46A FFc4mJT08xYVd6Jr/bcC6uvSIy47aIP6Sj+anu+xYMLsoB8hv8Y8Pm8RctfCWzEGAt EYJ79yUzOVuh4j8y81TMAQsw1ii9ZybTQWp2+ldfotRgKwY5kUNy+vc03nkZsbUGKx a3Jj7TiPX+fY8z8cJD325QvH4YsufnzZnLqVPdmtzb05n4p7878NOXrTNZGRdhyE3z /oKX1lera6w5Q== From: Jeff Layton To: Christian Brauner , David Sterba Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/79] affs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:23 -0400 Message-ID: <20230621144735.55953-9-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324858867227362?= X-GMAIL-MSGID: =?utf-8?q?1769324858867227362?= 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 Reviewed-by: Jan Kara Acked-by: David Sterba --- fs/affs/amigaffs.c | 6 +++--- fs/affs/inode.c | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c index 29f11e10a7c7..2b508aa6707e 100644 --- a/fs/affs/amigaffs.c +++ b/fs/affs/amigaffs.c @@ -60,7 +60,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh) mark_buffer_dirty_inode(dir_bh, dir); affs_brelse(dir_bh); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); inode_inc_iversion(dir); mark_inode_dirty(dir); @@ -114,7 +114,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh) affs_brelse(bh); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); inode_inc_iversion(dir); mark_inode_dirty(dir); @@ -315,7 +315,7 @@ affs_remove_header(struct dentry *dentry) else clear_nlink(inode); affs_unlock_link(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); done: diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 27f77a52c5c8..177bac4def5e 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c @@ -19,6 +19,7 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino) { struct affs_sb_info *sbi = AFFS_SB(sb); struct buffer_head *bh; + struct timespec64 ctime; struct affs_tail *tail; struct inode *inode; u32 block; @@ -149,13 +150,13 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino) break; } - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec - = (be32_to_cpu(tail->change.days) * 86400LL + - be32_to_cpu(tail->change.mins) * 60 + - be32_to_cpu(tail->change.ticks) / 50 + - AFFS_EPOCH_DELTA) + - sys_tz.tz_minuteswest * 60; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0; + ctime.tv_sec = (be32_to_cpu(tail->change.days) * 86400LL + + be32_to_cpu(tail->change.mins) * 60 + + be32_to_cpu(tail->change.ticks) / 50 + + AFFS_EPOCH_DELTA) + + sys_tz.tz_minuteswest * 60; + ctime.tv_nsec = 0; + inode->i_atime = inode->i_mtime = inode_ctime_set(inode, ctime); affs_brelse(bh); unlock_new_inode(inode); return inode; @@ -314,7 +315,7 @@ affs_new_inode(struct inode *dir) inode->i_gid = current_fsgid(); inode->i_ino = block; set_nlink(inode, 1); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); atomic_set(&AFFS_I(inode)->i_opencnt, 0); AFFS_I(inode)->i_blkcnt = 0; AFFS_I(inode)->i_lc = NULL; From patchwork Wed Jun 21 14:45:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4425343vqr; Wed, 21 Jun 2023 07:57:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4tKMEEIVHzkEW7ZHat3e+SE/Hd6Bqh1ppMRKJK8Z3nBzRiwAiMnVCTXLM/7E0gKcg6eSc1 X-Received: by 2002:a05:6a20:2590:b0:10c:38d3:437c with SMTP id k16-20020a056a20259000b0010c38d3437cmr15344709pzd.58.1687359476269; Wed, 21 Jun 2023 07:57:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359476; cv=none; d=google.com; s=arc-20160816; b=f3NGd/H61M2CX+e8MaNmMuSxDLYUxpObRMn97IV7dR/nbxq2a4j92ZOK7CI3vOgqNU Ib97ZEGkvcy3lQ8RoVjqRpU+kwVd/2W+/sJpfWawL5w6NqkdEb2xzjH4TyJEo4ngEGpu hJcv9FpfaiqUFV6CNTaJ2bQiffYs7WQ0pXtuq6kPDGS/zAG+omWv7NrZgczndlCOPMTR IKqpXYmvdBQesc0ZfS1AJvjK/ok1spnJ4tAgd8NRPeY9p/wEHuPGV4zNJ4l6vKt9SvIK knJGMh0MW1xR9f5BIdpMDkBlhzUPKJyXbcnKYR32w5vqS9OnH6K7ODurPPty3xOUOKfq qwXw== 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=S5eqRUAIiHIa2msJ/ZG/iaUNIG/d8xasO8jKMdmjhF4=; b=yLOBQj5TO6kq6PWtNK+SpJFhcXZVaieijJLL6ccTw1WfRcLaIpku72kAjLh5qdF1OG gc1YOGXDNLqZRkF8bHypKCgaXlk2int2gxq7hnuNmDAcXFMxbOC/9X1q83HNXiysX/si NVoW6ooHIfNjqlwcxCrXc4YxF8/rEGpy99KpBymx5CI6Eng6TtiNSLzLCFcYy0z7BmYr nhqDTDgOrBo5iN9nNxXK+4JIcq66TBBpOD+DZ8a124KGF+flSUSBgleVgUa8qXo5mdvL ZPButowI69hrtsmBtylvlY1StW+EOe39h6y/Y9hxwDTlYXTDReV/OomoZKo4U+YXs8Yl M0pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bckakp+L; 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 e124-20020a636982000000b0053ef95fa919si4237477pgc.458.2023.06.21.07.57.43; Wed, 21 Jun 2023 07:57:56 -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=bckakp+L; 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 S232364AbjFUOtD (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232224AbjFUOsF (ORCPT ); Wed, 21 Jun 2023 10:48:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106601BFE for ; Wed, 21 Jun 2023 07:47:53 -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 E63956159D for ; Wed, 21 Jun 2023 14:47:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0A78C433C8; Wed, 21 Jun 2023 14:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358872; bh=BMJaFyF2ZVC60oZAWIdEsruiOWgtQ9irmSkTP/JW+sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bckakp+LrONVjlzggdbjYIPI4kKnFo9QwVnhxj+ne+4JLdr0qnlYBS76QnclgHmUU 4CJ9RxFk8LKz9EW6rS1RTsJV5TZ+xFmbUVCiZAEKSZS6PRMp+inK8EXsAP7VzSjQ2o 6tDSxebppwDZMSATmyBlKhcvexE6c8HwviWAnJNifxjK1bfCBNCPzZGKVoczPadXxN rl1sHe+D2L/ZzDVhPBYBcnGLg/vmYNKNCy1fqXsEkSTVM0WSeTuZsMLOb84mAd/iX4 L5ezuJ/AjGhg6XL7CPRBz3h8UDWMsbZoXiJRDccpcYwqaewkP18jKYe8ga+aQPINxS p0nC04N0/7zlQ== From: Jeff Layton To: Christian Brauner , David Howells , Marc Dionne Cc: Al Viro , Jan Kara , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/79] afs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:24 -0400 Message-ID: <20230621144735.55953-10-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 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?1769324650389479901?= X-GMAIL-MSGID: =?utf-8?q?1769324650389479901?= 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 Reviewed-by: Jan Kara --- fs/afs/dynroot.c | 2 +- fs/afs/inode.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index d7d9402ff718..ee36375de337 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -88,9 +88,9 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root) set_nlink(inode, 2); inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; - inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode); inode->i_blocks = 0; inode->i_generation = 0; + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); set_bit(AFS_VNODE_PSEUDODIR, &vnode->flags); if (!root) { diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 866bab860a88..0b59903c2a43 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -90,7 +90,7 @@ static int afs_inode_init_from_status(struct afs_operation *op, vnode->status = *status; t = status->mtime_client; - inode->i_ctime = t; + inode_ctime_set(inode, t); inode->i_mtime = t; inode->i_atime = t; inode->i_flags |= S_NOATIME; @@ -206,7 +206,7 @@ static void afs_apply_status(struct afs_operation *op, t = status->mtime_client; inode->i_mtime = t; if (vp->update_ctime) - inode->i_ctime = op->ctime; + inode_ctime_set(inode, op->ctime); if (vnode->status.data_version != status->data_version) data_changed = true; @@ -252,7 +252,7 @@ static void afs_apply_status(struct afs_operation *op, vnode->netfs.remote_i_size = status->size; if (change_size) { afs_set_i_size(vnode, status->size); - inode->i_ctime = t; + inode_ctime_set(inode, t); inode->i_atime = t; } } From patchwork Wed Jun 21 14:45:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111075 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424909vqr; Wed, 21 Jun 2023 07:57:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZTQ8S/jKPrN1Mj6SaiQzHgxaPMwT2XaARUocOK/HUYrqAZbMLunovni5DyxHguNt6IMNp X-Received: by 2002:a9d:5a04:0:b0:6b0:cde0:d94 with SMTP id v4-20020a9d5a04000000b006b0cde00d94mr8671006oth.6.1687359427415; Wed, 21 Jun 2023 07:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359427; cv=none; d=google.com; s=arc-20160816; b=k848tPDD1RCVguFs1BF77CErg/t6Y1AtIIMbWoRjvfuiyMXQsiZE+c6VMfNV+O5A6V ZxKF+avjV9tdKlu4YDc6yPR41UwU2ZkMphk8bThPisg4O0JiU3FaazX994WG6o0063Ui iN8pFS96wPmlKJ7mcQIvguFSypTSiKeJ/jLLkKTFcsWYR5eXBfaPbJwTvMVir68wa1tE NGF89eKp5oI8YAnJy+5b2qii3gIKJYd7tzm4TUtpK2nuPyQWuRNVqer1LIw4g5pkLiNk MimH3ikY4HlZOFicCKC6UYR7d+byt6milCzTd+wL796zv0OGi9WUBMEYVxeU+clNw2k9 VR8g== 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=/PynAd+P+RV6CH2QEbpR5QUqRkFUwmsqDr+Pp80hxn0=; b=S3O3L0HJ17yKcP/PqKPc7j72o+WCq59H/k49EDiKNRiFGCJrfp8ccozd4ye2f0N/JP 1Bup8EegKmY7RfJSYfqIjqGswiDhrArziikmmlDsnUWScgFhye8ejb4go/uxo9dzwCXS nhJMES5M6zWCUldbhc+NY1eQ04VbOwcBMeuV2KXLcJD/vOFXxHEfv6h/Xvr0u0SfJ9ce +6j1IAGPM8mJUB1YPpXKqspFs+ztiQ4ObzYR2OP6L12NVNFeDomBjJC8fMcLAgYUQKWl YfxmMduYluYYt1jx9DojhFf6K3lxRLBtjt6BXITm8TevaK/fd3wL6TdHS9a6aRxf5ypo l8Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f6kC0+Xz; 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 n20-20020a637214000000b00553d5cc2c8bsi4211152pgc.508.2023.06.21.07.56.52; Wed, 21 Jun 2023 07:57: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=f6kC0+Xz; 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 S229956AbjFUOtO (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232026AbjFUOsa (ORCPT ); Wed, 21 Jun 2023 10:48:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD67A19AB; Wed, 21 Jun 2023 07:47: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 1C81761536; Wed, 21 Jun 2023 14:47:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE27DC433C8; Wed, 21 Jun 2023 14:47:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358875; bh=MMiHJmJBNyH0712JDFBQLINvQMhdjt5Al9Z5DaYQAOA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f6kC0+XzDaO9aaR2d2QH26S46NyMvGMFpyfpkUyHHnQZkNcVo2QR4IWpE10dRmx0c gJjBKfrFG3dK3aLxdi5ozDCdfXTOKbB/AHPWRwnqM0IgtZHpRPFd11A5wXuOfaPbTE DjpxYC6Sb5EXHL6Fau+1J77wBFTv3EsNz6XX0lnPdJgKk+H1YCCQeaihkWkvw2/g7D ysT4N+AhnHqmaWRjU8bDfSnB8wNRZRpujPwUQB1USSqCnE+BaSaypAUFshv0CMR/Ex fr7lcbdsvZl9zhdP5mjI28tAC39Z/qe8pW1hfVFLBLjy+lSo8bmtYPTFx9a+tY4XL4 mJLu49+a0gZmQ== From: Jeff Layton To: Christian Brauner , Alexander Viro , Eric Biederman , Kees Cook Cc: Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 12/79] fs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:25 -0400 Message-ID: <20230621144735.55953-11-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324598976642412?= X-GMAIL-MSGID: =?utf-8?q?1769324598976642412?= 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 Reviewed-by: Jan Kara --- fs/attr.c | 2 +- fs/bad_inode.c | 3 +-- fs/binfmt_misc.c | 3 +-- fs/inode.c | 12 ++++++++---- fs/libfs.c | 32 +++++++++++++++++--------------- fs/nsfs.c | 2 +- fs/pipe.c | 2 +- fs/posix_acl.c | 2 +- fs/stack.c | 2 +- fs/stat.c | 2 +- include/linux/fs_stack.h | 2 +- 11 files changed, 34 insertions(+), 30 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index d60dc1edb526..2750e5f98dfb 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -312,7 +312,7 @@ void setattr_copy(struct mnt_idmap *idmap, struct inode *inode, if (ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_ctime_set(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { umode_t mode = attr->ia_mode; if (!in_group_or_capable(idmap, inode, diff --git a/fs/bad_inode.c b/fs/bad_inode.c index db649487d58c..bd3762e1b670 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -209,8 +209,7 @@ void make_bad_inode(struct inode *inode) remove_inode_hash(inode); inode->i_mode = S_IFREG; - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_op = &bad_inode_ops; inode->i_opflags &= ~IOP_XATTR; inode->i_fop = &bad_file_ops; diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index bb202ad369d5..6af92eb1b871 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -547,8 +547,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode) if (inode) { inode->i_ino = get_next_ino(); 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); } return inode; } diff --git a/fs/inode.c b/fs/inode.c index c005e7328fbb..a7f484e9e7c1 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1851,6 +1851,7 @@ EXPORT_SYMBOL(bmap); static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, struct timespec64 now) { + struct timespec64 ctime; if (!(mnt->mnt_flags & MNT_RELATIME)) return 1; @@ -1862,7 +1863,8 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, /* * Is ctime younger than or equal to atime? If yes, update atime: */ - if (timespec64_compare(&inode->i_ctime, &inode->i_atime) >= 0) + ctime = inode_ctime_peek(inode); + if (timespec64_compare(&ctime, &inode->i_atime) >= 0) return 1; /* @@ -1885,7 +1887,7 @@ int generic_update_time(struct inode *inode, struct timespec64 *time, int flags) if (flags & S_ATIME) inode->i_atime = *time; if (flags & S_CTIME) - inode->i_ctime = *time; + inode_ctime_set(inode, *time); if (flags & S_MTIME) inode->i_mtime = *time; @@ -2071,6 +2073,7 @@ EXPORT_SYMBOL(file_remove_privs); static int inode_needs_update_time(struct inode *inode, struct timespec64 *now) { int sync_it = 0; + struct timespec64 ctime; /* First try to exhaust all avenues to not sync */ if (IS_NOCMTIME(inode)) @@ -2079,7 +2082,8 @@ static int inode_needs_update_time(struct inode *inode, struct timespec64 *now) if (!timespec64_equal(&inode->i_mtime, now)) sync_it = S_MTIME; - if (!timespec64_equal(&inode->i_ctime, now)) + ctime = inode_ctime_peek(inode); + if (!timespec64_equal(&ctime, now)) sync_it |= S_CTIME; if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) @@ -2510,7 +2514,7 @@ struct timespec64 inode_ctime_set_current(struct inode *inode) { struct timespec64 now = current_time(inode); - inode_set_ctime(inode, now); + inode_ctime_set(inode, now); return now; } EXPORT_SYMBOL(inode_ctime_set_current); diff --git a/fs/libfs.c b/fs/libfs.c index 5b851315eeed..4a914f09fa87 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -275,7 +275,7 @@ void simple_recursive_removal(struct dentry *dentry, while ((child = find_next_child(this, victim)) == NULL) { // kill and ascend // update metadata while it's still locked - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); clear_nlink(inode); inode_unlock(inode); victim = this; @@ -293,8 +293,7 @@ void simple_recursive_removal(struct dentry *dentry, dput(victim); // unpin it } if (victim == dentry) { - inode->i_ctime = inode->i_mtime = - current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (d_is_dir(dentry)) drop_nlink(inode); inode_unlock(inode); @@ -335,7 +334,7 @@ static int pseudo_fs_fill_super(struct super_block *s, struct fs_context *fc) */ root->i_ino = 1; root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; - root->i_atime = root->i_mtime = root->i_ctime = current_time(root); + root->i_atime = root->i_mtime = inode_ctime_set_current(root); s->s_root = d_make_root(root); if (!s->s_root) return -ENOMEM; @@ -391,7 +390,8 @@ int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *den { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + inode_ctime_set_current(inode); + inode->i_mtime = inode_ctime_set_current(dir); inc_nlink(inode); ihold(inode); dget(dentry); @@ -425,7 +425,8 @@ int simple_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + inode_ctime_set_current(inode); + dir->i_mtime = inode_ctime_set_current(dir); drop_nlink(inode); dput(dentry); return 0; @@ -459,10 +460,10 @@ int simple_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, inc_nlink(old_dir); } } - old_dir->i_ctime = old_dir->i_mtime = - new_dir->i_ctime = new_dir->i_mtime = - d_inode(old_dentry)->i_ctime = - d_inode(new_dentry)->i_ctime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); + inode_ctime_set_current(d_inode(old_dentry)); + inode_ctime_set_current(d_inode(new_dentry)); return 0; } @@ -495,8 +496,9 @@ int simple_rename(struct mnt_idmap *idmap, struct inode *old_dir, inc_nlink(new_dir); } - old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = - new_dir->i_mtime = inode->i_ctime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); + inode_ctime_set_current(inode); return 0; } @@ -659,7 +661,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, */ inode->i_ino = 1; inode->i_mode = S_IFDIR | 0755; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; set_nlink(inode, 2); @@ -685,7 +687,7 @@ int simple_fill_super(struct super_block *s, unsigned long magic, goto out; } inode->i_mode = S_IFREG | files->mode; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_fop = files->ops; inode->i_ino = i; d_add(dentry, inode); @@ -1253,7 +1255,7 @@ struct inode *alloc_anon_inode(struct super_block *s) inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); inode->i_flags |= S_PRIVATE; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); return inode; } EXPORT_SYMBOL(alloc_anon_inode); diff --git a/fs/nsfs.c b/fs/nsfs.c index f602a96a1afe..c052cc55eacd 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -84,7 +84,7 @@ static int __ns_get_path(struct path *path, struct ns_common *ns) return -ENOMEM; } inode->i_ino = ns->inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_flags |= S_IMMUTABLE; inode->i_mode = S_IFREG | S_IRUGO; inode->i_fop = &ns_file_operations; diff --git a/fs/pipe.c b/fs/pipe.c index 2d88f73f585a..bb90b6fc4a96 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -899,7 +899,7 @@ static struct inode * get_pipe_inode(void) inode->i_mode = S_IFIFO | S_IRUSR | S_IWUSR; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); return inode; diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 7fa1b738bbab..cc9c390fd2af 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -1027,7 +1027,7 @@ int simple_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, return error; } - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (IS_I_VERSION(inode)) inode_inc_iversion(inode); set_cached_acl(inode, type, acl); diff --git a/fs/stack.c b/fs/stack.c index c9830924eb12..efd0de85bace 100644 --- a/fs/stack.c +++ b/fs/stack.c @@ -68,7 +68,7 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src) dest->i_rdev = src->i_rdev; dest->i_atime = src->i_atime; dest->i_mtime = src->i_mtime; - dest->i_ctime = src->i_ctime; + inode_ctime_set(dest, inode_ctime_peek(src)); dest->i_blkbits = src->i_blkbits; dest->i_flags = src->i_flags; set_nlink(dest, src->i_nlink); diff --git a/fs/stat.c b/fs/stat.c index 7c238da22ef0..5d87e34d6dd5 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -58,7 +58,7 @@ void generic_fillattr(struct mnt_idmap *idmap, struct inode *inode, stat->size = i_size_read(inode); stat->atime = inode->i_atime; stat->mtime = inode->i_mtime; - stat->ctime = inode->i_ctime; + stat->ctime = inode_ctime_peek(inode); stat->blksize = i_blocksize(inode); stat->blocks = inode->i_blocks; } diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h index 54210a42c30d..1488a118fe91 100644 --- a/include/linux/fs_stack.h +++ b/include/linux/fs_stack.h @@ -24,7 +24,7 @@ static inline void fsstack_copy_attr_times(struct inode *dest, { dest->i_atime = src->i_atime; dest->i_mtime = src->i_mtime; - dest->i_ctime = src->i_ctime; + inode_ctime_set(dest, inode_ctime_peek(src)); } #endif /* _LINUX_FS_STACK_H */ From patchwork Wed Jun 21 14:45:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111108 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4440509vqr; Wed, 21 Jun 2023 08:16:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Z5UWq9z0N+kq8vBLmunYj0f5yc8TT0eMwAa1TfvUTeb0pXDlqQkvfSA/h06ZV3y6D2FBD X-Received: by 2002:a17:90b:1c02:b0:25b:be3a:e6ae with SMTP id oc2-20020a17090b1c0200b0025bbe3ae6aemr14527859pjb.18.1687360597045; Wed, 21 Jun 2023 08:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360597; cv=none; d=google.com; s=arc-20160816; b=DnXnbFA0WxHzGFJvyjk2qt2lEolUXTK/leWpa3ICuhcqthWAYfljkk8f4OTMDBoRnh WAg+jezNCTT7R4LJRH0WgQAKVEDiM4OiRv1Pm7HpX/l/zFbTqR9gp36ZE+MerrBm7XEG atPjQk/NeEv5rrpVm6hfeMnM58hRkrfehozxEWoSfGRqdUmKs/cyNx9KKFIah2jRM7ZS RpyI+ANnpY7XFKzCTjFpbtp0t0pSbTV/gfIBg3R084YEw4gZep4Bwuv7wDR4q+acDq7u aAUIqmi7CQZ5swkCDQqGx0C6uZinlwEzMOXhloGgOgXRe7PrN01Uio2aIYEvSfRLGp1G yYIQ== 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=p5FrndnDyZzpNsl/lanLyMCfv5y8DFCDoVhRxKgaJIk=; b=IcthmaS79jP85eNJcXAkbDcJGU21HOdLHQoRvH/wpqmg+PhuNTVq7izK1ztwjNQSYY LfTOg4QXuriMsqZTcO0FpkdA5RJQ6wOSgI2PzpE+e6WnqcODM+mSQHNADgitnRUiWrfU Od9dw1J59/vZzKGFddKMQVL1XxMiYVyDrwj66n/dZEIyEqv7ajqzJpy9Mzq0PSXYvw+U rxbrcJ8cKv3nfu+lO6OqLll7uNic0Xwd77jkQg0aIDfGZmJM47TIaFP0Iz74TGN1T1Zr J9NTAsUZsAeQygIHss9K6SQwdzKqXUV8L/c8FHMtYMtLzHUnK9i6L7SG6s+0CTxagsg9 6I0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sfjrU8aK; 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 om17-20020a17090b3a9100b002473e331f90si4498575pjb.46.2023.06.21.08.16.07; Wed, 21 Jun 2023 08:16:37 -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=sfjrU8aK; 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 S231224AbjFUOtR (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232355AbjFUOsd (ORCPT ); Wed, 21 Jun 2023 10:48:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CDF819A6; Wed, 21 Jun 2023 07:47:58 -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 9545961572; Wed, 21 Jun 2023 14:47:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B956C433C0; Wed, 21 Jun 2023 14:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358877; bh=1s5jb03ngCAy3P6/5pQ4jEHKe8Ls9LBYi2bivIIThCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sfjrU8aKKDtyx20ZuKC+t4c8fe7fTPTGpgT2TMwrgAznX9O0Qr+kcfBOrI7+0KfRc G2GNJaecNaF5zwGYdc4z323q6bxyAiSuTX8JlpTGUX0vI0Z5TbkAq1Vdr4jnPcshyG lpkZPYO5cTGuMrpVO7/0bIh3x/+4zvvLmz/hjvjd2TJESG33nAkUA504I4xGy8GRVa gMgFLAVJeYKLIIv3hptk1Bs2I1a7B/W4+TxcDij+HIqqdhtFJHQJjsI6htekFlDyu6 jo/OUqSMMZiEN9Gr0k8YbMC/+sAf209oCz62i1DbGvF6KI1HfdcJLOweQNtZ9U4S+v 8/bnAVTJpkx2w== From: Jeff Layton To: Christian Brauner , Ian Kent Cc: Al Viro , Jan Kara , autofs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/79] autofs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:26 -0400 Message-ID: <20230621144735.55953-12-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 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?1769325825638752834?= X-GMAIL-MSGID: =?utf-8?q?1769325825638752834?= 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 Reviewed-by: Jan Kara --- fs/autofs/inode.c | 2 +- fs/autofs/root.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/autofs/inode.c b/fs/autofs/inode.c index affa70360b1f..47e3054b29dc 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -370,7 +370,7 @@ struct inode *autofs_get_inode(struct super_block *sb, umode_t mode) inode->i_uid = d_inode(sb->s_root)->i_uid; inode->i_gid = d_inode(sb->s_root)->i_gid; } - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_ino = get_next_ino(); if (S_ISDIR(mode)) { diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 93046c9dc461..4c0fc0f8d688 100644 --- a/fs/autofs/root.c +++ b/fs/autofs/root.c @@ -600,7 +600,7 @@ static int autofs_dir_symlink(struct mnt_idmap *idmap, p_ino = autofs_dentry_ino(dentry->d_parent); p_ino->count++; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); return 0; } @@ -633,7 +633,7 @@ static int autofs_dir_unlink(struct inode *dir, struct dentry *dentry) d_inode(dentry)->i_size = 0; clear_nlink(d_inode(dentry)); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); spin_lock(&sbi->lookup_lock); __autofs_add_expiring(dentry); @@ -749,7 +749,7 @@ static int autofs_dir_mkdir(struct mnt_idmap *idmap, p_ino = autofs_dentry_ino(dentry->d_parent); p_ino->count++; inc_nlink(dir); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); return 0; } From patchwork Wed Jun 21 14:45:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4422020vqr; Wed, 21 Jun 2023 07:51:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Mq0FsIgWTH8Ce3JniMcB18OycZMEghOLun1yXf2GgHmUO/+wfgfUobc3T1AwABIxe58ls X-Received: by 2002:a17:902:74c5:b0:1b1:9272:55f3 with SMTP id f5-20020a17090274c500b001b1927255f3mr5684121plt.66.1687359109237; Wed, 21 Jun 2023 07:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359109; cv=none; d=google.com; s=arc-20160816; b=qROSRBYQrs57XDyy7ZNwU20GzLVEikXe2C84vyPCe/gzvgfY80mVJWb9gjrMu5BZY2 oHJiIiyGD9N+tgjPn/fqMPM2xJ1Qt1So6ct9GmAhGt7D54wLJ+vBUCE+hPjewoE6B2RC DjqNjDA2YeY/3IuQ/sOrMYnPOBo//YsIWi6yI7HCk+F1viPTfYYSkT8O7S3vCk506xoq OhRn4CUi66Oy3oyZpCt+cfTD94n5JKqo8cN8Saii5zd4lwyO3CLsPmSDH7m7ObbOUnLv rm0cMtHBtppW4CIED5SAE6xy1peZ+IUGMtFcpU7xKKWqrjrgkyF9TbjQ58C1FQ458DYX GBig== 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=7kY0VpXPiFi+aC2H54w5KdJRDDiVfcQSvn4yQxAZaEg=; b=nZsaqov/vtZJmrCIifnaR3TeBJeZP3Cv1/cN6Qcjcv/yGSgyV3VvBNZk/aTjrxPVwh YBqmOpjqohNDN0CX2Fv0n88NTC3tbIblcIN/CPthfUutQOlD572Otrn+WF5/AJxMQmXm tStNM5Dmsa/SYF5SDIvKL8swImmZVjVIWucc1TsulUHsVeN1gDydUyeu3sSxHlh3m3Lh cH9XpyAIBXzZFedP47ALcpe4dq1ujM87uE9cAjrJZBXNYgT5sr14vq6pv9qAB6FjEnyP ZWfu5v6u3qnsHs9jgwwvUBqR/RA8cmFaLtdElpdCkbcQrhLGlgvd7+htNpnwarw9hmuc VhxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UzrcMK40; 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 w2-20020a170902ca0200b001b69de1eaecsi1056491pld.489.2023.06.21.07.51.34; Wed, 21 Jun 2023 07:51:49 -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=UzrcMK40; 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 S232166AbjFUOtV (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229926AbjFUOtA (ORCPT ); Wed, 21 Jun 2023 10:49:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5C31FDC for ; Wed, 21 Jun 2023 07:47:59 -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 E8AD56157E for ; Wed, 21 Jun 2023 14:47:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BACD0C433C0; Wed, 21 Jun 2023 14:47:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358878; bh=z+HfjrMuouGlgw7YWfEPcYtDKLy+uS4g+mpDaNbRbAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UzrcMK40y8V7/yiZ8JwB0ucY1cFDYQxsVw1y+ImdfdfOD3JBAcHUXoQG7XLviO77A L3DX2ZOhpXj9OMSCpB72XffBy3G2zQ0Qru57/hZb5z0s6xk3qK35bJeiFgifGc5Q4P JZD08llY246f7cxJ065iEhR0IdG6PQGF3lU7NY9tpEZRXr2p/PIcMxsEdgfIviNFQN rkjBHc0xSiGf76YOUGwq1SRVFKU381Z+L7dSiPHPp5EIcLyAVOEVEpA/wM2i5XXC0Y ylB0LMJQrcDqSWvAClMZj/CwBQgox3oCQkezAPtdlIXZKoPzbEExV8BpDuu7oBYrHc 0Bf2fRcJubjEQ== From: Jeff Layton To: Christian Brauner , Luis de Bethencourt , Salah Triki Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 14/79] befs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:27 -0400 Message-ID: <20230621144735.55953-13-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 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?1769324265400955931?= X-GMAIL-MSGID: =?utf-8?q?1769324265400955931?= 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 Reviewed-by: Jan Kara --- fs/befs/linuxvfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index eee9237386e2..1eee7baa808b 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -363,7 +363,7 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) inode->i_mtime.tv_sec = fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16; inode->i_mtime.tv_nsec = 0; /* lower 16 bits are not a time */ - inode->i_ctime = inode->i_mtime; + inode_ctime_set(inode, inode->i_mtime); inode->i_atime = inode->i_mtime; befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num); From patchwork Wed Jun 21 14:45:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111094 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4435998vqr; Wed, 21 Jun 2023 08:10:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UhQ2nAZOlV1K4AA9bX77MMqb3LPGn61Q9eo9iQrLgnhPEz27U3inYJDLhsEFwo3q274cQ X-Received: by 2002:a17:90b:3b90:b0:25b:f289:c4f3 with SMTP id pc16-20020a17090b3b9000b0025bf289c4f3mr5376213pjb.30.1687360238730; Wed, 21 Jun 2023 08:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360238; cv=none; d=google.com; s=arc-20160816; b=x/yBpTnq8eBXulqseZjupsSLZz2LB8spSBWKjvgmMsc32cGeaZaaRz71PzN03y1EIy +T/wgNcA4e9d5adIIiEymb9pJKw+7Chwb5oqIeUPwzDbOD+ss9Zq7DlPXeh80xtZ68MF ShNOvPFmpBnPU7r1NfWeRaN6rsOjHtIH5uklRznip0Juqh/PQmODhjHp8tQKk+UAr4sd 7p0zXZjVMjDneyE7acUJ7PQQ7BXBtV/ddaI/VabLdMOFsfaIGsHZB6NWsMG89VrMRpe+ z6bZBhdi11JI/4Ic+CKJNv7GamqFBTD0qWWOLmIKxzo89oF+MAlCHR7AHVeV1iTGr6+G jAnw== 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=JE9tuNqyRRWNAa0ivrl1t9OlDIuGTcJGp2hXb2KfAkE=; b=oVKb3JxpQDevn72EbsQHaSfo6iOnDNL7gfBLWv0fJ+ZslFMqg/8rTBzHG09icAvmOi ydCyN4FIi4+vwA2ChwM2K5G9k/sFHj+b7GgwEte9XzOITpvvEyANXBAugt7E5u8UYGt5 ZrnlM5YqQHnBmx/XYj5PhuTqm7zZ4X6cAOd5OIZ6nsYcXa3F1sknGOjHKGOfErhCcV0q BAgSkopRzxjXRpjbsXcwoA20YSaHW0r1MSuFpi26NWDcDXGOW++MHOwRdTIl1ld1KXk1 gIyd84UF+9yRZlSA3rBDkChTDAf7tz1zo4KiUKWgAqjKW7808d/3w6Ame8t0sLTEdZwn E0NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="rzMrX89/"; 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 c4-20020a17090a8d0400b0025979e8c246si429286pjo.70.2023.06.21.08.10.20; Wed, 21 Jun 2023 08:10:38 -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="rzMrX89/"; 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 S232369AbjFUOt2 (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbjFUOtC (ORCPT ); Wed, 21 Jun 2023 10:49:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62C3C1FED for ; Wed, 21 Jun 2023 07:48:01 -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 6F5B1615A9 for ; Wed, 21 Jun 2023 14:48:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4538EC433C9; Wed, 21 Jun 2023 14:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358879; bh=/G/8OrDUR4zym7zlwzSJLF/gNXiLX28yyw4v17vzbjo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rzMrX89/mG8egQ716WPUWY2wp5UXSzO8WvKzz6saR1Iuk7Sba3sLLpRFKYcUg9Gcc Tz6CyvWRMl01l+w6WqPcBdVSzzzCSRSFFjuqYR2gDyWrQEYPEfZoc9RneOFv0G7AiB U9ywc35KYXj2DsWJwrKjoPBj49/MMWGDiLPR/Prh5fcdCSxcxSqQNgu0QbIpzonKLY BTDGc0ob86W2ylUDM2k4DIQFF1JpNI69hy8OZ2MWA6Yj/Q6XaUujOpRwjfClRF2xBl Vkkacmh/fbNnqSmxt6keMV1+mFdiTBZvZsfTZJsKAc36EPM5XKxj6S3ZUO9wfWol2/ xx3F271ESgERA== From: Jeff Layton To: Christian Brauner , "Tigran A. Aivazian" Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 15/79] bfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:28 -0400 Message-ID: <20230621144735.55953-14-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325449616366032?= X-GMAIL-MSGID: =?utf-8?q?1769325449616366032?= 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 --- fs/bfs/dir.c | 16 ++++++++-------- fs/bfs/inode.c | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index d2e8a2a56b05..5bcfc6e481bc 100644 --- a/fs/bfs/dir.c +++ b/fs/bfs/dir.c @@ -97,7 +97,7 @@ static int bfs_create(struct mnt_idmap *idmap, struct inode *dir, set_bit(ino, info->si_imap); info->si_freei--; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_blocks = 0; inode->i_op = &bfs_file_inops; inode->i_fop = &bfs_file_operations; @@ -158,7 +158,7 @@ static int bfs_link(struct dentry *old, struct inode *dir, return err; } inc_nlink(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); ihold(inode); d_instantiate(new, inode); @@ -187,9 +187,9 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry) } de->ino = 0; mark_buffer_dirty_inode(bh, dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); inode_dec_link_count(inode); error = 0; @@ -240,10 +240,10 @@ static int bfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, goto end_rename; } old_de->ino = 0; - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); mark_inode_dirty(old_dir); if (new_inode) { - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); inode_dec_link_count(new_inode); } mark_buffer_dirty_inode(old_bh, old_dir); @@ -292,9 +292,9 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) pos = (block - sblock) * BFS_BSIZE + off; if (pos >= dir->i_size) { dir->i_size += BFS_DIRENT_SIZE; - dir->i_ctime = current_time(dir); + inode_ctime_set_current(dir); } - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); de->ino = cpu_to_le16((u16)ino); for (i = 0; i < BFS_NAMELEN; i++) diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 1926bec2c850..c964316be32b 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -82,10 +82,10 @@ struct inode *bfs_iget(struct super_block *sb, unsigned long ino) inode->i_blocks = BFS_FILEBLOCKS(di); inode->i_atime.tv_sec = le32_to_cpu(di->i_atime); inode->i_mtime.tv_sec = le32_to_cpu(di->i_mtime); - inode->i_ctime.tv_sec = le32_to_cpu(di->i_ctime); + inode_ctime_set_sec(inode, le32_to_cpu(di->i_ctime)); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); brelse(bh); unlock_new_inode(inode); @@ -143,7 +143,7 @@ static int bfs_write_inode(struct inode *inode, struct writeback_control *wbc) di->i_nlink = cpu_to_le32(inode->i_nlink); di->i_atime = cpu_to_le32(inode->i_atime.tv_sec); di->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); - di->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); + di->i_ctime = cpu_to_le32(inode_ctime_peek(inode).tv_sec); i_sblock = BFS_I(inode)->i_sblock; di->i_sblock = cpu_to_le32(i_sblock); di->i_eblock = cpu_to_le32(BFS_I(inode)->i_eblock); From patchwork Wed Jun 21 14:45:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424826vqr; Wed, 21 Jun 2023 07:56:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6IUuBJT4/xyvpJowJHv4YgxLTV8yqr3g9O6Udo9ihLS4PJv8fEjwai1Q30OY8WjiTlkE/9 X-Received: by 2002:a17:90a:9ae:b0:25e:935f:8442 with SMTP id 43-20020a17090a09ae00b0025e935f8442mr13980335pjo.49.1687359418072; Wed, 21 Jun 2023 07:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359418; cv=none; d=google.com; s=arc-20160816; b=HTWR2v+bXl7vuDXVBuFWzQTFUnI8l/xkfb+HanaFcHRF9vFVjOH05ukIktRlh4akA5 s1CQZxOl5uUvxDE/JV7IgA1mzxhacEQUtDpy+fpuQPOFJ4kdnCxIVqgZpOsNb07gFPzJ iuY07odx6ysfTwVA12dWDkQIMpWxxyqa//K6nWL9X1QZbfwnf54oxHpzSSWAsmtM36Ef UoaP2CFpy11xOKMaj0KC0o4MhD/y4G/soSxLhJqZNh5cU50QxbTXn0p+WwDpu90iIwjy aY5Flbyrf/DA3GoRO7n4YH5jgutapn6oJwGUtSaR3cN5HUvJjBwUekUI5BzVks4crCwD 3K/A== 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=F64J6w1aLCm2bQ8MAqDxpgJ5ySBFU0ZM09pWPtWS2Ys=; b=saFtz4aZZY6QZfYNTBkTiV/rFRGjeAJ1shMTXiceQ2QtefMMRCJHGuI8wzXb/icZhY 5JY83rDg7QKMGUel4AU5rBsvmvgYHkJ9MqjguxmRDNsDe2qAr/vb9FthUjOi42dLFMbJ gYDt3mkBIFz7F5M4uOIQie1II4dy7tDixnwycTC4r0tfOO1xWEiHAjhlBGDE5D6qm079 udhWrdBotH4NsXhc0ghvetOj4m2ikGVMbfZLykJD2ASJXuJRGNtxOfvnjaDIGBwM5w3z co18qyu/E8UJS+M36g2Pv9ZQg+zG6eMaFU7VrpbgzpG00mIL1k6iZYrQEk3ZXC1zr57H IfJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NGRs1bpJ; 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 gd11-20020a17090b0fcb00b0024ef1d1151bsi4451492pjb.17.2023.06.21.07.56.43; Wed, 21 Jun 2023 07:56:58 -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=NGRs1bpJ; 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 S232307AbjFUOtl (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232282AbjFUOtE (ORCPT ); Wed, 21 Jun 2023 10:49:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC4011FFA; Wed, 21 Jun 2023 07:48:03 -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 2A86761596; Wed, 21 Jun 2023 14:48:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6FA0C433C0; Wed, 21 Jun 2023 14:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358882; bh=fIVmMROjSP7eFC1hTB3Nz0NZwTRC4KMMjJC9aTSQAxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NGRs1bpJINperFRPLgGWLUgX+H+pf1jS6Z3wMpKt/ATz4Y7Ob6wIXG1vlKyHOWgsS IUVuXS9oelzIrj98MfHn6SzRh44bT5uwMSA1plrjEI8t9Wb5W1Hyym3YGYTR56+KE0 0jZ2GkKqifeuO6ogVij7+7O3qpRN0e7FSr1yBuT50/fbxQctSsg6sSC2DcR92YlJho 46YmDJrZ3hjX+/+S6pheSIqr/W8yiZ0C94wcT4hpnAH0WAC48/vBoLn79C+JGFEJ5v lsw+UiIANlDOmOxoI0r1lvnNjEas5uspm5krxgHUQ3hy2AFuLY1yI1BtycpbE1nSPj /CkdW9tUNRh0w== From: Jeff Layton To: Christian Brauner , Chris Mason , Josef Bacik , David Sterba Cc: Al Viro , Jan Kara , linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/79] btrfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:29 -0400 Message-ID: <20230621144735.55953-15-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 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?1769324589383895317?= X-GMAIL-MSGID: =?utf-8?q?1769324589383895317?= 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 --- fs/btrfs/delayed-inode.c | 10 +++--- fs/btrfs/file.c | 24 +++++---------- fs/btrfs/inode.c | 66 ++++++++++++++++------------------------ fs/btrfs/ioctl.c | 2 +- fs/btrfs/reflink.c | 7 ++--- fs/btrfs/transaction.c | 3 +- fs/btrfs/tree-log.c | 4 +-- fs/btrfs/xattr.c | 4 +-- 8 files changed, 48 insertions(+), 72 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index c0a6a1784697..ae493a4dc206 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1808,9 +1808,9 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans, inode->i_mtime.tv_nsec); btrfs_set_stack_timespec_sec(&inode_item->ctime, - inode->i_ctime.tv_sec); + inode_ctime_peek(inode).tv_sec); btrfs_set_stack_timespec_nsec(&inode_item->ctime, - inode->i_ctime.tv_nsec); + inode_ctime_peek(inode).tv_nsec); btrfs_set_stack_timespec_sec(&inode_item->otime, BTRFS_I(inode)->i_otime.tv_sec); @@ -1861,8 +1861,10 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev) inode->i_mtime.tv_sec = btrfs_stack_timespec_sec(&inode_item->mtime); inode->i_mtime.tv_nsec = btrfs_stack_timespec_nsec(&inode_item->mtime); - inode->i_ctime.tv_sec = btrfs_stack_timespec_sec(&inode_item->ctime); - inode->i_ctime.tv_nsec = btrfs_stack_timespec_nsec(&inode_item->ctime); + inode_ctime_set_sec(inode, + btrfs_stack_timespec_sec(&inode_item->ctime)); + inode_ctime_set_nsec(inode, + btrfs_stack_timespec_nsec(&inode_item->ctime)); BTRFS_I(inode)->i_otime.tv_sec = btrfs_stack_timespec_sec(&inode_item->otime); diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index fd03e689a6be..b4082b322b41 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1108,17 +1108,10 @@ void btrfs_check_nocow_unlock(struct btrfs_inode *inode) static void update_time_for_write(struct inode *inode) { - struct timespec64 now; - if (IS_NOCMTIME(inode)) return; - now = current_time(inode); - if (!timespec64_equal(&inode->i_mtime, &now)) - inode->i_mtime = now; - - if (!timespec64_equal(&inode->i_ctime, &now)) - inode->i_ctime = now; + inode->i_mtime = inode_ctime_set_current(inode); if (IS_I_VERSION(inode)) inode_inc_iversion(inode); @@ -2460,8 +2453,9 @@ int btrfs_replace_file_extents(struct btrfs_inode *inode, inode_inc_iversion(&inode->vfs_inode); if (!extent_info || extent_info->update_times) { - inode->vfs_inode.i_mtime = current_time(&inode->vfs_inode); - inode->vfs_inode.i_ctime = inode->vfs_inode.i_mtime; + struct inode *vinode = &inode->vfs_inode; + + vinode->i_mtime = inode_ctime_set_current(vinode); } ret = btrfs_update_inode(trans, root, inode); @@ -2703,8 +2697,7 @@ static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len) ASSERT(trans != NULL); inode_inc_iversion(inode); - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; + inode->i_mtime = inode_ctime_set_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); updated_inode = true; btrfs_end_transaction(trans); @@ -2721,11 +2714,8 @@ static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len) * for detecting, at fsync time, if the inode isn't yet in the * log tree or it's there but not up to date. */ - struct timespec64 now = current_time(inode); - inode_inc_iversion(inode); - inode->i_mtime = now; - inode->i_ctime = now; + inode->i_mtime = inode_ctime_set_current(inode); trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { ret = PTR_ERR(trans); @@ -2796,7 +2786,7 @@ static int btrfs_fallocate_update_isize(struct inode *inode, if (IS_ERR(trans)) return PTR_ERR(trans); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); i_size_write(inode, end); btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 601fdc956484..4bbb6c6a7516 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3901,8 +3901,10 @@ static int btrfs_read_locked_inode(struct inode *inode, inode->i_mtime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->mtime); inode->i_mtime.tv_nsec = btrfs_timespec_nsec(leaf, &inode_item->mtime); - inode->i_ctime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->ctime); - inode->i_ctime.tv_nsec = btrfs_timespec_nsec(leaf, &inode_item->ctime); + inode_ctime_set_sec(inode, + btrfs_timespec_sec(leaf, &inode_item->ctime)); + inode_ctime_set_nsec(inode, + btrfs_timespec_nsec(leaf, &inode_item->ctime)); BTRFS_I(inode)->i_otime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->otime); @@ -4073,9 +4075,9 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, inode->i_mtime.tv_nsec); btrfs_set_token_timespec_sec(&token, &item->ctime, - inode->i_ctime.tv_sec); + inode_ctime_peek(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode->i_ctime.tv_nsec); + inode_ctime_peek(inode).tv_nsec); btrfs_set_token_timespec_sec(&token, &item->otime, BTRFS_I(inode)->i_otime.tv_sec); @@ -4273,9 +4275,8 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, btrfs_i_size_write(dir, dir->vfs_inode.i_size - name->len * 2); inode_inc_iversion(&inode->vfs_inode); inode_inc_iversion(&dir->vfs_inode); - inode->vfs_inode.i_ctime = current_time(&inode->vfs_inode); - dir->vfs_inode.i_mtime = inode->vfs_inode.i_ctime; - dir->vfs_inode.i_ctime = inode->vfs_inode.i_ctime; + inode_ctime_set_current(&inode->vfs_inode); + dir->vfs_inode.i_mtime = inode_ctime_set_current(&dir->vfs_inode); ret = btrfs_update_inode(trans, root, dir); out: return ret; @@ -4448,8 +4449,7 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, btrfs_i_size_write(dir, dir->vfs_inode.i_size - fname.disk_name.len * 2); inode_inc_iversion(&dir->vfs_inode); - dir->vfs_inode.i_mtime = current_time(&dir->vfs_inode); - dir->vfs_inode.i_ctime = dir->vfs_inode.i_mtime; + dir->vfs_inode.i_mtime = inode_ctime_set_current(&dir->vfs_inode); ret = btrfs_update_inode_fallback(trans, root, dir); if (ret) btrfs_abort_transaction(trans, ret); @@ -5090,10 +5090,8 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr) */ if (newsize != oldsize) { inode_inc_iversion(inode); - if (!(mask & (ATTR_CTIME | ATTR_MTIME))) { - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; - } + if (!(mask & (ATTR_CTIME | ATTR_MTIME))) + inode->i_mtime = inode_ctime_set_current(inode); } if (newsize > oldsize) { @@ -5736,9 +5734,7 @@ static struct inode *new_simple_dir(struct super_block *s, inode->i_opflags &= ~IOP_XATTR; inode->i_fop = &simple_dir_operations; inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; - inode->i_mtime = current_time(inode); - inode->i_atime = inode->i_mtime; - inode->i_ctime = inode->i_mtime; + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); BTRFS_I(inode)->i_otime = inode->i_mtime; return inode; @@ -6075,7 +6071,7 @@ static int btrfs_update_time(struct inode *inode, struct timespec64 *now, if (flags & S_VERSION) dirty |= inode_maybe_inc_iversion(inode, dirty); if (flags & S_CTIME) - inode->i_ctime = *now; + inode_ctime_set(inode, *now); if (flags & S_MTIME) inode->i_mtime = *now; if (flags & S_ATIME) @@ -6378,9 +6374,7 @@ int btrfs_create_new_inode(struct btrfs_trans_handle *trans, goto discard; } - inode->i_mtime = current_time(inode); - inode->i_atime = inode->i_mtime; - inode->i_ctime = inode->i_mtime; + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); BTRFS_I(inode)->i_otime = inode->i_mtime; /* @@ -6545,12 +6539,9 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, * log replay procedure is responsible for setting them to their correct * values (the ones it had when the fsync was done). */ - if (!test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) { - struct timespec64 now = current_time(&parent_inode->vfs_inode); + if (!test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) + parent_inode->vfs_inode.i_mtime = inode_ctime_set_current(&parent_inode->vfs_inode); - parent_inode->vfs_inode.i_mtime = now; - parent_inode->vfs_inode.i_ctime = now; - } ret = btrfs_update_inode(trans, root, parent_inode); if (ret) btrfs_abort_transaction(trans, ret); @@ -6690,7 +6681,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, BTRFS_I(inode)->dir_index = 0ULL; inc_nlink(inode); inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); ihold(inode); set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); @@ -8778,7 +8769,6 @@ static int btrfs_rename_exchange(struct inode *old_dir, struct btrfs_root *dest = BTRFS_I(new_dir)->root; struct inode *new_inode = new_dentry->d_inode; struct inode *old_inode = old_dentry->d_inode; - struct timespec64 ctime = current_time(old_inode); struct btrfs_rename_ctx old_rename_ctx; struct btrfs_rename_ctx new_rename_ctx; u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); @@ -8909,12 +8899,10 @@ static int btrfs_rename_exchange(struct inode *old_dir, inode_inc_iversion(new_dir); inode_inc_iversion(old_inode); inode_inc_iversion(new_inode); - old_dir->i_mtime = ctime; - old_dir->i_ctime = ctime; - new_dir->i_mtime = ctime; - new_dir->i_ctime = ctime; - old_inode->i_ctime = ctime; - new_inode->i_ctime = ctime; + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); + inode_ctime_set_current(old_inode); + inode_ctime_set_current(new_inode); if (old_dentry->d_parent != new_dentry->d_parent) { btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), @@ -9178,11 +9166,9 @@ static int btrfs_rename(struct mnt_idmap *idmap, inode_inc_iversion(old_dir); inode_inc_iversion(new_dir); inode_inc_iversion(old_inode); - old_dir->i_mtime = current_time(old_dir); - old_dir->i_ctime = old_dir->i_mtime; - new_dir->i_mtime = old_dir->i_mtime; - new_dir->i_ctime = old_dir->i_mtime; - old_inode->i_ctime = old_dir->i_mtime; + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); + inode_ctime_set_current(old_inode); if (old_dentry->d_parent != new_dentry->d_parent) btrfs_record_unlink_dir(trans, BTRFS_I(old_dir), @@ -9204,7 +9190,7 @@ static int btrfs_rename(struct mnt_idmap *idmap, if (new_inode) { inode_inc_iversion(new_inode); - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); if (unlikely(btrfs_ino(BTRFS_I(new_inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { ret = btrfs_unlink_subvol(trans, BTRFS_I(new_dir), new_dentry); @@ -9744,7 +9730,7 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode, *alloc_hint = ins.objectid + ins.offset; inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; if (!(mode & FALLOC_FL_KEEP_SIZE) && (actual_len > inode->i_size) && diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a895d105464b..3d50bd67ec85 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -384,7 +384,7 @@ int btrfs_fileattr_set(struct mnt_idmap *idmap, binode->flags = binode_flags; btrfs_sync_inode_flags_to_i_flags(inode); inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); out_end_trans: diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index 0474bbe39da7..3cf4716dea46 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -29,10 +29,9 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans, int ret; inode_inc_iversion(inode); - if (!no_time_update) { - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; - } + if (!no_time_update) + inode->i_mtime = inode_ctime_set_current(inode); + /* * We round up to the block size at eof when determining which * extents to clone above, but shouldn't round up the file size. diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index e7cfc992e02a..138f919646e2 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1831,8 +1831,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, btrfs_i_size_write(BTRFS_I(parent_inode), parent_inode->i_size + fname.disk_name.len * 2); - parent_inode->i_mtime = current_time(parent_inode); - parent_inode->i_ctime = parent_inode->i_mtime; + parent_inode->i_mtime = inode_ctime_set_current(parent_inode); ret = btrfs_update_inode_fallback(trans, parent_root, BTRFS_I(parent_inode)); if (ret) { btrfs_abort_transaction(trans, ret); diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 365a1cc0a3c3..c862d1450365 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4148,9 +4148,9 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, inode->i_mtime.tv_nsec); btrfs_set_token_timespec_sec(&token, &item->ctime, - inode->i_ctime.tv_sec); + inode_ctime_peek(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode->i_ctime.tv_nsec); + inode_ctime_peek(inode).tv_nsec); /* * We do not need to set the nbytes field, in fact during a fast fsync diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index fc4b20c2688a..a2d331436963 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c @@ -264,7 +264,7 @@ int btrfs_setxattr_trans(struct inode *inode, const char *name, goto out; inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); if (ret) btrfs_abort_transaction(trans, ret); @@ -407,7 +407,7 @@ static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler, ret = btrfs_set_prop(trans, inode, name, value, size, flags); if (!ret) { inode_inc_iversion(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); ret = btrfs_update_inode(trans, root, BTRFS_I(inode)); if (ret) btrfs_abort_transaction(trans, ret); From patchwork Wed Jun 21 14:45:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4438555vqr; Wed, 21 Jun 2023 08:14:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7aMnl3RR7QZlutKTXmE6v+BcDFfVwIJjyNTsOyvnxZ/47hOCX7rP06DL6zrAO4sQnRsGx5 X-Received: by 2002:a05:6a20:1601:b0:11f:8a0e:e0cb with SMTP id l1-20020a056a20160100b0011f8a0ee0cbmr15883079pzj.15.1687360449338; Wed, 21 Jun 2023 08:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360449; cv=none; d=google.com; s=arc-20160816; b=yr8ECmP7Hn0YK/qkoWZFK2uo2oNXlW7B3/A1wJb7LR9OsrOz1RSoYO+USPmjaLP/gl WgCC5+EWnAiZJcQypn+RCk08cMSIvFrJKvVRxc2C+kgJGRW6UpDrDGw2weyx5ngrJZfw 2sGWV5r3AmgCUpxqtqPory9fE/M2ZKaOJhh+7H6U94aQf+HWBRVZkjqcJR4FIVAsQGm3 kfHpbRqc4lBzcjJ4g4FYQK786FBMcfJU7jGPXMcPdNGhPFlNUBAtPCBCCwPSXjWsGTGC sQlr2chlyqHFKVIztc1rZKsqs73z68rBpbSOwrQ6qMTA5KCbsPqmX00h5kfzT0D0Z65x 4MNQ== 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=yo6shmKLMdC6A3MBmjYsnUVqNz8kZCsMmdIV4T0BcGg=; b=UIGyBV4GzLtBWqBnUHAySxoReaL5Nq/4+ed8utmWkkDHWXviYpeOk4bNMdCcKS5R/A 0gF5skXzAQ1pnqDxxXn+Oy4kkVZyHKNGD3amS26FHMqy4C/GTz6eNn2TxqVzmsJO4wXh FqBG8cUu3DS2ngDvKOJyQwBgacPynzNWZGFJ9BIpoYoIG9hMgb2jdOHKpO4DpVlyzC/z U8IqEE+Kfu8vQ7dUPmFwjPDM48v8bebcL2CAPRS3ZLXrHMA61CClhbZfVT3Fy/cfVSHy 9DNklWLaw7bfRE+4IzJIkbRiH32PmWjqCtnA7ke/Ac8bTwkrTAPTualu8DM0pAvuJU0o cJkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="uVIbTn//"; 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 z5-20020a170903018500b001b3da77c1f1si4494958plg.194.2023.06.21.08.13.48; Wed, 21 Jun 2023 08:14:09 -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="uVIbTn//"; 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 S232129AbjFUOts (ORCPT + 99 others); Wed, 21 Jun 2023 10:49:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjFUOtJ (ORCPT ); Wed, 21 Jun 2023 10:49:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685CB210A; Wed, 21 Jun 2023 07:48:05 -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 3D266612B7; Wed, 21 Jun 2023 14:48:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED5C6C433C0; Wed, 21 Jun 2023 14:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358884; bh=602OBQOYZOHE47XEi3Ae1spcJ/o1W14lJ8xXHeSF938=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uVIbTn//g7DjaISL0EEFbO0GPceKZ06PB4n+WjFMQZoc/RDOfDFZhVSb083ga5R/M 4dSqFVfWuqNbYsjGSK7MRWKLtXOFsasXs8J+tDJuYrBNEyfEdRH2BDSvbHQTkIuGGn CEzsdrjqjUUw1endMJGRyaed31xVhYykwNdgGsw63ReLPFutJR0hDlpAO58bF6dqLO mbhH2Qnf1mRMVCkO4k2zCuEf3SK5L0DBLSHzKFOxCpMXS5PoJkz8gAly19GGdhO8KF UwQYcCEIeU9eAsLA/SNsX2lJLL4lLrODvwDMtTK7uY41Okagt6xQ0+kTJc4vL7KxzG TSQHJDh1niDqg== From: Jeff Layton To: Christian Brauner , Xiubo Li , Ilya Dryomov Cc: Al Viro , Jan Kara , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/79] ceph: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:30 -0400 Message-ID: <20230621144735.55953-16-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325670679319243?= X-GMAIL-MSGID: =?utf-8?q?1769325670679319243?= 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 Reviewed-by: Xiubo Li --- fs/ceph/acl.c | 2 +- fs/ceph/caps.c | 2 +- fs/ceph/inode.c | 17 ++++++++++------- fs/ceph/snap.c | 2 +- fs/ceph/xattr.c | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c index 6945a938d396..a3de2b9c3a68 100644 --- a/fs/ceph/acl.c +++ b/fs/ceph/acl.c @@ -93,7 +93,7 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, char *value = NULL; struct iattr newattrs; struct inode *inode = d_inode(dentry); - struct timespec64 old_ctime = inode->i_ctime; + struct timespec64 old_ctime = inode_ctime_peek(inode); umode_t new_mode = inode->i_mode, old_mode = inode->i_mode; if (ceph_snap(inode) != CEPH_NOSNAP) { diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 2321e5ddb664..c144a07e334e 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1400,7 +1400,7 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap, arg->mtime = inode->i_mtime; arg->atime = inode->i_atime; - arg->ctime = inode->i_ctime; + arg->ctime = inode_ctime_peek(inode); arg->btime = ci->i_btime; arg->change_attr = inode_peek_iversion_raw(inode); diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 8e5f41d45283..f0b3b11d695e 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -100,7 +100,7 @@ struct inode *ceph_get_snapdir(struct inode *parent) inode->i_uid = parent->i_uid; inode->i_gid = parent->i_gid; inode->i_mtime = parent->i_mtime; - inode->i_ctime = parent->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(parent)); inode->i_atime = parent->i_atime; ci->i_rbytes = 0; ci->i_btime = ceph_inode(parent)->i_btime; @@ -695,12 +695,14 @@ void ceph_fill_file_time(struct inode *inode, int issued, CEPH_CAP_FILE_BUFFER| CEPH_CAP_AUTH_EXCL| CEPH_CAP_XATTR_EXCL)) { + struct timespec64 ictime = inode_ctime_peek(inode); + if (ci->i_version == 0 || - timespec64_compare(ctime, &inode->i_ctime) > 0) { + timespec64_compare(ctime, &ictime) > 0) { dout("ctime %lld.%09ld -> %lld.%09ld inc w/ cap\n", - inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, + ictime.tv_sec, ictime.tv_nsec, ctime->tv_sec, ctime->tv_nsec); - inode->i_ctime = *ctime; + inode_ctime_set(inode, *ctime); } if (ci->i_version == 0 || ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { @@ -738,7 +740,7 @@ void ceph_fill_file_time(struct inode *inode, int issued, } else { /* we have no write|excl caps; whatever the MDS says is true */ if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { - inode->i_ctime = *ctime; + inode_ctime_set(inode, *ctime); inode->i_mtime = *mtime; inode->i_atime = *atime; ci->i_time_warp_seq = time_warp_seq; @@ -2166,7 +2168,8 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) bool only = (ia_valid & (ATTR_SIZE|ATTR_MTIME|ATTR_ATIME| ATTR_MODE|ATTR_UID|ATTR_GID)) == 0; dout("setattr %p ctime %lld.%ld -> %lld.%ld (%s)\n", inode, - inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, + inode_ctime_peek(inode).tv_sec, + inode_ctime_peek(inode).tv_nsec, attr->ia_ctime.tv_sec, attr->ia_ctime.tv_nsec, only ? "ctime only" : "ignored"); if (only) { @@ -2191,7 +2194,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) if (dirtied) { inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, &prealloc_cf); - inode->i_ctime = attr->ia_ctime; + inode_ctime_set(inode, attr->ia_ctime); inode_inc_iversion_raw(inode); } diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 2e73ba62bd7a..f02df070fa84 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -660,7 +660,7 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, capsnap->size = i_size_read(inode); capsnap->mtime = inode->i_mtime; capsnap->atime = inode->i_atime; - capsnap->ctime = inode->i_ctime; + capsnap->ctime = inode_ctime_peek(inode); capsnap->btime = ci->i_btime; capsnap->change_attr = inode_peek_iversion_raw(inode); capsnap->time_warp_seq = ci->i_time_warp_seq; diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 806183959c47..8e217f7f58bd 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -1238,7 +1238,7 @@ int __ceph_setxattr(struct inode *inode, const char *name, dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_XATTR_EXCL, &prealloc_cf); ci->i_xattrs.dirty = true; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } spin_unlock(&ci->i_ceph_lock); From patchwork Wed Jun 21 14:45:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4425212vqr; Wed, 21 Jun 2023 07:57:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JwEx5ZRJfqrZdZO9VqTRAXnjpSh89lHJ9rP97z2OPRO3RnPlZ4avwjCS5cQR7Z2T+QJtY X-Received: by 2002:a05:6808:682:b0:38d:e632:8302 with SMTP id k2-20020a056808068200b0038de6328302mr16103918oig.14.1687359457991; Wed, 21 Jun 2023 07:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359457; cv=none; d=google.com; s=arc-20160816; b=DMF4Ee8MPK+a0bHKm+1k7OFC7RKG7NPF5zKi/sJTMG4D5fZqDIP3lXRiIl3MmDvzXe 7nNdLnUCQI02wvg414q/NdZlaFLbuD8jYUcszOqbEZoa773OHQgLA/w4tSLCMhw3Rm+J CyUo75L4DNz5vryDvF7aynjelRpcd8euGEwvkv70q4pru6biZUDez8eXdv5bF4u/0aIO kuHA9IHDvroRhRGUgot8+iympPaIH/jEOfvsUGfM0cu8O5sZJy1nqlOGMc7vwZSha88L Grw9ErWqapn9ELAEVq77ljtjfGHCvsX0rB71B+z111PP318Z5g+WXXKEoDzZcTBlEI+E ugrA== 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=8TooCwN4mXGYgkYBmFjjoNydAj4nQLTVhq1jqSWw45g=; b=LDOLZf3BZFc1T79rp758j8pnk3jI1LWAbX4OETctZY1nLKWv6rLqTaCjoNrRy0Bz9j 4yDzruS1lhVw10tF362W3gafQFAFwvPfuGY3nN7SdHxwlxHO+7XT/J+Bg63I9ePMfvR6 1cgpytB2EcaU8jUvhbidRooXC+gKeJibsnO9g+7lq9yV5lfEproXd8Brhc0v7dGlH2tU mtEnDRFlDdD/KQo916FjQYhSoUh0IC4jeRdZIiiYm31DZkjuFf1Pcel/59imaWNfhPfN gaHiUZKNwsmF4cdhfqIjwDTksIeuFGhSfXMc4RywRiJu2flIfd9ti1ItqVBzBpgGVzY7 PMww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QOkYLIRE; 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 l186-20020a6391c3000000b005573ea6ead9si380489pge.306.2023.06.21.07.57.24; Wed, 21 Jun 2023 07:57:37 -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=QOkYLIRE; 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 S230386AbjFUOuN (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbjFUOtN (ORCPT ); Wed, 21 Jun 2023 10:49:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F96C2122 for ; Wed, 21 Jun 2023 07:48:10 -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 1AE9761594 for ; Wed, 21 Jun 2023 14:48:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD878C433C9; Wed, 21 Jun 2023 14:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358886; bh=CEB8rkixi7YO82ePUfp2XAfIP0PNDGjkFzVGTxjtP5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QOkYLIREzHCvPajuRMYGs2HkV0oR6hdUH1vR6zgG+zsjyTevjW5ItIzcYe/CB+ixy KWjbmSEJFAD5ZQpayLdbJBI30UYmlA/KVZ5oohC4c/1oKMmNGpImKK5+F9YVUh9ECS 3tOtuM6Wwk6pnf5tddbJSJpJIDSLgzWuwQsNJ7NNnvQwDwutD5qMrw4vODyGKNFeiQ 6DVQNRxG7cZ3XkfaP7zQYH5UaQj6yhCBoGF62g9U1X2mZfbN+HBwjmbvWrvbTNqhqo RJdbzZ7/aU6nhpvaio0M/L2caKuPhjer49gr19DsSe7whjqmZDjb4lnaxYSLLNcOoo errAy2UjieNyg== From: Jeff Layton To: Christian Brauner , Jan Harkes , coda@cs.cmu.edu Cc: Al Viro , Jan Kara , codalist@coda.cs.cmu.edu, linux-kernel@vger.kernel.org Subject: [PATCH 18/79] coda: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:31 -0400 Message-ID: <20230621144735.55953-17-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 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?1769324631151323352?= X-GMAIL-MSGID: =?utf-8?q?1769324631151323352?= 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 --- fs/coda/coda_linux.c | 2 +- fs/coda/dir.c | 2 +- fs/coda/file.c | 2 +- fs/coda/inode.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index 903ca8fa4b9b..2a6187ca52d9 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c @@ -127,7 +127,7 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) if (attr->va_mtime.tv_sec != -1) inode->i_mtime = coda_to_timespec64(attr->va_mtime); if (attr->va_ctime.tv_sec != -1) - inode->i_ctime = coda_to_timespec64(attr->va_ctime); + inode_ctime_set(inode, coda_to_timespec64(attr->va_ctime)); } diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 8450b1bd354b..b158a505570c 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c @@ -111,7 +111,7 @@ static inline void coda_dir_update_mtime(struct inode *dir) /* optimistically we can also act as if our nose bleeds. The * granularity of the mtime is coarse anyways so we might actually be * right most of the time. Note: we only do this for directories. */ - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); #endif } diff --git a/fs/coda/file.c b/fs/coda/file.c index 12b26bd13564..18684d73d085 100644 --- a/fs/coda/file.c +++ b/fs/coda/file.c @@ -84,7 +84,7 @@ coda_file_write_iter(struct kiocb *iocb, struct iov_iter *to) ret = vfs_iter_write(cfi->cfi_container, to, &iocb->ki_pos, 0); coda_inode->i_size = file_inode(host_file)->i_size; coda_inode->i_blocks = (coda_inode->i_size + 511) >> 9; - coda_inode->i_mtime = coda_inode->i_ctime = current_time(coda_inode); + coda_inode->i_mtime = inode_ctime_set_current(coda_inode); inode_unlock(coda_inode); file_end_write(host_file); diff --git a/fs/coda/inode.c b/fs/coda/inode.c index d661e6cf17ac..996729c3041a 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c @@ -269,7 +269,7 @@ int coda_setattr(struct mnt_idmap *idmap, struct dentry *de, memset(&vattr, 0, sizeof(vattr)); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); coda_iattr_to_vattr(iattr, &vattr); vattr.va_type = C_VNON; /* cannot set type */ From patchwork Wed Jun 21 14:45:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111068 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424497vqr; Wed, 21 Jun 2023 07:56:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XyYbydK+OB7X7E5Tk7UxP4avLSCZOusGHAkFfCmlyHC3a7LT+DfU6NpaMi5barRzKfGvX X-Received: by 2002:a17:902:db02:b0:1b6:80e6:7168 with SMTP id m2-20020a170902db0200b001b680e67168mr4499655plx.61.1687359382523; Wed, 21 Jun 2023 07:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359382; cv=none; d=google.com; s=arc-20160816; b=tQAsntxTqb9aWjkDMdE2ilLSi28tLP9WtlhIhoyUfIjK4gjEQ+5uZFKKHUSBrZ56gq k+ZqoqPiPw2a1PoREIdZ91UqqNHz6CoHbSr4nrdzSZeS7pLc6/icr/0xZIUk9DprBMqv t6mDXnir8psp7SM3sY2qKhwAq3N/Ko/xZ50+27/BFyhxyng/5E2U4C1uI9M0FD2zRIja ewN5ja8YY+I1A4PdON8jhYav8CLsYrIca5XmdhtzGeUNoc8QQN/xwLLwaVTl6mK1kuUL hJxFRKAbvReAJrNaw2zU4fh2NxNtuZdQc3IINe+jpt3RaGAxWmJXLxx+aReufoQ3TPfS mxBg== 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=092pz8za8GCC6kjaKYwtg8Ua5SclDn6gsEoA+Ub6Aas=; b=yUdOz0MF2OUjS0RVKlQhHoCmmLu4p2cOCwPqTOJqrGT9yoNeWjHNkX2N0IsnUnZsa4 NOW0X9B/6wUlh7O6ORBkvdSTWKrSn4lm0grFHAXv2hq7aY2KG5xLe3Qq6hsIpNbXww6M gv8LRT9YedUuyHvez2N9FttjiOMVG6UF+gnEMqhydmIDcwUvKuMbc1sYcrOhNUMX+LNO q/pDwQNbq322na+7QyEPUCGOr2ED3ioqCQJB2jxtx5rqq9vN2Xl+LTy6u8R84+yT5OlL UmXKRhvT31qIAkzWJfOeddpNsfxzcuiZcfm2jcyzBXDUx0tw1Q++/nFFI+nQIHBG0u3O gHag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VH4xfG3r; 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 lg15-20020a170902fb8f00b001b382b2d2fdsi2185121plb.144.2023.06.21.07.56.06; Wed, 21 Jun 2023 07:56:22 -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=VH4xfG3r; 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 S232295AbjFUOub (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232244AbjFUOt0 (ORCPT ); Wed, 21 Jun 2023 10:49:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76A5D2680 for ; Wed, 21 Jun 2023 07:48:14 -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 686FD615A1 for ; Wed, 21 Jun 2023 14:48:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AC3EC433C0; Wed, 21 Jun 2023 14:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358887; bh=rS8eAUo4HUuOpWAJVMd8WnT/H+XVhSHn5PZIGcE/ffY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VH4xfG3r0mZawNGCKw4ezDw42voUP+aKbhk48s0Ply0L9PksOUKRfbRYlGLyeL6GY MSboueO6SsAh7qECRSj/3SA7xEpB7+558hNBwgO8ziP8ZCH8jpsZvmLX9h/b0DUyBr 8WRmOS8W7mjUtc0k2mnZPFtXbB12Yn5PtVocI3XuQ4cBhyW6x/afoGtzGf80v/Tiko QCDBS84lljUuHdEA2JTCGMhDeqdv5IVBOae/PCPxl9d5i/n5J5AEXiQHSFMicqM9uq 6Y3r/D0H+IPUEmGLoVdpp9/BwRaqMAn9fCD3as02qJFVacxUOwrUTHhpICJizXrjqt nR2bk7/w3PSvQ== From: Jeff Layton To: Christian Brauner , Joel Becker , Christoph Hellwig Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 19/79] configfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:32 -0400 Message-ID: <20230621144735.55953-18-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 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?1769324551653108315?= X-GMAIL-MSGID: =?utf-8?q?1769324551653108315?= 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 --- fs/configfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index 1c15edbe70ff..21466f7f655f 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -89,7 +89,7 @@ static inline void set_default_inode_attr(struct inode * inode, umode_t mode) { inode->i_mode = mode; inode->i_atime = inode->i_mtime = - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) @@ -99,7 +99,7 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) inode->i_gid = iattr->ia_gid; inode->i_atime = iattr->ia_atime; inode->i_mtime = iattr->ia_mtime; - inode->i_ctime = iattr->ia_ctime; + inode_ctime_set(inode, iattr->ia_ctime); } struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent *sd, @@ -172,7 +172,7 @@ struct inode *configfs_create(struct dentry *dentry, umode_t mode) return ERR_PTR(-ENOMEM); p_inode = d_inode(dentry->d_parent); - p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode); + p_inode->i_mtime = inode_ctime_set_current(p_inode); configfs_set_inode_lock_class(sd, inode); return inode; } From patchwork Wed Jun 21 14:45:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4438740vqr; Wed, 21 Jun 2023 08:14:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6VNyWhLksqMWuNCCPuUSP2nDe/r4zxfnoPQ3M3LLWys5rq4sYYV9ZoNYOAqQ98lJkdnS// X-Received: by 2002:a9d:7609:0:b0:6af:6f82:1e27 with SMTP id k9-20020a9d7609000000b006af6f821e27mr13077828otl.3.1687360463383; Wed, 21 Jun 2023 08:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360463; cv=none; d=google.com; s=arc-20160816; b=gVeEQGZU5jyXsNScJH3Pf1Q4zQSkC4NqY0J8gTmRyV8QlYLLqOmdn3VHFP2e2I/jSL jVYlXDgdSh5efzYhTo/lZ/i3sfcF/5LQtIAvb99x0IDX4aoUp32VKuJ4iJ3eKfcp8huq DiCq7FzFLhV6IUGIUUwwkNRsCG2U67smiua+K6Gabsdoo3hhK9qyXM+MAIuiwaUOoQ5E alQ3D8YEzxRNVKGXhjTvPMMJqmJ/OPbHVWfzhoJLlpL5jkZtkKge50PEfTP1DLnBoGah 3y6ma7wIOD9wttIFcWs5cq+GEeYRWmh93LfN4QOgDierJSKYqUv++acpQI77bTutUIy8 CsNg== 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=ubZepQZUOvE18GQrTqFYdYOuYVBAB7Ea5ZT7oiSRgUE=; b=Oqwto5Tw9etK0FT0avO5aE84QXecuX0NCj3jMBOHOxhcgvoUEQKt9Q6IwN3BkMRMRl OPsgaT87B6QMCRCsjpPehV2RMH4ZOeJZJTlLLqykphTg2nbTx/EcT3L8O/gox8ZtJr1P A/9Qq0TIdWjLmeCR/mI47Hd+Lh1ubOnBqqb4/7/D625PtFT3s9jYX48mqWfwioEGSaHj 6YH29emo7/qSFfmOfZtWSTJkJWD8RJglmf8qx/lGpI68yJ+mKLYVp2+JfiDhuzqvj+nQ reT3SiFzc2T0Nm0jOT85a2i68hvT3y1qi6cgk/pGC+P6znkx5UTiUTnCoOyNrY7XjykI AscQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q9lEJm3h; 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 f16-20020a635110000000b005572b13d220si2117429pgb.343.2023.06.21.08.14.10; Wed, 21 Jun 2023 08:14:23 -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=q9lEJm3h; 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 S232371AbjFUOul (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230050AbjFUOth (ORCPT ); Wed, 21 Jun 2023 10:49:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8809F2690 for ; Wed, 21 Jun 2023 07:48:18 -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 A68AA6159A for ; Wed, 21 Jun 2023 14:48:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CBC3C433C0; Wed, 21 Jun 2023 14:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358889; bh=vzPEOgyxqOCaktmDwbXapks+d0FmANIoL7/H7EX46FQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9lEJm3hzh3HO8gS2e9FdAKLPhWVnCLIlKqURQo59Y8p/5acagZxwfMRNn0wpU27X t1WK0rMIkofFBBodKmiD7OBo20SIc32KHkqiuFwx5eiRlimyvPmz716as7LX2UG4sF vkUhlcunvaafLJKf4CxSjWtkypQ2BcIy0WJkgD9VOam28yzWGfEaYYjlJHUHGZkcC7 cP/fcKwF1229IUK21aAJnYvRa0GpJWpKW2l7puwFrA32Ui7zg2GiR7T19MyA6KFZj1 bNo6MqzwuaX1C2Ptgj12KDHtIYb5JH/NSWcPdy76KRnKa4HjZLtmBsQ6SN9wITd+hx uInwNzb+pCAyg== From: Jeff Layton To: Christian Brauner , Nicolas Pitre Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 20/79] cramfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:33 -0400 Message-ID: <20230621144735.55953-19-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 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?1769325685060786243?= X-GMAIL-MSGID: =?utf-8?q?1769325685060786243?= 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: Nicolas Pitre i_mtime = inode->i_atime = inode->i_ctime = zerotime; + inode->i_mtime = inode->i_atime = inode_ctime_set(inode, zerotime); /* inode->i_nlink is left 1 - arguably wrong for directories, but it's the best we can do without reading the directory contents. 1 yields the right result in GNU find, even From patchwork Wed Jun 21 14:45:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4422371vqr; Wed, 21 Jun 2023 07:52:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Wt+EZNi4PoNltnoLUUBWowqQqPRkpfjUL6mGX7oFPqEHH8z2HKAEEVBvhxcYZvXak4EWx X-Received: by 2002:a17:90a:c905:b0:25e:a36c:46ef with SMTP id v5-20020a17090ac90500b0025ea36c46efmr21460582pjt.13.1687359148042; Wed, 21 Jun 2023 07:52:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359148; cv=none; d=google.com; s=arc-20160816; b=oMPtIP4Tu9frV2tvg632CuXSFF65mBJhseHw4zZqQpW7S4Lw7zJFf+wbNWANZI5Nrs k65cKAerm7DG9hE9pyvsOqNr8+F4apL9n+KOaFWZXDQnyfnGv1eEqFokYkOTKYN30PsC Q2e8yZrhig+Uo01kaU0JMt9tvuVOGJLBFezq8U+58pQNL3777ZKjSsKRK3YxkyfMRV6y fPRNXrdcUKLzPnEcDMaBqVkkP4CEls/2fqAqIJ4uu4nYdbii3FM8/Xbo2+jHVNwx140h 4fOlSBMxllUt2hndhhHidinvarbAHhKx/59aZKqXwH1E4BFfPT/g6gOHl3qr/WW9n9CO LRhg== 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=vgeBm5ZYAeDy1y789gb03JurUkH/yjL8hMHxtLFyIvg=; b=khhcRn+FeYGX2fiUy0wxxB8EC6/BvSu40B6wAgCyYpRkYiey0mnL9R8mxRCfFQsPpP NVhntOQm/MufOVcu88biHSQ0QDkoc8o3NKHspDQ0OGVRyf0cbjFfISAYlF+I0YUqzrE1 OWJMNuFiJjkXNcEhkKkeoS06MWyBpD6YVkm91AA+AotFPyUYEF1+JjnOqXblbuLcasJr QCXg2OE58o1LNnyCtqxjfEGMBGo8ZuFcEP5lA/OcSyprVP1EUXCP+OsOnKDhf8MxeoOq 5pXsGDvPyRtX/SRSIzG110LjDHUT1J8SeTeAhH764EEJgGH9BkGmAd6DeTlYb77LmsSB sxZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qZ54Gl50; 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 gg2-20020a17090b0a0200b00256933298absi12045064pjb.84.2023.06.21.07.52.08; Wed, 21 Jun 2023 07:52:28 -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=qZ54Gl50; 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 S231253AbjFUOuV (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232165AbjFUOtN (ORCPT ); Wed, 21 Jun 2023 10:49:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B20C2128 for ; Wed, 21 Jun 2023 07:48:11 -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 0A99C61536 for ; Wed, 21 Jun 2023 14:48:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C52E1C433C0; Wed, 21 Jun 2023 14:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358890; bh=huZJIp/B9xWSD0X0dlYvUh0CjmXR4oUY7WvD+3absj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qZ54Gl50DxIfN8Z7D1qc9Ee/OkA44CbpKhWtgQQxPz2nKb0w7aceIscGljczPSc87 tj8hCLEDgsUJftRjlFPHA+ir31Gr5ZeHd5bhJwPDDxNNYze+N63PTt/7UN/viTfgDC +7oQezge7lxn5VYH4H6HvxmERUt+StjYcpQo1KT9Vn1GTl9c05B9vD1RQOk9Vclx+y Sds7AIx2TIy0JIg60/6FjANCecOOmBKmhr7CGmgxSIrT6g09VE/5h9MyQIMsyB0x2t kSEDCpTyjygdg/Mqz8QpDdCtk3EVIs11lBtnyis7TFXQkjHUPC2gOu1qnF7RYDL2dg SAgpLvQ76Gz9Q== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman , "Rafael J. Wysocki" Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 21/79] debugfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:34 -0400 Message-ID: <20230621144735.55953-20-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324305887881168?= X-GMAIL-MSGID: =?utf-8?q?1769324305887881168?= 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: Greg Kroah-Hartman --- fs/debugfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 3f81f73c241a..d4932a128c7d 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -73,7 +73,7 @@ static struct inode *debugfs_get_inode(struct super_block *sb) if (inode) { inode->i_ino = get_next_ino(); inode->i_atime = inode->i_mtime = - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } return inode; } From patchwork Wed Jun 21 14:45:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111117 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4444082vqr; Wed, 21 Jun 2023 08:21:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6mVBtbF/xpBf3Kb7u3jW1FQ8Gdeuy37l2TgHE5AZSFILS7u1hDkoQhinYLdLXmMw5GYZKX X-Received: by 2002:a05:6a20:3951:b0:11c:d2af:70a6 with SMTP id r17-20020a056a20395100b0011cd2af70a6mr12295558pzg.28.1687360901538; Wed, 21 Jun 2023 08:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360901; cv=none; d=google.com; s=arc-20160816; b=oxtvSf8AVImVd9GltkyQTYNpbLvJEkmxSK8Q2/vc6lHbE/UZx/gfDyjZmDCLkABrpE uaafQ7DE5vujq7jpJXaSaGh05rCDCjimH7z5A5wGiGZbSzIE0Z90yQwb08V5kNt2PdEe wGZ2PC4zHunxlCHH2WeSlmx5M1TRvL7KdayU8jLm4kjFpRp+p/AzhbZmteFIeymYnxAH EjjPfP83dou7JN/BnhVcwc4XMNZXv0s79d8xyXTpEWUI5lrle+A9K5GWq+ItwD4p1aZh mj7pfxa9vY0slGa1BzVacE7N5qdHxsirkiaHqNkjJidgXQ+5gVOh6NRYN/DmqEJt+teL nmRQ== 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=rVpjOjMo91lyBvn5h0X/X+iplmMom5NEme02/4F+v28=; b=m3ToG1RGz/pDHrzlV+Rp8W4Gz+b2FE3F2KlxZuLj5k6Laf+Vy7u099sR4FAH2L6nFA iw+3u1X3iO94EK5qCKwgjDYz1eRmksvR6cUQST1rpN5WdutBaHpUUG7luNcsTuEkGiHb Iv+P9L+c005fm87uTedEGQ0x1BqhgxmMM8qUIEjbhPgWujTEkPmR3FUy1wMfRZmDyM4z h/hkZ9zFTAo0BTCQDJ9EIGUUdF1JxK+bkj3+S5WWNjOKwPQ1kJoVYs4ZglzkCIWS4eAS m9Il0IBa40EBCzY2avj3/RCgyTmwTmsn6fOxZUMitaEEEhFEuALFQ2gpBfoTF0fZLmX+ rZDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KYSh3AqM; 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 c14-20020aa7952e000000b0063b7c4435c0si4215103pfp.54.2023.06.21.08.21.28; Wed, 21 Jun 2023 08:21:41 -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=KYSh3AqM; 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 S231977AbjFUOup (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbjFUOtt (ORCPT ); Wed, 21 Jun 2023 10:49:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2E861BC3 for ; Wed, 21 Jun 2023 07:48:24 -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 3315E613C5 for ; Wed, 21 Jun 2023 14:48:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CD2AC433C8; Wed, 21 Jun 2023 14:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358891; bh=5t8rFLITGfzR6XTuXeH/73+ofK260Rr39ixm/hKd1DU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KYSh3AqMoFIERVUw1Pzf0yp1iaR4R9WhQ8KCbbh51TQuhTxCGlQ5cP5YPZeooJF2s Nb2F9ZwoPXuUs+6j15VsyhQeEw4HqvTg218FTDVuhVF7S2RvxxmowqyoHeOv+ctxNh gT/HxFOWs7smBPVRBBcuvnanTXlUF2tNH36s5w5CUTXzk/iV7ESXWx+1+SE7uimAL6 0qlnm492vGLOLA3tu53KYA56uBDGuIQ7BiodqU2RMiMtZqnbPc4DnXskZeOcMxeSPI vMXpy4d+kfdVBcKR20t+PFPwzxxL3I8ykCciKnKGYVLLg/vltWkAFgcClw48d2znqh cBdyCgry0AJ3g== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 22/79] devpts: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:35 -0400 Message-ID: <20230621144735.55953-21-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326144636875052?= X-GMAIL-MSGID: =?utf-8?q?1769326144636875052?= 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 --- fs/devpts/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index fe3db0eda8e4..e07ad406cd52 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -338,7 +338,7 @@ static int mknod_ptmx(struct super_block *sb) } inode->i_ino = 2; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); mode = S_IFCHR|opts->ptmxmode; init_special_inode(inode, mode, MKDEV(TTYAUX_MAJOR, 2)); @@ -451,7 +451,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) if (!inode) goto fail; inode->i_ino = 1; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO | S_IWUSR; inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; @@ -560,7 +560,7 @@ struct dentry *devpts_pty_new(struct pts_fs_info *fsi, int index, void *priv) inode->i_ino = index + 3; inode->i_uid = opts->setuid ? opts->uid : current_fsuid(); inode->i_gid = opts->setgid ? opts->gid : current_fsgid(); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index)); sprintf(s, "%d", index); From patchwork Wed Jun 21 14:45:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111067 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424461vqr; Wed, 21 Jun 2023 07:56:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IIFop2uXAhkiW0zw94VvFems22wtBD9JOlKqlOl9UPEFxKfHAznG1pV5n1yg8pyWM9d7c X-Received: by 2002:a05:6a00:801:b0:668:6eed:7c1a with SMTP id m1-20020a056a00080100b006686eed7c1amr15058095pfk.7.1687359379523; Wed, 21 Jun 2023 07:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359379; cv=none; d=google.com; s=arc-20160816; b=xW7TcoyusTFc5Ggqt/CuD2tzIZRvPaZak24wKcJJjHWCPoudmoprGp1NhOTwASp1eL 1DSqIME8Q40p3mGNQ8CEMS06skcIHOjAlNgdxwCiVU7E/ZxoxlDlko6jmCb+DUklrKfp hn0fVWSKpPw09JTVOsCIQgwsSRdlJbBoWtqpRYcH/AzzReiD+4IBLwHiG57DQtobxsmp stO4U+FfQj97ZIXzOgSgxERnrZoSaAPmgtdnAgsamfXcAtFO5r9GVtp1NzBVl9UAj8i1 GUcwe47MnUe4Rx1QHWaa28jHkPaY2OporPqV7NlZ38roEIrmJCWcfO+SNxpXPoPGgZli wwlg== 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=VgFNhHUgEsBi3B0T2/8eRqQ0nWleY8rPGMc8pSaiQGE=; b=u4tTf82TNW25cKBZByVzZuDTzcwKE2faCTYTDBCu38KEK4S7JNq0Wy8wUTVXl7HeVY JXMXCs2v8if/UxJkIEa8o5bYsVXQURgqNvSHNTbOckAs9LW5BFPc9l08bQ2q7k2mUSgy kJjBs8J0enVeOSLGneTl9DvdHDk0soEE7OmFkULmgP6QwjW+wIVgxdfnQoSqTT4zsIh+ 7VBa2bpfXwQdxxFZ3KpnmRf5p8/oEJAN/yLKXAto5ABkaoWlJ83s5u2WJuD61COrrA2A SbdLwcp/CqKFPmIhUwljFeOSJqZGtHharUqUu9QvzfpKpnLa/m/OfENF7LK+L8iQ3qkx Ya3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gSHiEXsK; 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 q10-20020a638c4a000000b005538e9fb8cbsi4078006pgn.550.2023.06.21.07.56.04; Wed, 21 Jun 2023 07:56:19 -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=gSHiEXsK; 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 S232201AbjFUOu0 (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230193AbjFUOtZ (ORCPT ); Wed, 21 Jun 2023 10:49:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B992135; Wed, 21 Jun 2023 07:48:13 -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 8CB456157B; Wed, 21 Jun 2023 14:48:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55919C433C9; Wed, 21 Jun 2023 14:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358893; bh=zkF7XZXkTymtKzVrHDI637HQp5mSePtzjunOQ79N8zE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gSHiEXsKhNqGZ+sB3hwTHXGNior3Vyk10xSUYstyJLFKIlTJSAOcnOQ2r8J35gKv4 hTQgG3n1FDzKuUnLiBOM2ubd4vVWoC1tGAFdUvw8PCKQpszcxBzhXWia3+eKh79s6B uS2vR2lIKa92/++teZMrzYnXERN0GyecvjAunedslC8Ku286r07eMZOWmnPpXt151i ARyuJgLmKm5pmwarGxtAYtFLRQgryXexDZHGYhW1Q4Fe6L+tP6QiTDIWsr2LP7GTHp NykRzV8nRP3w7h5VFEoufujbW+ZihUvJJmL33Lkza8IfhRNn0JonD1p/9u/b2LvNCM DYObIt+Ob7Yaw== From: Jeff Layton To: Christian Brauner , Tyler Hicks Cc: Al Viro , Jan Kara , ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 23/79] ecryptfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:36 -0400 Message-ID: <20230621144735.55953-22-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 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?1769324548885093116?= X-GMAIL-MSGID: =?utf-8?q?1769324548885093116?= 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 --- fs/ecryptfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 83274915ba6d..3171214fdffd 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -148,7 +148,7 @@ static int ecryptfs_do_unlink(struct inode *dir, struct dentry *dentry, } fsstack_copy_attr_times(dir, lower_dir); set_nlink(inode, ecryptfs_inode_to_lower(inode)->i_nlink); - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); out_unlock: dput(lower_dentry); inode_unlock(lower_dir); From patchwork Wed Jun 21 14:45:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4422552vqr; Wed, 21 Jun 2023 07:52:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Ac/smfTH8r/7C7Cl4UlepIOBtFXf73cJiGKLp1lE2GIJSqnaC4pT/XuEyqQckhvq4v+LG X-Received: by 2002:a05:6a20:8f29:b0:122:c6c4:36b1 with SMTP id b41-20020a056a208f2900b00122c6c436b1mr4656608pzk.4.1687359166633; Wed, 21 Jun 2023 07:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359166; cv=none; d=google.com; s=arc-20160816; b=GD1UZJ80TEp3q943bTieZRu5F7SZ4HIQ6CEbN+WVRxwJSBK1tNN3IC/Ocn2/+xcyJW dipZSDY7k0sPuZ3dKYbAgKwOxFcWBS/e8zriYfVOGM3kSn5x2Cr910qx9mddHUW8gIcM ba83NpSorEWPxJjN1QyWc5nEc98Af3Tvuf7sdaXIP11muSpvRZIL3p89LT33JzoVMJNI YIq7K34cpYqR/9sTtVLYKu4J6nGT8DfPmDXf6ADrkGG91H0Rr4cjRDlJupfEud6D9QBW WaJkjKKXpL3upTpwMQJMfO8cvNtaEOO3N9CaRU2APpDLimFM4OHn8mgXYBc7QOr05hkG 5hZw== 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=sSxGg+CogxnAnGmQHvzVUzl/k6ouD+DGnZYQK1olA14=; b=TRvbsjdRN6I2tX1kTOMH8dxa8KChyplXPXZ8OH6XZPXTtE4mipNGw929Pv8zPB/dRi y6hdkwb9FgfFkOI8TxYtBSCmzSV/qzNwQLQ+8H49bYpET+L52E70Jcpwnvf+LbD3d5vr 9gCZjG/KaA/yZNoa0VAyHUskNmOEAucXimgH2Z10uZVQwAJ8VTx7inHRJu08A5I1n47H m96XkCDHZBZed3V1ddeyOHe8Wsa0qaSnvlCqkJT5zqx11kHs/wqN+qHodfhD7Fw8q20z NmlCGGH20F1OU74s6aqURbSeXKTVKYBwKyVFq8hL6OW/3xofbTdWx6XVeE5nXX8VGsV4 fM4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TOFJnser; 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 m24-20020a637d58000000b00553b5116cefsi4577011pgn.16.2023.06.21.07.52.31; Wed, 21 Jun 2023 07:52:46 -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=TOFJnser; 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 S232513AbjFUOvD (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232596AbjFUOt5 (ORCPT ); Wed, 21 Jun 2023 10:49:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35BE32706; Wed, 21 Jun 2023 07:48:31 -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 2A9866159C; Wed, 21 Jun 2023 14:48:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8DB1C433C0; Wed, 21 Jun 2023 14:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358894; bh=mqQ1arKU3cdg9rGg/Z1TIJR7kMVhH2ovyEJKbePVSXs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TOFJnser1Q+dus0mWsxhIzZ0H/k73cm7qt8rrkxiTQY0UoppTPHpAgKLL+rUV+7zj N6OVSRRIVIGtutq/tyJ1yVl9FjRKm/KyrYhIX7MrkQ/v49/kRz4tMJ7qAZdK0t5ffD RPDVYxWzjY8FU0gF0xzYcnXwzMfY2B9gbcxQz6QFDB2OmJJ6AaYRZFsEE80msy+47+ wFDw6KbG28DHTJuKPgGkhH9cghZW/HYIwkibJIqIx+ZwD8Fn7eNijfwRfpJN20Yrv3 RLkFKsnvI32igZbgfjd0t3HNicUAsxDtkKZdaxdaulUww4tic52zmuypU/e8w7Nln2 Zk60lE20C2V/w== From: Jeff Layton To: Christian Brauner , Jeremy Kerr , Ard Biesheuvel Cc: Al Viro , Jan Kara , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 24/79] efivarfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:37 -0400 Message-ID: <20230621144735.55953-23-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324325497761798?= X-GMAIL-MSGID: =?utf-8?q?1769324325497761798?= 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 --- fs/efivarfs/file.c | 2 +- fs/efivarfs/inode.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index 375576111dc3..46b65dfca153 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -51,7 +51,7 @@ static ssize_t efivarfs_file_write(struct file *file, } else { inode_lock(inode); i_size_write(inode, datasize + sizeof(attributes)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); inode_unlock(inode); } diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index b973a2c03dde..a47dded39be8 100644 --- a/fs/efivarfs/inode.c +++ b/fs/efivarfs/inode.c @@ -25,7 +25,7 @@ struct inode *efivarfs_get_inode(struct super_block *sb, if (inode) { inode->i_ino = get_next_ino(); 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); inode->i_flags = is_removable ? 0 : S_IMMUTABLE; switch (mode & S_IFMT) { case S_IFREG: From patchwork Wed Jun 21 14:45:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111070 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424750vqr; Wed, 21 Jun 2023 07:56:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47b5pGlFTMWdKvI2vHorFf6EeQDH+XioN9c+c3WB+maS4mBssU0eHX+RFS4/16wdR1dUu1 X-Received: by 2002:a9d:7609:0:b0:6af:6f82:1e27 with SMTP id k9-20020a9d7609000000b006af6f821e27mr13021545otl.3.1687359408715; Wed, 21 Jun 2023 07:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359408; cv=none; d=google.com; s=arc-20160816; b=rleS+XyiOT7f7P7Ve7VRhTU09BsBNFF2ZJi9R/lGKg6FLM6//FmZKbgAT3KZejMmTw lIJ7r2MTcuwP7aoePMYmfACYa2NO7MZXxdQiUpSpqgISO+1QdBTRI0R7C2b8GB7OFJLF cWGyB663+iZbHcJxFEBN/xXqRw/DZHnOfiDXQD5BIGB52m5m+ieU/klqGpgajikCvhyt Ye03wzwWnt/BLK5JH1RAH53cFdz6A+JHxs2WxLijdn0mrrQayjkZ9gojIixqcaeLtplZ g1apb7BfnD7Y6Kv0jmRXLcy+0mFA15P/zMZ9qL+0d7qyCiyw7ZhythUXDThz9i/R0FD4 5n0w== 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=840xc1uyrcyhGeTQjfZFcFJVpNoKV+cQ4AfmsMqr6L4=; b=KqeUMikLbPe5iyPZJn6D4V9+9gZhLXPhaHhvaaM/Yc1nP8SROQzwqgATu25K1RplFk O70qsSXr9HeE41m6HSwEn5XMKGBgyVQQsF/uRECfx7hNGQi/8f01UFMle+7aNq5dha7V +v/rNWdGw8qHACl2eZHFTPxhbTm6bTrNySnskrWLc4sO8KxDMGT3cjM0/ZhS9zpPMakF TvbbyBym6Gy/PLY0cZPDMMLwU6BZXyrROUnuGXsxn/nBU+63kv9/HKqaN3qYRVPmZbiO CEHFPV5InHleeP9epjTze5jAss6LagaXLxUH2vbz+as8HbZoHwWnuh8MbDQ3J0MftkLS Q3YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xs3Ir3za; 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 h124-20020a636c82000000b0054fd5f23cbbsi4219457pgc.727.2023.06.21.07.56.34; Wed, 21 Jun 2023 07:56:48 -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=Xs3Ir3za; 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 S232532AbjFUOvH (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232611AbjFUOt6 (ORCPT ); Wed, 21 Jun 2023 10:49:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC68A2709 for ; Wed, 21 Jun 2023 07:48:31 -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 4CE976159F for ; Wed, 21 Jun 2023 14:48:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49DA9C433C8; Wed, 21 Jun 2023 14:48:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358895; bh=PaVJkpVh0MegLqLOWSVoL9MGslg86rPr//LDV2xHrbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xs3Ir3zanpeZzXrsGWZMv1ZapRGmlY7QbaFKRfeEmuoSpLJg8Y1jbP8fPad0nf9oS Oe51cFB0Raqx3wHGUpiVYr5PTZhF/gQIuooLYYnK4WZvgqsxTGeHfXwsW7K1oAWE39 gRpsuiSd/OScx6e41jhcjH6AwTGlDyLcDFGEl5HgVaGLCK3CMKJSIRMGnuLLs/Hxbp NvJmRwCUi2uk2BXxoh0Vo0MJz8gTwIpDYdvt4JW9jx+zHUOL2Uk00+Nf4KEGrOhhTu cgYGMSKQbdorfzIcF1po26iLEaTNgAkimQlcK+jBjs9HGg76VXPmoaN64FovIOhfaS 6YOUCckhwLQHw== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 25/79] efs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:38 -0400 Message-ID: <20230621144735.55953-24-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324579647819153?= X-GMAIL-MSGID: =?utf-8?q?1769324579647819153?= 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 --- fs/efs/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 3ba94bb005a6..206978b490e6 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c @@ -105,8 +105,9 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) inode->i_size = be32_to_cpu(efs_inode->di_size); inode->i_atime.tv_sec = be32_to_cpu(efs_inode->di_atime); inode->i_mtime.tv_sec = be32_to_cpu(efs_inode->di_mtime); - inode->i_ctime.tv_sec = be32_to_cpu(efs_inode->di_ctime); - inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, be32_to_cpu(efs_inode->di_ctime)); + inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode_ctime_set_nsec(inode, + 0); /* this is the number of blocks in the file */ if (inode->i_size == 0) { From patchwork Wed Jun 21 14:45:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4445841vqr; Wed, 21 Jun 2023 08:24:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7iBJoYIQYjKCWjkalYTkBsg9pJ/l1g+PBcntD4Owy+l2L1UO9gw8e2plHfLn2ndmG4TaZy X-Received: by 2002:a17:90a:94cc:b0:25e:8cf9:dee4 with SMTP id j12-20020a17090a94cc00b0025e8cf9dee4mr12056544pjw.45.1687361079392; Wed, 21 Jun 2023 08:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687361079; cv=none; d=google.com; s=arc-20160816; b=v0+zdLUYaKhSoIRl9LZDTf9z3F4GypzE2rwl6BR5R6XFfq0rv3g2yLfh97zoHzTysy QadcOThEWTTtb6s55NCzh5LlCq1htFHAooeYgbuEkUGKHmhEAoTuJJGqXXb/tFZ3HrZn HwDXLTKqP+nEgVj+wxg/QyAKHWkuhVWAdaZGrg83m5TGcafEny+BmL8Efo/+A9zdvTAG WNPRMdl1682pd1cz1+YgAsIrU87E5uR4m9inqn94sk1CZX4qO/XadBM98yEwBO6Ak0cF XBpNqMEHg8b+baM7kuhDsjcWRC1vPGFgUKs7XU6vUn0pc8856AxkQVLoXXXw29cMTLcM Rrbg== 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=kc/DyfV1dXHVVmYzSjfJdfGGaKxPGFGYYLNuU5/No+4=; b=O2UPKbg8est4SSER7CG44/n+wbp2KXXz7D9SqtfQapYCeILTMVSoScWdEEufAaA0lE DrDF1p0E6bq1WvPr8/UpAVLtsJvMm72AjBAwYOR2fWD2xA6rfaAu4s/h1d7vCuzrz96O UTksJn9fvXcVFD+tZQAvSnCAqYp+0ykFN2RtRV0lM9s/hpF4Fe6yvq2PcS5uKOJpTKhu dwzjpF14QF13Gui7cGMBB5sjCoJNWVnKo03v5MYW9p1P4llK+74mVmkJe2h06LH7w8hD YV3rSDaCoo1oWpXiPZoD5ylW2IhZ9qQdDehF671NylFr9pLWskKqI0gEz+4ZPH/9OEbQ kQpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hcsmB7v6; 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 o7-20020a17090a3d4700b002563251c8e7si313003pjf.128.2023.06.21.08.24.25; Wed, 21 Jun 2023 08:24:39 -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=hcsmB7v6; 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 S232664AbjFUOwO (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232482AbjFUOu4 (ORCPT ); Wed, 21 Jun 2023 10:50:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F612972 for ; Wed, 21 Jun 2023 07:48:54 -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 E341D6159D for ; Wed, 21 Jun 2023 14:48:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A180C433C0; Wed, 21 Jun 2023 14:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358897; bh=cPzAVbFk9R0HnrShvi8rLzBxv97vtXRMRe2hrktiDrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hcsmB7v6zbEyvEiZhHfjQHIdGckqwKegVeEVgJ4Igrqhii8bcPxx1YnlpDrpZFirt mxZ4y5XlQKvC2fmPnr2y0g7pGzBBgLi3oM4egpOaxz7t2sS/uDiRn4Pwky3B+39Un4 DxF5i0YIVMefv25QXIkzZfvBkc9fbEbs2xRcoYFa+dtuRekYdpqrNaCPEUlCZDKahg pYTF19rBuLHzyN6Imn9cfxrPQSXHdZPZ/FX2vLnzeDGIWU99DBBz34MOlO8F1IFRUh pEGwQ8EqQ+MOwkxxCXi+h+x9kLxdPv1Q3l/lWUzV7oJKvqKHcjQMkHF6e4aoXDDFvy CrYAbHgYPlRrg== From: Jeff Layton To: Christian Brauner , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu Cc: Al Viro , Jan Kara , linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH 26/79] erofs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:39 -0400 Message-ID: <20230621144735.55953-25-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 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?1769326331226211387?= X-GMAIL-MSGID: =?utf-8?q?1769326331226211387?= 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: Gao Xiang --- fs/erofs/inode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index d70b12b81507..8af56d6d0ff3 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -105,8 +105,8 @@ static void *erofs_read_inode(struct erofs_buf *buf, set_nlink(inode, le32_to_cpu(die->i_nlink)); /* extended inode has its own timestamp */ - inode->i_ctime.tv_sec = le64_to_cpu(die->i_mtime); - inode->i_ctime.tv_nsec = le32_to_cpu(die->i_mtime_nsec); + inode_ctime_set_sec(inode, le64_to_cpu(die->i_mtime)); + inode_ctime_set_nsec(inode, le32_to_cpu(die->i_mtime_nsec)); inode->i_size = le64_to_cpu(die->i_size); @@ -148,8 +148,8 @@ static void *erofs_read_inode(struct erofs_buf *buf, set_nlink(inode, le16_to_cpu(dic->i_nlink)); /* use build time for compact inodes */ - inode->i_ctime.tv_sec = sbi->build_time; - inode->i_ctime.tv_nsec = sbi->build_time_nsec; + inode_ctime_set_sec(inode, sbi->build_time); + inode_ctime_set_nsec(inode, sbi->build_time_nsec); inode->i_size = le32_to_cpu(dic->i_size); if (erofs_inode_is_data_compressed(vi->datalayout)) @@ -176,10 +176,10 @@ static void *erofs_read_inode(struct erofs_buf *buf, vi->chunkbits = sb->s_blocksize_bits + (vi->chunkformat & EROFS_CHUNK_FORMAT_BLKBITS_MASK); } - inode->i_mtime.tv_sec = inode->i_ctime.tv_sec; - inode->i_atime.tv_sec = inode->i_ctime.tv_sec; - inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec; - inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec; + inode->i_mtime.tv_sec = inode_ctime_peek(inode).tv_sec; + inode->i_atime.tv_sec = inode_ctime_peek(inode).tv_sec; + inode->i_mtime.tv_nsec = inode_ctime_peek(inode).tv_nsec; + inode->i_atime.tv_nsec = inode_ctime_peek(inode).tv_nsec; inode->i_flags &= ~S_DAX; if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) && From patchwork Wed Jun 21 14:45:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4443156vqr; Wed, 21 Jun 2023 08:20:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6cpl79NmBSy2V20JVTxvC1nfdswYvrv4GD7yLpN6hHtbPdGySaHwsb0rBNkUjwWf1xv0ia X-Received: by 2002:a92:4b02:0:b0:341:28a9:7894 with SMTP id m2-20020a924b02000000b0034128a97894mr14200286ilg.17.1687360823178; Wed, 21 Jun 2023 08:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360823; cv=none; d=google.com; s=arc-20160816; b=Q8fX5ZvrwLSHSwfge4H8f6WF0Zm4g4OLeYdd2Gag+XdXtA02Jyzg7VYK+3UdVfxNNs GeTI4WQCdMu8qEfenqRNORejI+DWaa3cGoc4koxq/gJ4c5ozh4w7puvczekN31Ln6Xbf Q9CjOzuME8P5VcDpBYvEmD332iY/sOkVkj5DXpi575YRJtDxeKppsW4b7DvrBJaRlDZA QUaGARMhTmVC7E0GaYxYyqSDb1Zc+PDCB8Yj4bCpCnQgclfm572jZ8oHRqrNwmDJNUCe SWluz2QESrqs6Q2+m7TaWC8UpgICLB0Ujr6rX6YHlNX/L+7JuJdY4RlYQjabT5fLFmbA elJQ== 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=CFL4QIHD0MyMFq/6aN+yRLUNO3L0WY+odg644SIThgE=; b=U02jBrju28ZNUoWqSKfgF6s7q2b1DU29sHju7I32RXzvgHL8/GNyX3c/IaKcy+ftTh oL8Hm52E5CX7xKzkG7X44uFP9+jo2jVSXrf/jKyKVkwu/oiRMj8Vwfr9iYt3ooqJee6I 7YH4b3BJ6cgTpm9w8kngaiScIEHk9E7/bpLbYbOdk/po4aDCfmEJA9y81LrX7cJ+pAWp 8VcSCz4isp2NZJTOvU0WVtdgvd1SllbP+QaRhzkAiBuHKxz+FPGI+LFNYwhVv2Jc1jxq 3BRar8BrqEshb12TP3oCzaCKt7ew+UfzaGDRE/PZ+AGvSLhBlCR6+puqt76MO7RUMCPt g0lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NtOmmH47; 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 o3-20020a17090ac70300b0025c16677ff5si4458832pjt.143.2023.06.21.08.20.08; Wed, 21 Jun 2023 08:20:23 -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=NtOmmH47; 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 S232366AbjFUOuf (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbjFUOti (ORCPT ); Wed, 21 Jun 2023 10:49:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 088BA2696; Wed, 21 Jun 2023 07:48:20 -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 DB513615A4; Wed, 21 Jun 2023 14:48:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95186C433C8; Wed, 21 Jun 2023 14:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358899; bh=LIKWSKq27vuySougdNpXwsjMra2I7+CzEHpbzH3z7UU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NtOmmH47sfw1a27KJXiqjYUGMseBGBdzfpBybafV7NZdylQXj3xrpy3CgAyTgFXml 4XTw7ka4YJBidlxg7ABIzRLgjk9fqrcq0odwRS8UI4uN3ek3mqFKxnMWWzs0Gw1sc2 WWO4W+JiO82qCirjFFwWwM3E4zB31p42/HctUxsVuKcDCgXaL/+Quy2UZrLPIlw6GS ACSl2TvEDlKfD/HN0BQq5rwY8wg3JJlOtYEz1/VUU5P/kmJFBkOQPK1Xz2Edlt27QK MZr36KXs6zVH8jfiNBBY3ilD9zqu72sCROdhd+IfYyT+D6OXmxegKzt6PtkQv2k8I7 3jE0RNqyZZEvw== From: Jeff Layton To: Christian Brauner , Namjae Jeon , Sungjong Seo Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 27/79] exfat: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:40 -0400 Message-ID: <20230621144735.55953-26-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326062418097115?= X-GMAIL-MSGID: =?utf-8?q?1769326062418097115?= 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 --- fs/exfat/file.c | 4 ++-- fs/exfat/inode.c | 6 +++--- fs/exfat/namei.c | 29 ++++++++++++++--------------- fs/exfat/super.c | 4 ++-- 4 files changed, 21 insertions(+), 22 deletions(-) diff --git a/fs/exfat/file.c b/fs/exfat/file.c index 3cbd270e0cba..853ba8ec4095 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -22,7 +22,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) if (err) return err; - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); if (!IS_SYNC(inode)) @@ -290,7 +290,7 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, } if (attr->ia_valid & ATTR_SIZE) - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); setattr_copy(&nop_mnt_idmap, inode, attr); exfat_truncate_atime(&inode->i_atime); diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 481dd338f2b8..b06b40b7c7b4 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -355,7 +355,7 @@ static void exfat_write_failed(struct address_space *mapping, loff_t to) if (to > i_size_read(inode)) { truncate_pagecache(inode, i_size_read(inode)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); exfat_truncate(inode); } } @@ -398,7 +398,7 @@ static int exfat_write_end(struct file *file, struct address_space *mapping, exfat_write_failed(mapping, pos+len); if (!(err < 0) && !(ei->attr & ATTR_ARCHIVE)) { - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ei->attr |= ATTR_ARCHIVE; mark_inode_dirty(inode); } @@ -577,7 +577,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info) inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9; inode->i_mtime = info->mtime; - inode->i_ctime = info->mtime; + inode_ctime_set(inode, info->mtime); ei->i_crtime = info->crtime; inode->i_atime = info->atime; diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index d9b46fa36bff..a8e6a84e6009 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -569,7 +569,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -582,8 +582,8 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = - EXFAT_I(inode)->i_crtime = current_time(inode); + inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = + inode_ctime_set_current(inode); exfat_truncate_atime(&inode->i_atime); /* timestamp is already written, so mark_inode_dirty() is unneeded. */ @@ -817,7 +817,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); + dir->i_mtime = dir->i_atime = inode_ctime_set_current(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -825,7 +825,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) mark_inode_dirty(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); @@ -852,7 +852,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -866,8 +866,8 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = - EXFAT_I(inode)->i_crtime = current_time(inode); + inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = + inode_ctime_set_current(inode); exfat_truncate_atime(&inode->i_atime); /* timestamp is already written, so mark_inode_dirty() is unneeded. */ @@ -979,7 +979,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) ei->dir.dir = DIR_DELETED; inode_inc_iversion(dir); - dir->i_mtime = dir->i_atime = dir->i_ctime = current_time(dir); + dir->i_mtime = dir->i_atime = inode_ctime_set_current(dir); exfat_truncate_atime(&dir->i_atime); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); @@ -988,7 +988,7 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); exfat_truncate_atime(&inode->i_atime); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); @@ -1312,8 +1312,8 @@ static int exfat_rename(struct mnt_idmap *idmap, goto unlock; inode_inc_iversion(new_dir); - new_dir->i_ctime = new_dir->i_mtime = new_dir->i_atime = - EXFAT_I(new_dir)->i_crtime = current_time(new_dir); + new_dir->i_mtime = new_dir->i_atime = EXFAT_I(new_dir)->i_crtime = + inode_ctime_set_current(new_dir); exfat_truncate_atime(&new_dir->i_atime); if (IS_DIRSYNC(new_dir)) exfat_sync_inode(new_dir); @@ -1336,7 +1336,7 @@ static int exfat_rename(struct mnt_idmap *idmap, } inode_inc_iversion(old_dir); - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); if (IS_DIRSYNC(old_dir)) exfat_sync_inode(old_dir); else @@ -1354,8 +1354,7 @@ static int exfat_rename(struct mnt_idmap *idmap, exfat_warn(sb, "abnormal access to an inode dropped"); WARN_ON(new_inode->i_nlink == 0); } - new_inode->i_ctime = EXFAT_I(new_inode)->i_crtime = - current_time(new_inode); + EXFAT_I(new_inode)->i_crtime = inode_ctime_set_current(new_inode); } unlock: diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 8c32460e031e..f4f3ccedf1bc 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -379,8 +379,8 @@ static int exfat_read_root(struct inode *inode) ei->i_size_ondisk = i_size_read(inode); exfat_save_attr(inode, ATTR_SUBDIR); - inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = - current_time(inode); + inode->i_mtime = inode->i_atime = ei->i_crtime = + inode_ctime_set_current(inode); exfat_truncate_atime(&inode->i_atime); return 0; } From patchwork Wed Jun 21 14:45:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111091 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4434514vqr; Wed, 21 Jun 2023 08:08:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7a8j5xGs6KjN9nAtB63iukzQPgnk+af1RZkmGvnIKj8wkLIrlxQ5RLMdZF5dOULaPiNNS8 X-Received: by 2002:a17:90b:19d0:b0:25b:bd4d:bd18 with SMTP id nm16-20020a17090b19d000b0025bbd4dbd18mr12469373pjb.16.1687360128615; Wed, 21 Jun 2023 08:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360128; cv=none; d=google.com; s=arc-20160816; b=dL09lh9b2+UsFXz2goB3DZHK1Hs9QE3GGg76VJW2jVKEaVYCwA+71zgIqQEs63jCi5 vri7NVIshJ1ZwTdaDHG2wnoetjKDlk/dTxRFujWMi0ZqpUVXYiRAwpDH/URTmtG7VCQ2 4IRwn06jYzQCYBM5M58lwCB/qX+MvJIu3a3THH5vIZXjX1nrYRBsVLHe8J4lV6A/RAZ3 s+fuLoLt64b/DrUemUItb9WRlvvhGwVYaZ9F0bDHVl0i2T3nUwgymb86h+xfWFnbRd4b wiYx0ffzaweRG8+jUs5cboyptYjvf5bPZX0Ct/PvDK++X9UjP2fRFlJ6h4eMAmrJ0RiT +srQ== 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=qawbeKAz/nWz0/ROst570Q3NskTZ7snLHdbbq76n5VI=; b=xuL9AW0Y1qTvzz6h2GTxIC5enxsoeOP4C8e3IyuFq3SUMrXTu2Ljqsn5P6XJy4pYq8 1LRcjgtMX9kmUGH29F5BdSEwTQ3wgzzA/Vo6oLH3BIPMcVOPOhrmKg9Fdswk/haVfBuU rZDHT4mcaTSIH62/tAJG8jEob4gBh9n+KGY2Myn7NZodZfhtytClO8cUZi8mDrQ2VKoZ JRlAav3ycdxKHi92qsDOO32ESjb5r6qQ1j0WoNYyVTH231T/u2fWKJJwrd5l3pSccxqS l8lI+ujoprQxA8lHDPWpAUXh+9I08hudJAdfR5MZ2XBbmrYie4CZAw/pBUWluM7FGKi/ 7Yrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rs2xjVSz; 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 q92-20020a17090a756500b00232f57260c1si12216717pjk.1.2023.06.21.08.08.14; Wed, 21 Jun 2023 08:08:48 -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=Rs2xjVSz; 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 S232586AbjFUOvN (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbjFUOuB (ORCPT ); Wed, 21 Jun 2023 10:50:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00F722710; Wed, 21 Jun 2023 07:48:33 -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 58F0E61572; Wed, 21 Jun 2023 14:48:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AEB7C433C9; Wed, 21 Jun 2023 14:48:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358901; bh=GvA+PGFblfywrWqk+ke/aiuyUUTwDUq+nSfKviTryGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rs2xjVSzzvInpJ7tZPNyivavsFiNSLGpUJrbibO1bDj83l1myWpOmlrzY5OmOZE9j o6SGrrdPNhL24Cftzd3eFw3WpbvzuvP0rZMVHQ+h6DGRfmPTnOXgrxDGiO8RxHd5/x ocMa1qp9FBzp/9pxzXsVARquJ2hXO46OY/BQsp8FzFEvmfkGYvryZsHlDndCdSc6hl Etp0ht2MqOul8Fvax8YBq21fIaiDwUlSWx2iEPaAilbUa2VCJ1EAHmwK08ea/3bDwt wFIWSf24WT+jRVgqfRT/m8JoMyK3LsvA2Jxgp+kE8cWGZyUwb4Aogfvn4PaAXt5lXB W6/m1In1ZVB5Q== From: Jeff Layton To: Christian Brauner , Jan Kara Cc: Al Viro , Jan Kara , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 28/79] ext2: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:41 -0400 Message-ID: <20230621144735.55953-27-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325334144735018?= X-GMAIL-MSGID: =?utf-8?q?1769325334144735018?= 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 --- fs/ext2/acl.c | 2 +- fs/ext2/dir.c | 6 +++--- fs/ext2/ialloc.c | 2 +- fs/ext2/inode.c | 11 ++++++----- fs/ext2/ioctl.c | 4 ++-- fs/ext2/namei.c | 8 ++++---- fs/ext2/super.c | 2 +- fs/ext2/xattr.c | 2 +- 8 files changed, 19 insertions(+), 18 deletions(-) diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 82b17d7fc93f..8f0fc476c423 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c @@ -237,7 +237,7 @@ ext2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, error = __ext2_set_acl(inode, acl, type); if (!error && update_mode) { inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); } return error; diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 42db804794bd..b449599cbf6a 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -468,7 +468,7 @@ int ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, ext2_set_de_type(de, inode); ext2_commit_chunk(page, pos, len); if (update_times) - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; mark_inode_dirty(dir); return ext2_handle_dirsync(dir); @@ -555,7 +555,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode) de->inode = cpu_to_le32(inode->i_ino); ext2_set_de_type (de, inode); ext2_commit_chunk(page, pos, rec_len); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); EXT2_I(dir)->i_flags &= ~EXT2_BTREE_FL; mark_inode_dirty(dir); err = ext2_handle_dirsync(dir); @@ -606,7 +606,7 @@ int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct page *page) pde->rec_len = ext2_rec_len_to_disk(to - from); dir->inode = 0; ext2_commit_chunk(page, pos, to - from); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); EXT2_I(inode)->i_flags &= ~EXT2_BTREE_FL; mark_inode_dirty(inode); return ext2_handle_dirsync(inode); diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index a4e1d7a9c544..3a5bd92ba907 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -549,7 +549,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode, inode->i_ino = ino; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); memset(ei->i_data, 0, sizeof(ei->i_data)); ei->i_flags = ext2_mask_flags(mode, EXT2_I(dir)->i_flags & EXT2_FL_INHERITED); diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 75983215c7a1..318b0b5e8d60 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -595,7 +595,7 @@ static void ext2_splice_branch(struct inode *inode, if (where->bh) mark_buffer_dirty_inode(where->bh, inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); } @@ -1287,7 +1287,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize) __ext2_truncate_blocks(inode, newsize); filemap_invalidate_unlock(inode->i_mapping); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (inode_needs_sync(inode)) { sync_mapping_buffers(inode->i_mapping); sync_inode_metadata(inode, 1); @@ -1409,9 +1409,10 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) set_nlink(inode, le16_to_cpu(raw_inode->i_links_count)); inode->i_size = le32_to_cpu(raw_inode->i_size); inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime); - inode->i_ctime.tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime); + inode_ctime_set_sec(inode, (signed)le32_to_cpu(raw_inode->i_ctime)); inode->i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode->i_mtime); - inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode_ctime_set_nsec(inode, + 0); ei->i_dtime = le32_to_cpu(raw_inode->i_dtime); /* We now have enough fields to check if the inode was active or not. * This is needed because nfsd might try to access dead inodes @@ -1541,7 +1542,7 @@ static int __ext2_write_inode(struct inode *inode, int do_sync) raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); raw_inode->i_size = cpu_to_le32(inode->i_size); raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec); - raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); + raw_inode->i_ctime = cpu_to_le32(inode_ctime_peek(inode).tv_sec); raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); raw_inode->i_blocks = cpu_to_le32(inode->i_blocks); diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index cc87d413eb43..7e1db518d104 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c @@ -44,7 +44,7 @@ int ext2_fileattr_set(struct mnt_idmap *idmap, (fa->flags & EXT2_FL_USER_MODIFIABLE); ext2_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); return 0; @@ -77,7 +77,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } inode_lock(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode->i_generation = generation; inode_unlock(inode); diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c index 937dd8f60f96..2559974afbff 100644 --- a/fs/ext2/namei.c +++ b/fs/ext2/namei.c @@ -211,7 +211,7 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir, if (err) return err; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -291,7 +291,7 @@ static int ext2_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); inode_dec_link_count(inode); err = 0; out: @@ -367,7 +367,7 @@ static int ext2_rename (struct mnt_idmap * idmap, ext2_put_page(new_page, new_de); if (err) goto out_dir; - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -383,7 +383,7 @@ static int ext2_rename (struct mnt_idmap * idmap, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); mark_inode_dirty(old_inode); err = ext2_delete_entry(old_de, old_page); diff --git a/fs/ext2/super.c b/fs/ext2/super.c index f342f347a695..dfb0b95cf4cb 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1587,7 +1587,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type, if (inode->i_size < off+len-towrite) i_size_write(inode, off+len-towrite); inode_inc_iversion(inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); return len - towrite; } diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c index 8906ba479aaf..b05645ba7b1d 100644 --- a/fs/ext2/xattr.c +++ b/fs/ext2/xattr.c @@ -773,7 +773,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh, /* Update the inode. */ EXT2_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (IS_SYNC(inode)) { error = sync_inode_metadata(inode, 1); /* In case sync failed due to ENOSPC the inode was actually From patchwork Wed Jun 21 14:45:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111063 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4422526vqr; Wed, 21 Jun 2023 07:52:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5i42aC5uA88VzanbtprZEWLCLrvSwbylCWL6D4kQbiLR4zXSBNn2OHvvKnkKc0gP7GHDXo X-Received: by 2002:a05:6359:67a0:b0:132:962d:b5d1 with SMTP id sq32-20020a05635967a000b00132962db5d1mr195387rwb.22.1687359163186; Wed, 21 Jun 2023 07:52:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359163; cv=none; d=google.com; s=arc-20160816; b=OPt/CcS/QQyRm2YdAp6SU8pe0jNpm7Ze7iHF6qEl7VR+4Cwoq5aHGL2Jj1qV+I1m7f UUkXFeK6aycjEmJsMtSlS0sCoATdg/Vy3sSjNj9CjwcR6gfycQIp/xd62pXHpJQPK/Hf 2gWuOv2/V2qioDkpchHtyYNnnchXsyJOtAF2B473aeU0iWWJb7yMJThaMyT+K1NwQswk FM7MRVfSuK+132P6RfjtEhqpv9vDWiMAelhMT1mU64NycGS5rkH9ywEjSJIqcJU71+5K AzNmy6ABi3SnOfyJhdriFWugUbvoNXge9eNXNdrKw/NNVR2akI/QBXpj0TFYYddR6h75 YHyQ== 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=eVvffC3By89LcIkDdCbcqMonsN5ncrrqRpyZPpav7x4=; b=W5sYdxR5H/LjjAAIrO62cJ43J0mP7fkG+dMkcG45XW73e2lVBpAU4jB7bJgaqAwNe1 Nw7TwFcSD9PE3deXOkrwbR0X3ZOoe8SQI/15IFv6tjdqxUVlej91bPZ5TVqwAwEJcVkf x1Q/T2IXlOKRJU5MWvSSHxvwvziNJ8rwgBHchgmPhqxk98OicEfpvw57VzkVwwqvBpEK 60GnlbsDsQPY9qKZPgOiEXLdVj0/BVVwLrspmNRGcHuKInnnikeU7bAgsdeVQBm95W5U cAWguOmu1MVjtFWM+PsP7KE8wqTgNtuHsbEILW0AaF5dUnioKL1RjfE0RmyoGn1fJybd tHGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LunRF0FS; 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 i4-20020a63e444000000b005348464b81fsi70167pgk.371.2023.06.21.07.52.27; Wed, 21 Jun 2023 07:52:43 -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=LunRF0FS; 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 S232457AbjFUOuw (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232483AbjFUOtw (ORCPT ); Wed, 21 Jun 2023 10:49:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E0181BD8; Wed, 21 Jun 2023 07:48:25 -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 5149E61598; Wed, 21 Jun 2023 14:48:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DCACC433C8; Wed, 21 Jun 2023 14:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358904; bh=l5qBK3BV2BfPmaqaJ5MDjp4v5bAdyPF6PPNMX0iXUaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LunRF0FS8D9QVMxNck0HiV55r7A1/QVRE5ajWWW9m3a6PvR0ek/sXozX1LGdUnddn OfS88FyIegFZMdt/4s/sdZOt1/gYavvTTC+lxDExCQQHaxxgR+nOtWck8zcdCcCDNB Tx2Pm/MvL8bqF7uOnVDYyVr+pa2WxDTjct5BcF9XCrwKucYEvNsSJYElgSOQIzWs34 B+WGNrBRgdIXeKjsC00dfeR1JrOs8RsJ2OZjIwNyuK1kCC4b1Cksjw78cB0U2mA9fC Tw4627JRJHn0LPfcY82pdlFt6UwcW7/vq4eKC2OK355/S0PbIIJ2U59iRZkAVAYTn8 bXs1Cl+TgpU5A== From: Jeff Layton To: Christian Brauner , "Theodore Ts'o" , Andreas Dilger Cc: Al Viro , Jan Kara , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 29/79] ext4: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:42 -0400 Message-ID: <20230621144735.55953-28-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 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?1769324321652095625?= X-GMAIL-MSGID: =?utf-8?q?1769324321652095625?= 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 --- fs/ext4/acl.c | 2 +- fs/ext4/ext4.h | 20 ++++++++++++++++++++ fs/ext4/extents.c | 12 ++++++------ fs/ext4/ialloc.c | 2 +- fs/ext4/inline.c | 4 ++-- fs/ext4/inode.c | 16 +++++++--------- fs/ext4/ioctl.c | 9 +++++---- fs/ext4/namei.c | 26 ++++++++++++-------------- fs/ext4/super.c | 2 +- fs/ext4/xattr.c | 6 +++--- 10 files changed, 58 insertions(+), 41 deletions(-) diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index 27fcbddfb148..4db1a1d5e552 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c @@ -259,7 +259,7 @@ ext4_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, error = __ext4_set_acl(handle, inode, type, acl, 0 /* xattr_flags */); if (!error && update_mode) { inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); error = ext4_mark_inode_dirty(handle, inode); } out_stop: diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 0a2d55faa095..4262d31f74d8 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -3823,6 +3823,26 @@ static inline int ext4_buffer_uptodate(struct buffer_head *bh) return buffer_uptodate(bh); } +static inline void ext4_inode_set_ctime(struct inode *inode, struct ext4_inode *raw_inode) +{ + struct timespec64 ctime = inode_ctime_peek(inode); + + if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), i_ctime_extra)) { + raw_inode->i_ctime = cpu_to_le32(ctime.tv_sec); + raw_inode->i_ctime_extra = ext4_encode_extra_time(&ctime); + } else { + raw_inode->i_ctime = cpu_to_le32(clamp_t(int32_t, ctime.tv_sec, S32_MIN, S32_MAX)); + } +} + +static inline void ext4_inode_get_ctime(struct inode *inode, const struct ext4_inode *raw_inode) +{ + struct timespec64 ctime = { .tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime) }; + + if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), i_ctime_extra)) + ext4_decode_extra_time(&ctime, raw_inode->i_ctime_extra); + inode_ctime_set(inode, ctime); +} #endif /* __KERNEL__ */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index e4115d338f10..213178a31111 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4476,12 +4476,12 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, map.m_lblk += ret; map.m_len = len = len - ret; epos = (loff_t)map.m_lblk << inode->i_blkbits; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (new_size) { if (epos > new_size) epos = new_size; if (ext4_update_inode_size(inode, epos) & 0x1) - inode->i_mtime = inode->i_ctime; + inode->i_mtime = inode_ctime_peek(inode); } ret2 = ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); @@ -4617,7 +4617,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, /* Now release the pages and zero block aligned part of pages */ truncate_pagecache_range(inode, start, end - 1); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ret = ext4_alloc_file_blocks(file, lblk, max_blocks, new_size, flags); @@ -4642,7 +4642,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, goto out_mutex; } - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (new_size) ext4_update_inode_size(inode, new_size); ret = ext4_mark_inode_dirty(handle, inode); @@ -5378,7 +5378,7 @@ static int ext4_collapse_range(struct file *file, loff_t offset, loff_t len) up_write(&EXT4_I(inode)->i_data_sem); if (IS_SYNC(inode)) ext4_handle_sync(handle); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ret = ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); @@ -5488,7 +5488,7 @@ static int ext4_insert_range(struct file *file, loff_t offset, loff_t len) /* Expand file to avoid data loss if there is error while shifting */ inode->i_size += len; EXT4_I(inode)->i_disksize += len; - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ret = ext4_mark_inode_dirty(handle, inode); if (ret) goto out_stop; diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 754f961cd9fd..03fcfcaf8dd6 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -1250,7 +1250,7 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap, inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); /* This is the optimal IO size (for stat), not the fs block size */ inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); ei->i_crtime = inode->i_mtime; memset(ei->i_data, 0, sizeof(ei->i_data)); diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index a4b7e4bc32d4..678dc459d7f7 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1037,7 +1037,7 @@ static int ext4_add_dirent_to_inline(handle_t *handle, * happen is that the times are slightly out of date * and/or different from the directory change time. */ - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); ext4_update_dx_flag(dir); inode_inc_iversion(dir); return 1; @@ -1991,7 +1991,7 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) ext4_orphan_del(handle, inode); if (err == 0) { - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); err = ext4_mark_inode_dirty(handle, inode); if (IS_SYNC(inode)) ext4_handle_sync(handle); diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 43775a6ca505..ee9586e71246 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3986,7 +3986,7 @@ int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) if (IS_SYNC(inode)) ext4_handle_sync(handle); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ret2 = ext4_mark_inode_dirty(handle, inode); if (unlikely(ret2)) ret = ret2; @@ -4146,7 +4146,7 @@ int ext4_truncate(struct inode *inode) if (inode->i_nlink) ext4_orphan_del(handle, inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); err2 = ext4_mark_inode_dirty(handle, inode); if (unlikely(err2 && !err)) err = err2; @@ -4249,7 +4249,7 @@ static int ext4_fill_raw_inode(struct inode *inode, struct ext4_inode *raw_inode } raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); - EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode); + ext4_inode_set_ctime(inode, raw_inode); EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode); EXT4_EINODE_SET_XTIME(i_crtime, ei, raw_inode); @@ -4858,7 +4858,7 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, } } - EXT4_INODE_GET_XTIME(i_ctime, inode, raw_inode); + ext4_inode_get_ctime(inode, raw_inode); EXT4_INODE_GET_XTIME(i_mtime, inode, raw_inode); EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode); EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode); @@ -4981,7 +4981,7 @@ static void __ext4_update_other_inode_time(struct super_block *sb, spin_unlock(&inode->i_lock); spin_lock(&ei->i_raw_lock); - EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode); + ext4_inode_set_ctime(inode, raw_inode); EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode); ext4_inode_csum_set(inode, raw_inode, ei); @@ -5376,10 +5376,8 @@ int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry, * Update c/mtime on truncate up, ext4_truncate() will * update c/mtime in shrink case below */ - if (!shrink) { - inode->i_mtime = current_time(inode); - inode->i_ctime = inode->i_mtime; - } + if (!shrink) + inode->i_mtime = inode_ctime_set_current(inode); if (shrink) ext4_fc_track_range(handle, inode, diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 961284cc9b65..c212371cf003 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -449,7 +449,8 @@ static long swap_inode_boot_loader(struct super_block *sb, diff = size - size_bl; swap_inode_data(inode, inode_bl); - inode->i_ctime = inode_bl->i_ctime = current_time(inode); + inode_ctime_set_current(inode); + inode_ctime_set_current(inode_bl); inode_inc_iversion(inode); inode->i_generation = get_random_u32(); @@ -663,7 +664,7 @@ static int ext4_ioctl_setflags(struct inode *inode, ext4_set_inode_flags(inode, false); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_iversion(inode); err = ext4_mark_iloc_dirty(handle, inode, &iloc); @@ -774,7 +775,7 @@ static int ext4_ioctl_setproject(struct inode *inode, __u32 projid) } EXT4_I(inode)->i_projid = kprojid; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_iversion(inode); out_dirty: rc = ext4_mark_iloc_dirty(handle, inode, &iloc); @@ -1263,7 +1264,7 @@ static long __ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } err = ext4_reserve_inode_write(handle, inode, &iloc); if (err == 0) { - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_iversion(inode); inode->i_generation = generation; err = ext4_mark_iloc_dirty(handle, inode, &iloc); diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 0caf6c730ce3..63392b06fa5f 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2203,7 +2203,7 @@ static int add_dirent_to_buf(handle_t *handle, struct ext4_filename *fname, * happen is that the times are slightly out of date * and/or different from the directory change time. */ - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); ext4_update_dx_flag(dir); inode_inc_iversion(dir); err2 = ext4_mark_inode_dirty(handle, dir); @@ -3197,7 +3197,8 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) * recovery. */ inode->i_size = 0; ext4_orphan_add(handle, inode); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + inode_ctime_set_current(inode); + dir->i_mtime = inode_ctime_set_current(inode); retval = ext4_mark_inode_dirty(handle, inode); if (retval) goto end_rmdir; @@ -3271,7 +3272,7 @@ int __ext4_unlink(struct inode *dir, const struct qstr *d_name, retval = ext4_delete_entry(handle, dir, de, bh); if (retval) goto out_handle; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); ext4_update_dx_flag(dir); retval = ext4_mark_inode_dirty(handle, dir); if (retval) @@ -3286,7 +3287,7 @@ int __ext4_unlink(struct inode *dir, const struct qstr *d_name, drop_nlink(inode); if (!inode->i_nlink) ext4_orphan_add(handle, inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); retval = ext4_mark_inode_dirty(handle, inode); if (dentry && !retval) ext4_fc_track_unlink(handle, dentry); @@ -3463,7 +3464,7 @@ int __ext4_link(struct inode *dir, struct inode *inode, struct dentry *dentry) if (IS_DIRSYNC(dir)) ext4_handle_sync(handle); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); ext4_inc_count(inode); ihold(inode); @@ -3641,8 +3642,7 @@ static int ext4_setent(handle_t *handle, struct ext4_renament *ent, if (ext4_has_feature_filetype(ent->dir->i_sb)) ent->de->file_type = file_type; inode_inc_iversion(ent->dir); - ent->dir->i_ctime = ent->dir->i_mtime = - current_time(ent->dir); + ent->dir->i_mtime = inode_ctime_set_current(ent->dir); retval = ext4_mark_inode_dirty(handle, ent->dir); BUFFER_TRACE(ent->bh, "call ext4_handle_dirty_metadata"); if (!ent->inlined) { @@ -3941,7 +3941,7 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old.inode->i_ctime = current_time(old.inode); + inode_ctime_set_current(old.inode); retval = ext4_mark_inode_dirty(handle, old.inode); if (unlikely(retval)) goto end_rename; @@ -3955,9 +3955,9 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (new.inode) { ext4_dec_count(new.inode); - new.inode->i_ctime = current_time(new.inode); + inode_ctime_set_current(new.inode); } - old.dir->i_ctime = old.dir->i_mtime = current_time(old.dir); + old.dir->i_mtime = inode_ctime_set_current(old.dir); ext4_update_dx_flag(old.dir); if (old.dir_bh) { retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); @@ -4053,7 +4053,6 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, }; u8 new_file_type; int retval; - struct timespec64 ctime; if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && !projid_eq(EXT4_I(new_dir)->i_projid, @@ -4147,9 +4146,8 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - ctime = current_time(old.inode); - old.inode->i_ctime = ctime; - new.inode->i_ctime = ctime; + inode_ctime_set_current(old.inode); + inode_ctime_set_current(new.inode); retval = ext4_mark_inode_dirty(handle, old.inode); if (unlikely(retval)) goto end_rename; diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 15ea8782222e..27f9a3b96a3e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -7095,7 +7095,7 @@ static int ext4_quota_off(struct super_block *sb, int type) } EXT4_I(inode)->i_flags &= ~(EXT4_NOATIME_FL | EXT4_IMMUTABLE_FL); inode_set_flags(inode, 0, S_NOATIME | S_IMMUTABLE); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); err = ext4_mark_inode_dirty(handle, inode); ext4_journal_stop(handle); out_unlock: diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 321e3a888c20..b405a4314814 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -356,13 +356,13 @@ ext4_xattr_inode_hash(struct ext4_sb_info *sbi, const void *buffer, size_t size) static u64 ext4_xattr_inode_get_ref(struct inode *ea_inode) { - return ((u64)ea_inode->i_ctime.tv_sec << 32) | + return ((u64) inode_ctime_peek(ea_inode).tv_sec << 32) | (u32) inode_peek_iversion_raw(ea_inode); } static void ext4_xattr_inode_set_ref(struct inode *ea_inode, u64 ref_count) { - ea_inode->i_ctime.tv_sec = (u32)(ref_count >> 32); + inode_ctime_set_sec(ea_inode, (u32)(ref_count >> 32)); inode_set_iversion_raw(ea_inode, ref_count & 0xffffffff); } @@ -2459,7 +2459,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index, } if (!error) { ext4_xattr_update_super_block(handle, inode->i_sb); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_iversion(inode); if (!value) no_expand = 0; From patchwork Wed Jun 21 14:45:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111078 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4425427vqr; Wed, 21 Jun 2023 07:58:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Dqmi57ZvYzUDy8grlnXYsQbqvWhKMP1JMC3ZyKZyaF8PNMu2PIzcBvrQrMMGJJfSWrsz5 X-Received: by 2002:a05:6a21:9989:b0:102:7c37:aef2 with SMTP id ve9-20020a056a21998900b001027c37aef2mr11513761pzb.58.1687359488145; Wed, 21 Jun 2023 07:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359488; cv=none; d=google.com; s=arc-20160816; b=Ula5obT9MRuxkToop+259XH1ZG74atoMDOUKoYwBtRU2EvXrSf+JTh7TnABy3BqCUz ax5cLdAwyt7HdiVPPjQrmHIUcQyby8HJNAVODLuF5/xLHhPUOU84Z+tjcntLhcO7dnyC J4P/xPJSBogR4Gev6oZ7lhozahv4xRtPmbyOIurHTA2Ugqvv6/xDqochRPyP9oSZnvyA c/Qy2h7ZjEz16xdBeOg2kJFaBZucxcRRVgsgN9cD00ndIXZEqWQGsKmc8RSRdQXVMCRw zs0B061nzCb1x1beOjbRmrMp/jh6yZG52DLy93sJBQ6m7beDav9lW+zqH6LxyZHiLdIr xxuw== 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=xAoaHQdz6qmOSsjccVssMVl7dEHnjIZRky5iHrE7ZGo=; b=ZKwNTcskXwV8/AaIw3/cjhWS2XA5NPVMrVTexAhYXLe9i5Wh1Dq+Pm77tEX4z0nc1K NPVbsK3XZ7fKkC3JQIDT2HEDls1bfEE4d3odHD0CUwETB3X02v3fhOlNApRr9R/ndGGl WYGXPaTt/zF74No+KaYPM9BsgIwM7sqr4zSqr3qJE7XM1chqxu1m/PR5B3RVZeNSfp6Y Ipk/5Q3oDzOjDSygy1F3Bm+K5oy2l1wE+1Cf354MoG86YEyi5d3qV/w7Ps/ir9HCcWj1 RHen3K3Pbo9K0PhBk7xaGckQpCd2Wios0FHN43CMtXfY9/urVF+whB2Pkl9lcnUQLWux OU9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qrcfgrKO; 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 f62-20020a625141000000b0064d56036aeasi4133123pfb.255.2023.06.21.07.57.56; Wed, 21 Jun 2023 07:58:08 -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=qrcfgrKO; 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 S232479AbjFUOuz (ORCPT + 99 others); Wed, 21 Jun 2023 10:50:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232523AbjFUOty (ORCPT ); Wed, 21 Jun 2023 10:49:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3938D26B5 for ; Wed, 21 Jun 2023 07:48:28 -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 19331612B7 for ; Wed, 21 Jun 2023 14:48:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB038C433C0; Wed, 21 Jun 2023 14:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358907; bh=eW0bBiExQ+iQquf9GOgwJKb2GfWfiHdHY/cW0o1EVYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qrcfgrKOvB4pYG/UbKWscFa0DnNwcJJGmgFGNiKmEXXYe7WNOMuClv1PtzPmJHAXJ 1Pd5c0M28rGG91fw4G5JFkLqL3IK/aiV7dP2EJAInehnL1nSNS8evJ6lDhzEU9Nasc 99PdmipCJ2ZNwt37sJCX5EX7+rEtgmha0bO28H0M4ZURJi/SBfIDtVH6Anv85UzyAA Dxz99Nax9MQ9YxcE7amYaiaXJU48fUw5y8SnnaMcT5NJOIT60jXU9ptRLR8ib4whBu 2f+OvyFzYdvZ01j8z8wjNQ25IU7Rt5jzNf0TGcBMg73R7XMr6GsFq86BonyiWDuLRb hPpHO8rmxnH2Q== From: Jeff Layton To: Christian Brauner , Jaegeuk Kim , Chao Yu Cc: Al Viro , Jan Kara , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 30/79] f2fs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:43 -0400 Message-ID: <20230621144735.55953-29-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324662705613797?= X-GMAIL-MSGID: =?utf-8?q?1769324662705613797?= 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 --- fs/f2fs/dir.c | 8 ++++---- fs/f2fs/f2fs.h | 5 ++++- fs/f2fs/file.c | 16 ++++++++-------- fs/f2fs/inline.c | 2 +- fs/f2fs/inode.c | 10 +++++----- fs/f2fs/namei.c | 12 ++++++------ fs/f2fs/recovery.c | 4 ++-- fs/f2fs/super.c | 2 +- fs/f2fs/xattr.c | 2 +- 9 files changed, 32 insertions(+), 29 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 887e55988450..54fa7285e2d6 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -455,7 +455,7 @@ void f2fs_set_link(struct inode *dir, struct f2fs_dir_entry *de, de->file_type = fs_umode_to_ftype(inode->i_mode); set_page_dirty(page); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); f2fs_mark_inode_dirty_sync(dir, false); f2fs_put_page(page, 1); } @@ -609,7 +609,7 @@ void f2fs_update_parent_metadata(struct inode *dir, struct inode *inode, f2fs_i_links_write(dir, true); clear_inode_flag(inode, FI_NEW_INODE); } - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); f2fs_mark_inode_dirty_sync(dir, false); if (F2FS_I(dir)->i_current_depth != current_depth) @@ -851,7 +851,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode) if (S_ISDIR(inode->i_mode)) f2fs_i_links_write(dir, false); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); f2fs_i_links_write(inode, false); if (S_ISDIR(inode->i_mode)) { @@ -912,7 +912,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, } f2fs_put_page(page, 1); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); f2fs_mark_inode_dirty_sync(dir, false); if (inode) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 7b9af2d51656..b0a0de41f823 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3302,9 +3302,12 @@ static inline void clear_file(struct inode *inode, int type) static inline bool f2fs_is_time_consistent(struct inode *inode) { + struct timespec64 ctime; + if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime)) return false; - if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime)) + ctime = inode_ctime_peek(inode); + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &ctime)) return false; if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) return false; diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 38688b5192ef..76c38cd89865 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -809,7 +809,7 @@ int f2fs_truncate(struct inode *inode) if (err) return err; - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); f2fs_mark_inode_dirty_sync(inode, false); return 0; } @@ -920,7 +920,7 @@ static void __setattr_copy(struct mnt_idmap *idmap, if (ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_ctime_set(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { umode_t mode = attr->ia_mode; vfsgid_t vfsgid = i_gid_into_vfsgid(idmap, inode); @@ -1023,7 +1023,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, return err; spin_lock(&F2FS_I(inode)->i_size_lock); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); F2FS_I(inode)->last_disk_size = i_size_read(inode); spin_unlock(&F2FS_I(inode)->i_size_lock); } @@ -1850,7 +1850,7 @@ static long f2fs_fallocate(struct file *file, int mode, } if (!ret) { - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); f2fs_mark_inode_dirty_sync(inode, false); f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); } @@ -1952,7 +1952,7 @@ static int f2fs_setflags_common(struct inode *inode, u32 iflags, u32 mask) else clear_inode_flag(inode, FI_PROJ_INHERIT); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); f2fs_set_inode_flags(inode); f2fs_mark_inode_dirty_sync(inode, true); return 0; @@ -3077,7 +3077,7 @@ static int f2fs_ioc_setproject(struct inode *inode, __u32 projid) goto out_unlock; fi->i_projid = kprojid; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); f2fs_mark_inode_dirty_sync(inode, true); out_unlock: f2fs_unlock_op(sbi); @@ -3510,7 +3510,7 @@ static int f2fs_release_compress_blocks(struct file *filp, unsigned long arg) goto out; set_inode_flag(inode, FI_COMPRESS_RELEASED); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); f2fs_mark_inode_dirty_sync(inode, true); if (!atomic_read(&F2FS_I(inode)->i_compr_blocks)) @@ -3712,7 +3712,7 @@ static int f2fs_reserve_compress_blocks(struct file *filp, unsigned long arg) if (ret >= 0) { clear_inode_flag(inode, FI_COMPRESS_RELEASED); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); f2fs_mark_inode_dirty_sync(inode, true); } unlock_inode: diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 4638fee16a91..72bb5340b088 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -698,7 +698,7 @@ void f2fs_delete_inline_entry(struct f2fs_dir_entry *dentry, struct page *page, set_page_dirty(page); f2fs_put_page(page, 1); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); f2fs_mark_inode_dirty_sync(dir, false); if (inode) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 09e986b050c6..95b89e48a159 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -403,7 +403,7 @@ static void init_idisk_time(struct inode *inode) struct f2fs_inode_info *fi = F2FS_I(inode); fi->i_disk_time[0] = inode->i_atime; - fi->i_disk_time[1] = inode->i_ctime; + fi->i_disk_time[1] = inode_ctime_peek(inode); fi->i_disk_time[2] = inode->i_mtime; } @@ -434,10 +434,10 @@ static int do_read_inode(struct inode *inode) inode->i_blocks = SECTOR_FROM_BLOCK(le64_to_cpu(ri->i_blocks) - 1); inode->i_atime.tv_sec = le64_to_cpu(ri->i_atime); - inode->i_ctime.tv_sec = le64_to_cpu(ri->i_ctime); + inode_ctime_set_sec(inode, le64_to_cpu(ri->i_ctime)); inode->i_mtime.tv_sec = le64_to_cpu(ri->i_mtime); inode->i_atime.tv_nsec = le32_to_cpu(ri->i_atime_nsec); - inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec); + inode_ctime_set_nsec(inode, le32_to_cpu(ri->i_ctime_nsec)); inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec); inode->i_generation = le32_to_cpu(ri->i_generation); if (S_ISDIR(inode->i_mode)) @@ -714,10 +714,10 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) set_raw_inline(inode, ri); ri->i_atime = cpu_to_le64(inode->i_atime.tv_sec); - ri->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); + ri->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); ri->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); ri->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); - ri->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + ri->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ri->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); if (S_ISDIR(inode->i_mode)) ri->i_current_depth = diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 614c33f0f17e..c7876c5d74a6 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -233,7 +233,7 @@ static struct inode *f2fs_new_inode(struct mnt_idmap *idmap, inode->i_ino = ino; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); F2FS_I(inode)->i_crtime = inode->i_mtime; inode->i_generation = get_random_u32(); @@ -410,7 +410,7 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir, f2fs_balance_fs(sbi, true); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); ihold(inode); set_inode_flag(inode, FI_INC_LINK); @@ -1042,7 +1042,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir, f2fs_set_link(new_dir, new_entry, new_page, old_inode); new_page = NULL; - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); f2fs_down_write(&F2FS_I(new_inode)->i_sem); if (old_dir_entry) f2fs_i_links_write(new_inode, false); @@ -1076,7 +1076,7 @@ static int f2fs_rename(struct mnt_idmap *idmap, struct inode *old_dir, f2fs_i_pino_write(old_inode, new_dir->i_ino); f2fs_up_write(&F2FS_I(old_inode)->i_sem); - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); f2fs_mark_inode_dirty_sync(old_inode, false); f2fs_delete_entry(old_entry, old_page, old_dir, NULL); @@ -1241,7 +1241,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, f2fs_i_pino_write(old_inode, new_dir->i_ino); f2fs_up_write(&F2FS_I(old_inode)->i_sem); - old_dir->i_ctime = current_time(old_dir); + inode_ctime_set_current(old_dir); if (old_nlink) { f2fs_down_write(&F2FS_I(old_dir)->i_sem); f2fs_i_links_write(old_dir, old_nlink > 0); @@ -1260,7 +1260,7 @@ static int f2fs_cross_rename(struct inode *old_dir, struct dentry *old_dentry, f2fs_i_pino_write(new_inode, old_dir->i_ino); f2fs_up_write(&F2FS_I(new_inode)->i_sem); - new_dir->i_ctime = current_time(new_dir); + inode_ctime_set_current(new_dir); if (new_nlink) { f2fs_down_write(&F2FS_I(new_dir)->i_sem); f2fs_i_links_write(new_dir, new_nlink > 0); diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 4e7d4ceeb084..5a06dd15453d 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -321,10 +321,10 @@ static int recover_inode(struct inode *inode, struct page *page) f2fs_i_size_write(inode, le64_to_cpu(raw->i_size)); inode->i_atime.tv_sec = le64_to_cpu(raw->i_atime); - inode->i_ctime.tv_sec = le64_to_cpu(raw->i_ctime); + inode_ctime_set_sec(inode, le64_to_cpu(raw->i_ctime)); inode->i_mtime.tv_sec = le64_to_cpu(raw->i_mtime); inode->i_atime.tv_nsec = le32_to_cpu(raw->i_atime_nsec); - inode->i_ctime.tv_nsec = le32_to_cpu(raw->i_ctime_nsec); + inode_ctime_set_nsec(inode, le32_to_cpu(raw->i_ctime_nsec)); inode->i_mtime.tv_nsec = le32_to_cpu(raw->i_mtime_nsec); F2FS_I(inode)->i_advise = raw->i_advise; diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index bc15841fd33c..3c6bb358a7a3 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2702,7 +2702,7 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, if (len == towrite) return err; - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); f2fs_mark_inode_dirty_sync(inode, false); return len - towrite; } diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index bdc8a55085a2..9bc685b33f4d 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -749,7 +749,7 @@ static int __f2fs_setxattr(struct inode *inode, int index, same: if (is_inode_flag_set(inode, FI_ACL_MODE)) { inode->i_mode = F2FS_I(inode)->i_acl_mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); clear_inode_flag(inode, FI_ACL_MODE); } From patchwork Wed Jun 21 14:45:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111102 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4438767vqr; Wed, 21 Jun 2023 08:14:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68NmHQ8BYBitPiFYwAl2VvU/WmtiI6WnGog9agc49fBeNcC5fqYkY5MEnZ6BuULQ/jfWdu X-Received: by 2002:a17:903:244e:b0:1b6:695f:1dbf with SMTP id l14-20020a170903244e00b001b6695f1dbfmr7011715pls.61.1687360465757; Wed, 21 Jun 2023 08:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360465; cv=none; d=google.com; s=arc-20160816; b=uSd5UCkwDXsXXJ1GBWiH3qnbOqN54Cjph7+Q0Vqqtffy2jPFF/+9DZKqsRXganJdc/ LQHLl560+Sh/yCIDINsjjPsMkEBlbxXh37K/j16u/ibD5stv2l7aPETQxz96/9Z7sXoY JfqbzKodMhtY7eVvrxSZH7/r7TylFWZzjscHKl+h54xNqRMcLkxGnjqV+9tUB5YX/WQs /DPB2OzZuHbcQhblrWKIGiEYtj8slek2DgbMT3yZmlNbJJN48Htsmm52Ql36nJydQBYb hqQlzIJK+u+DKR/uieeWbxx/iM8JYYMF9csY3McoAUlg+mr97uDoQrrEFeUVt1v8Ckh6 8V+A== 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=D7PLAJyorYyoJ/OIxK6bLCauLwiRh2V/xATgES0tX/w=; b=dNonOkyuQz3niOs6YI8cwexEkIW+4Whnc/rbSknoVPvNl5PpMHIY9KEQ+dHxwS8piJ 2j5vZeQEL9vd/6OEaH07lu9tKhc6Bkke/yDaxJ2fSQxK28sm3DRW+isB/aYHGoZmxn7j fK3ZEANOiNgjbEFekw2ph4kzY693Na2jDLvzchGB5MeMp8vcyaLifnCmdxV6xfXGCiYp FqyOrfZDylx7OwdGnfnJzB+A3y2tffH384XMqZxxQfOva66gz2p2MFVjF2rXCHEgSri/ EqS+eLQv9NVMvbMkcHojkgI4JieK5N/TTVJFabvdMcE6rIo5k3qQ8VxslH1gI9bBjQ5D fG8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DX/q6KXu"; 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 z8-20020a170902d54800b001aafb271d16si1684394plf.461.2023.06.21.08.14.07; Wed, 21 Jun 2023 08:14:25 -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="DX/q6KXu"; 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 S232605AbjFUOvT (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232740AbjFUOuD (ORCPT ); Wed, 21 Jun 2023 10:50:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DF9D2723 for ; Wed, 21 Jun 2023 07:48:37 -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 8070061596 for ; Wed, 21 Jun 2023 14:48:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6702AC433C0; Wed, 21 Jun 2023 14:48:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358908; bh=Ozu8vusVt/ZPAtMPgGZ1LcgmA54r8kMF/Hvo6mj2P0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DX/q6KXulzPhf+oHWyMmvCGyi706ot1Qy0Pi395ff90XpXZI0hO7LfIudjPIKhYzc F/RGJ5d//DkWpgJdCc2adkI8XtqmH2qgNtmW2iCx4qwVCKCxEDJxFoLdroVZReCgFh NRyOlzEIEH02IhhA22k2LE9PRbbAuj55LwjKfCQyLfzX7SnTlE2k2xUT/FF5DzhepI 8rBrZ83aRfEctaAKZyefrUTET+nLRRcv9sf11A8VLPk5sCC1Q1sBAdYr74HyJeXIYo 2fmdVgDLMSJ0nePOf/zqm9RGcOwKNIQsZwPxgXgLJZB3DUisoMm1UVpzBpndpcrdC1 RX0lKMeAyXthg== From: Jeff Layton To: Christian Brauner , OGAWA Hirofumi Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 31/79] fat: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:44 -0400 Message-ID: <20230621144735.55953-30-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325687748025014?= X-GMAIL-MSGID: =?utf-8?q?1769325687748025014?= 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 --- fs/fat/inode.c | 8 +++++--- fs/fat/misc.c | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index d99b8549ec8f..b34ae7298796 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -562,7 +562,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) & ~((loff_t)sbi->cluster_size - 1)) >> 9; fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); - inode->i_ctime = inode->i_mtime; + inode_ctime_set(inode, inode->i_mtime); if (sbi->options.isvfat) { fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime, @@ -1407,8 +1407,10 @@ static int fat_read_root(struct inode *inode) MSDOS_I(inode)->mmu_private = inode->i_size; fat_save_attrs(inode, ATTR_DIR); - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = 0; - inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec = 0; + inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode_ctime_set_sec(inode, + 0); + inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = inode_ctime_set_nsec(inode, + 0); set_nlink(inode, fat_subdirs(inode)+2); return 0; diff --git a/fs/fat/misc.c b/fs/fat/misc.c index 7e5d6ae305f2..0d3ba6001ff0 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c @@ -331,8 +331,11 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags) * identical in memory. all mtime updates will be applied to ctime, * but ctime updates are ignored. */ - if (flags & S_MTIME) - inode->i_mtime = inode->i_ctime = fat_truncate_mtime(sbi, now); + if (flags & S_MTIME) { + ts = fat_truncate_mtime(sbi, now); + inode->i_mtime = ts; + inode_ctime_set(inode, ts); + } return 0; } From patchwork Wed Jun 21 14:45:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111086 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4432557vqr; Wed, 21 Jun 2023 08:06:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60n8n0LfdQrkeFD4Cj76Vhh9cumbucN9gbV/1NFCyvJuIqvmSPpUXhql95iTjc9ppzi5Se X-Received: by 2002:a05:6808:60d:b0:3a0:3aee:fa4 with SMTP id y13-20020a056808060d00b003a03aee0fa4mr4300080oih.11.1687359996260; Wed, 21 Jun 2023 08:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359996; cv=none; d=google.com; s=arc-20160816; b=g4kCkEmiutS60m0WFiRtD5HXFQu4tuMFFUx9TiVB4WfQ3BrevNSEQuYf1no96ESLFp Wu7UnNmDYVKVEB0EC3BwLVqr5qQ3l60WtKIQVvvdzg9pnHEe5/2sy2sU9N9B/4lPKsG+ 6IRbIQjCkeMmlJtH8IImH7Qv2VjA0BcWg2eE1rlLhhN2cFyZBQJvm+IzbaVWVzubs6qZ CKPu8Y4FLwLXJeMsqW17nRI+IGXiVCxtLFaImOBw+i3czeop79clbkdA5ZZ+IK0DGGuo jpC4OnBi6nN9kaWjnkelofQ5Wh7lNxxNnEPbZZCaHpUxfVTNa0pae2iNEWqXNwC9wUfd TTLA== 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=fwY6+Cgqe7Zwupq474XezW9+1flkA6I7Xo+z6Uje57A=; b=nCoR9QIvaKObf8pIuZRvNuWjhbkhV0lE5o+SrNccE0Xr/+cUxAz8R9MIJEi+e7OJ55 W3kA3COqQw1IhpUYTb2iNzYnjQzkmQ38v4fyh5XeocGyA4aNHwH7ecrDdxNUdGSRvuvQ Z4B4tfJsZucIT3ayhJPlRP5H4aM1BW9Ff12icY0DEwmznVUeTIMiqg/YZzePg6d2S1wS 5tiBEW1CYG30vKvBujRkJy+1OPl4NlLlpZaGe8G7zvi6CETgZSKd1PbX8rfPCQZ7tq/E sRqN9Xs/swG+YHGoHAA7s84hG68GZoDPKPTn4+ZTqn4gjBfckUozhfCdhoIx1dwWcgQB lPww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q+WkytXa; 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 m19-20020a0568080f1300b0038e0aa4f74csi2194268oiw.168.2023.06.21.08.06.22; Wed, 21 Jun 2023 08:06:36 -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=Q+WkytXa; 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 S230260AbjFUOvj (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbjFUOuJ (ORCPT ); Wed, 21 Jun 2023 10:50:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADB60273A for ; Wed, 21 Jun 2023 07:48:40 -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 C4525615A6 for ; Wed, 21 Jun 2023 14:48:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A53D9C433C8; Wed, 21 Jun 2023 14:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358910; bh=Y1zOmv57j6KZqwC3v3dA3Bks9DlA96ykpslnKz3twbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q+WkytXaZeZ/b1bQg2EekU9qJmqsUFauiE0a8RZTPM44J+OY1d5sAi27wqmeisFFr 4ov6d5/cY3JP/e4eLwMUjYQDenIJfmF054qn+X0/qpbfkXNDmTG2HUPS38+x6VFhda SdKukNr0WsisO4nWT9auHBWtdpJuTIs4jSTU3xv8VExNu21lkXnbSmfCvD6BCrhpJx F7aREpbVMDbkM7Rf8Zh4AfNNKYhIQdXfCE9Vcuu1dyjPuRZOoUx5MJ2DzVFGR8vKhj YPdT6nibHMScd124H4A33/aIZoE41sooH//8OHmCvHjR0Zymla2gfhqWJdvTXMPnqa 0jp3rEera+bUA== From: Jeff Layton To: Christian Brauner , Christoph Hellwig Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 32/79] freevxfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:45 -0400 Message-ID: <20230621144735.55953-31-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325195555966684?= X-GMAIL-MSGID: =?utf-8?q?1769325195555966684?= 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 --- fs/freevxfs/vxfs_inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c index ceb6a12649ba..ad0f0a627715 100644 --- a/fs/freevxfs/vxfs_inode.c +++ b/fs/freevxfs/vxfs_inode.c @@ -110,10 +110,10 @@ static inline void dip2vip_cpy(struct vxfs_sb_info *sbi, inode->i_size = vip->vii_size; inode->i_atime.tv_sec = vip->vii_atime; - inode->i_ctime.tv_sec = vip->vii_ctime; + inode_ctime_set_sec(inode, vip->vii_ctime); inode->i_mtime.tv_sec = vip->vii_mtime; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); inode->i_mtime.tv_nsec = 0; inode->i_blocks = vip->vii_blocks; From patchwork Wed Jun 21 14:45:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4443208vqr; Wed, 21 Jun 2023 08:20:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ75WFV1y2pSlyiJE40+3WwOZxF0ZhJwg2uYlKdEoq0z+zAkzM5bObl9cZ23bjW4RaBFZco0 X-Received: by 2002:a05:6808:1521:b0:3a0:3d27:e351 with SMTP id u33-20020a056808152100b003a03d27e351mr5369844oiw.28.1687360826635; Wed, 21 Jun 2023 08:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360826; cv=none; d=google.com; s=arc-20160816; b=QXZJ1AKjVko85KBqbtMJspmR+NOvhh6rslgfX7Bx62NjBiM9NKFdn8A5Up8rsJqxDy MT8hRZt7yWcSURPTzS2iryPDs4w4YMNfi6FPg2ADlVR2XOs6o2/qoriRRJmDutTo5jyv UqVSzlSzeTPS7APd4Cx3Q0HC2n14n85qnb6473CmxZ2Gfn6ckgTyLduLxrxF81khn0dK CxcB7hS1A5v5by6tf/Q3NskJkg4ke4hoNOJK7eVke4jDTN+wakC8q+VfmOUGV9KniRl2 tPhvDvq9dYAuB0U9+dQIGh/KbreAWDYW8JK0icwYGurAj9o2P9cBluK9CKZYCZMNlPW2 PBfA== 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=qZ2KvCkHXkn6JdEoaS1gFSg6N38cPRgJEHXRx4azVlU=; b=hy0siEfqjbIf1RxNm9neC8uIF0rJU83kPrwIYut6LXTzQ/TQvbJ6GAQX3jKfTwHu8p rbJ07eQ+EM93OSX50VQhBfZ7CNhyExX3jE9fL8vrh+65kN7WH8GggO/5KMXHjobXPi5K O+VWRbBlI+SXvQklCx6skhcZ4DjXblZejX7SroTaCGJVZ2N+5oLbEvImVPU/y13cL836 XWEj90+xjtjtXhyKMHqxJRCighhULJqPuPWOuJ8zGZdcBXZ79RBzXXiC63JI+EPGGOhP 9uGO/oenFDMNgrTmzXyljdfIEybhysV5dP7HEKz3w5fggf0Wp+cO5mUZJx6zE+fyQM6n 4wsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U6V2naQb; 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 y4-20020a63ad44000000b0055337cf6342si4266663pgo.332.2023.06.21.08.20.14; Wed, 21 Jun 2023 08:20:26 -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=U6V2naQb; 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 S232575AbjFUOvL (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232631AbjFUOt7 (ORCPT ); Wed, 21 Jun 2023 10:49:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DDB41FE3; Wed, 21 Jun 2023 07:48:32 -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 6D9BD6157D; Wed, 21 Jun 2023 14:48:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 442ADC433C8; Wed, 21 Jun 2023 14:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358911; bh=GO2Zpq+zEeHviRURrvBxPy0RDxVvHVMo8mIPU4EFgtg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U6V2naQbXigFIXeLsdIg+qFhnexPblANO1n1Qw09zr3ud+7tpbSov9FnBQ9mYnTXL lifWCy/aZRl1cp/LyGpUoFCLjh1TomzKwS5OCA1W2o9dyQ1zQdyi4sGCbpizOrepbZ jLsLII0Xj4zuH4jAQH3fA4URf0EgEhhpQAMTT2RoUxGxKS1nvmK6OV6bq/wmzkCi7n JOAX+Be7lojDWJKrukgrXTyHjQKzoHthsktNuaRdaVkoCnv0Qt2XZOrfayEkiO3l3L ea0TR+VWFKqktvcTnqkvok+YzvhlMBWzt8ntkhnNAWMTgawREke+taAklU3pBjGVvL C8qikFw+exckw== From: Jeff Layton To: Christian Brauner , Miklos Szeredi Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 33/79] fuse: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:46 -0400 Message-ID: <20230621144735.55953-32-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 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?1769326066289912135?= X-GMAIL-MSGID: =?utf-8?q?1769326066289912135?= 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 --- fs/fuse/control.c | 2 +- fs/fuse/dir.c | 8 ++++---- fs/fuse/inode.c | 18 ++++++++++-------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 247ef4f76761..b5df89d0c95a 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -235,7 +235,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, inode->i_mode = mode; inode->i_uid = fc->user_id; inode->i_gid = fc->group_id; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); /* setting ->i_op to NULL is not allowed */ if (iop) inode->i_op = iop; diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 5a4a7155cf1c..03fbb83b7127 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -933,7 +933,7 @@ void fuse_flush_time_update(struct inode *inode) static void fuse_update_ctime_in_cache(struct inode *inode) { if (!IS_NOCMTIME(inode)) { - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty_sync(inode); fuse_flush_time_update(inode); } @@ -1715,8 +1715,8 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff) inarg.mtimensec = inode->i_mtime.tv_nsec; if (fm->fc->minor >= 23) { inarg.valid |= FATTR_CTIME; - inarg.ctime = inode->i_ctime.tv_sec; - inarg.ctimensec = inode->i_ctime.tv_nsec; + inarg.ctime = inode_ctime_peek(inode).tv_sec; + inarg.ctimensec = inode_ctime_peek(inode).tv_nsec; } if (ff) { inarg.valid |= FATTR_FH; @@ -1857,7 +1857,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, if (attr->ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (attr->ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_ctime_set(inode, attr->ia_ctime); /* FIXME: clear I_DIRTY_SYNC? */ } diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 660be31aaabc..54e06d3874e7 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -194,8 +194,8 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, inode->i_mtime.tv_nsec = attr->mtimensec; } if (!(cache_mask & STATX_CTIME)) { - inode->i_ctime.tv_sec = attr->ctime; - inode->i_ctime.tv_nsec = attr->ctimensec; + inode_ctime_set_sec(inode, attr->ctime); + inode_ctime_set_nsec(inode, attr->ctimensec); } if (attr->blksize != 0) @@ -259,8 +259,8 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, attr->mtimensec = inode->i_mtime.tv_nsec; } if (cache_mask & STATX_CTIME) { - attr->ctime = inode->i_ctime.tv_sec; - attr->ctimensec = inode->i_ctime.tv_nsec; + attr->ctime = inode_ctime_peek(inode).tv_sec; + attr->ctimensec = inode_ctime_peek(inode).tv_nsec; } if ((attr_version != 0 && fi->attr_version > attr_version) || @@ -318,8 +318,8 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr, inode->i_size = attr->size; inode->i_mtime.tv_sec = attr->mtime; inode->i_mtime.tv_nsec = attr->mtimensec; - inode->i_ctime.tv_sec = attr->ctime; - inode->i_ctime.tv_nsec = attr->ctimensec; + inode_ctime_set_sec(inode, attr->ctime); + inode_ctime_set_nsec(inode, attr->ctimensec); if (S_ISREG(inode->i_mode)) { fuse_init_common(inode); fuse_init_file_inode(inode, attr->flags); @@ -1398,16 +1398,18 @@ EXPORT_SYMBOL_GPL(fuse_dev_free); static void fuse_fill_attr_from_inode(struct fuse_attr *attr, const struct fuse_inode *fi) { + struct timespec64 ctime = inode_ctime_peek(&fi->inode); + *attr = (struct fuse_attr){ .ino = fi->inode.i_ino, .size = fi->inode.i_size, .blocks = fi->inode.i_blocks, .atime = fi->inode.i_atime.tv_sec, .mtime = fi->inode.i_mtime.tv_sec, - .ctime = fi->inode.i_ctime.tv_sec, + .ctime = ctime.tv_sec, .atimensec = fi->inode.i_atime.tv_nsec, .mtimensec = fi->inode.i_mtime.tv_nsec, - .ctimensec = fi->inode.i_ctime.tv_nsec, + .ctimensec = ctime.tv_nsec, .mode = fi->inode.i_mode, .nlink = fi->inode.i_nlink, .uid = fi->inode.i_uid.val, From patchwork Wed Jun 21 14:45:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111087 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4432559vqr; Wed, 21 Jun 2023 08:06:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ79/ZsII5fpbWgnP7UMrBgk4uaE8xB+VQUHnCTmztI2fOUX5MPi+GRsakpLCKQt2uOvti2k X-Received: by 2002:a05:6a21:33a1:b0:121:fd18:4b51 with SMTP id yy33-20020a056a2133a100b00121fd184b51mr9704487pzb.36.1687359995776; Wed, 21 Jun 2023 08:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359995; cv=none; d=google.com; s=arc-20160816; b=H5mNC3ATkKnEIa6tZYMBnVOaFeNkX8BTlerDC6X95IbHKrpoYNkPcnP6la11JifAXD U5VPFe/dphPrGyZ3Fhk/ndc/xG/81Jg+EJrLJteJ57geTNqZr4cBKb2Iij5iaPBpMjL2 tuF+1r1kuCG8Ree8KdktNfnzmx9b+JCKrogLgfbPB2YHTxkaRVoci1etGEUiEQcnViHx CLbtp9h3hZOG9U0qGlCwCPMGzKDWwvtC5csoMxDB2aW9bHLd1KNZ4LIdtQqeb10KNPp8 ew0zNkU/jKG2Ne9sG7XdzVcS4CK5TFcFtw28lvs/KyAcCzPpmtin57cVO5fmHqZtl0A2 54DQ== 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=6U1P1OzMzi1+Lsd38zl8OztRZg0GVf3o1EjsU9SMsm4=; b=VabG7o+32aoK7+o32bE9GCgoTwr4HviysCrpzQyeZCzx/BgYfbqnzT+QwpJdIGy0n+ nO+Gnlv2kua1AZBrBCDBS+g2/NsF8hAuJBH5eygVFyy/DT8+hWTzE5TUHIqnukZ6qtAE tx6+nXI5GA9pvialJgCErD1qc8W5XlkuyiTXpYv4UMJp5E8EjJuRCaFMnWhWTwtsfbS1 NeeQsOe7GIhKW1OyuYwA4AI1w/NOI5StYl/R4cwEMlAiLd7u4+JLd+PcV9G7VYHEnvjh k+xlwPVPweMPMK2EXaG6tH7wqqpoEkIiGgmE+iheaxTUZAyobo30srLokrBs7YFYjRqg zGgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pun9L1Oi; 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 z192-20020a6333c9000000b00543d2bb0086si201114pgz.741.2023.06.21.08.06.18; Wed, 21 Jun 2023 08:06:35 -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=Pun9L1Oi; 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 S232810AbjFUOxz (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232428AbjFUOxG (ORCPT ); Wed, 21 Jun 2023 10:53:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17FCF1BC8 for ; Wed, 21 Jun 2023 07:49:34 -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 192DE61595 for ; Wed, 21 Jun 2023 14:48:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFA21C433C8; Wed, 21 Jun 2023 14:48:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358914; bh=M4W2BnO80rsbSjnElunKSlEAzYo3dCVya+c1YUt/Vx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pun9L1Oiq3bQs23G8dzW58jsXi6CqTaVd6MCIzzn5j2vCLPPJPBt88a9/skSplE3P R1KraBA9mHdWwLpdwQituKICfYRh0jkCX2TjT1x6k8tESjWd1XsxmLTUChW24nl0JV BQUdr+iB3thTQM1mljjJv76viChfcra9O+lJaznenWR03y1N9DDI8deQLXJBwybv2f 9aaIPKVExIN4A+qn5QGc18MtfN7n0YY1qf9zHaYCEpkd+aZDIjK2i9Mqb4Ms8AvtOR 9Za/tWdzPBZ2APAPtIecskO4EuP9Zjk5H92SA4MBltN0ckxCxs8+QWo1+IsLI5Z0uG QC8uEjbk6wIyA== From: Jeff Layton To: Christian Brauner , Bob Peterson , Andreas Gruenbacher Cc: Al Viro , Jan Kara , cluster-devel@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH 34/79] gfs2: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:47 -0400 Message-ID: <20230621144735.55953-33-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 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?1769325194616866312?= X-GMAIL-MSGID: =?utf-8?q?1769325194616866312?= 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 --- fs/gfs2/acl.c | 2 +- fs/gfs2/bmap.c | 11 +++++------ fs/gfs2/dir.c | 15 ++++++++------- fs/gfs2/file.c | 2 +- fs/gfs2/glops.c | 4 ++-- fs/gfs2/inode.c | 8 ++++---- fs/gfs2/super.c | 4 ++-- fs/gfs2/xattr.c | 8 ++++---- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c index a392aa0f041d..b267dae0dc63 100644 --- a/fs/gfs2/acl.c +++ b/fs/gfs2/acl.c @@ -142,7 +142,7 @@ int gfs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, ret = __gfs2_set_acl(inode, acl, type); if (!ret && mode != inode->i_mode) { - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode->i_mode = mode; mark_inode_dirty(inode); } diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 8d611fbcf0bd..743b09a0b196 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1386,7 +1386,7 @@ static int trunc_start(struct inode *inode, u64 newsize) ip->i_diskflags |= GFS2_DIF_TRUNC_IN_PROG; i_size_write(inode, newsize); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode->i_mtime = inode_ctime_set_current(inode); gfs2_dinode_out(ip, dibh->b_data); if (journaled) @@ -1583,8 +1583,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh, /* Every transaction boundary, we rewrite the dinode to keep its di_blocks current in case of failure. */ - ip->i_inode.i_mtime = ip->i_inode.i_ctime = - current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_ctime_set_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -1950,7 +1949,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length) gfs2_statfs_change(sdp, 0, +btotal, 0); gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid, ip->i_inode.i_gid); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_ctime_set_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); up_write(&ip->i_rw_mutex); @@ -1993,7 +1992,7 @@ static int trunc_end(struct gfs2_inode *ip) gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); gfs2_ordered_del_inode(ip); } - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_ctime_set_current(&ip->i_inode); ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; gfs2_trans_add_meta(ip->i_gl, dibh); @@ -2094,7 +2093,7 @@ static int do_grow(struct inode *inode, u64 size) goto do_end_trans; truncate_setsize(inode, size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_ctime_set_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 54a6d17b8c25..c07cb9883ea1 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -130,7 +130,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf, memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); if (ip->i_inode.i_size < offset + size) i_size_write(&ip->i_inode, offset + size); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_ctime_set_current(&ip->i_inode); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -227,7 +227,7 @@ static int gfs2_dir_write_data(struct gfs2_inode *ip, const char *buf, if (ip->i_inode.i_size < offset + copied) i_size_write(&ip->i_inode, offset + copied); - ip->i_inode.i_mtime = ip->i_inode.i_ctime = current_time(&ip->i_inode); + ip->i_inode.i_mtime = inode_ctime_set_current(&ip->i_inode); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); @@ -1814,7 +1814,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, gfs2_inum_out(nip, dent); dent->de_type = cpu_to_be16(IF2DT(nip->i_inode.i_mode)); dent->de_rahead = cpu_to_be16(gfs2_inode_ra_len(nip)); - tv = current_time(&ip->i_inode); + tv = inode_ctime_set_current(&ip->i_inode); if (ip->i_diskflags & GFS2_DIF_EXHASH) { leaf = (struct gfs2_leaf *)bh->b_data; be16_add_cpu(&leaf->lf_entries, 1); @@ -1825,7 +1825,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, da->bh = NULL; brelse(bh); ip->i_entries++; - ip->i_inode.i_mtime = ip->i_inode.i_ctime = tv; + ip->i_inode.i_mtime = tv; if (S_ISDIR(nip->i_inode.i_mode)) inc_nlink(&ip->i_inode); mark_inode_dirty(inode); @@ -1876,7 +1876,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) const struct qstr *name = &dentry->d_name; struct gfs2_dirent *dent, *prev = NULL; struct buffer_head *bh; - struct timespec64 tv = current_time(&dip->i_inode); + struct timespec64 tv; /* Returns _either_ the entry (if its first in block) or the previous entry otherwise */ @@ -1895,6 +1895,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) dent = (struct gfs2_dirent *)((char *)dent + be16_to_cpu(prev->de_rec_len)); } + tv = inode_ctime_set_current(&dip->i_inode); dirent_del(dip, bh, prev, dent); if (dip->i_diskflags & GFS2_DIF_EXHASH) { struct gfs2_leaf *leaf = (struct gfs2_leaf *)bh->b_data; @@ -1910,7 +1911,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) if (!dip->i_entries) gfs2_consist_inode(dip); dip->i_entries--; - dip->i_inode.i_mtime = dip->i_inode.i_ctime = tv; + dip->i_inode.i_mtime = tv; if (d_is_dir(dentry)) drop_nlink(&dip->i_inode); mark_inode_dirty(&dip->i_inode); @@ -1951,7 +1952,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, dent->de_type = cpu_to_be16(new_type); brelse(bh); - dip->i_inode.i_mtime = dip->i_inode.i_ctime = current_time(&dip->i_inode); + dip->i_inode.i_mtime = inode_ctime_set_current(&dip->i_inode); mark_inode_dirty_sync(&dip->i_inode); return 0; } diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 1bf3c4453516..cb754c5f1d2d 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c @@ -260,7 +260,7 @@ static int do_gfs2_set_flags(struct inode *inode, u32 reqflags, u32 mask) error = gfs2_meta_inode_buffer(ip, &bh); if (error) goto out_trans_end; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); gfs2_trans_add_meta(ip->i_gl, bh); ip->i_diskflags = new_flags; gfs2_dinode_out(ip, bh->b_data); diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 7c48c7afd6a4..2aba6f82194f 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -437,8 +437,8 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) inode->i_atime = atime; inode->i_mtime.tv_sec = be64_to_cpu(str->di_mtime); inode->i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); - inode->i_ctime.tv_sec = be64_to_cpu(str->di_ctime); - inode->i_ctime.tv_nsec = be32_to_cpu(str->di_ctime_nsec); + inode_ctime_set_sec(inode, be64_to_cpu(str->di_ctime)); + inode_ctime_set_nsec(inode, be32_to_cpu(str->di_ctime_nsec)); ip->i_goal = be64_to_cpu(str->di_goal_meta); ip->i_generation = be64_to_cpu(str->di_generation); diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 17c994a0c0d0..3a9c9b6ea456 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -690,7 +690,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, set_nlink(inode, S_ISDIR(mode) ? 2 : 1); inode->i_rdev = dev; inode->i_size = size; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); munge_mode_uid_gid(dip, inode); check_and_update_goal(dip); ip->i_goal = dip->i_goal; @@ -1029,7 +1029,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, gfs2_trans_add_meta(ip->i_gl, dibh); inc_nlink(&ip->i_inode); - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_ctime_set_current(&ip->i_inode); ihold(inode); d_instantiate(dentry, inode); mark_inode_dirty(inode); @@ -1114,7 +1114,7 @@ static int gfs2_unlink_inode(struct gfs2_inode *dip, return error; ip->i_entries = 0; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (S_ISDIR(inode->i_mode)) clear_nlink(inode); else @@ -1371,7 +1371,7 @@ static int update_moved_ino(struct gfs2_inode *ip, struct gfs2_inode *ndip, if (dir_rename) return gfs2_dir_mvino(ip, &gfs2_qdotdot, ndip, DT_DIR); - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_ctime_set_current(&ip->i_inode); mark_inode_dirty_sync(&ip->i_inode); return 0; } diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 9be72d5aafea..fc495df15e71 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -412,7 +412,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str->di_blocks = cpu_to_be64(gfs2_get_inode_blocks(inode)); str->di_atime = cpu_to_be64(inode->i_atime.tv_sec); str->di_mtime = cpu_to_be64(inode->i_mtime.tv_sec); - str->di_ctime = cpu_to_be64(inode->i_ctime.tv_sec); + str->di_ctime = cpu_to_be64(inode_ctime_peek(inode).tv_sec); str->di_goal_meta = cpu_to_be64(ip->i_goal); str->di_goal_data = cpu_to_be64(ip->i_goal); @@ -429,7 +429,7 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str->di_eattr = cpu_to_be64(ip->i_eattr); str->di_atime_nsec = cpu_to_be32(inode->i_atime.tv_nsec); str->di_mtime_nsec = cpu_to_be32(inode->i_mtime.tv_nsec); - str->di_ctime_nsec = cpu_to_be32(inode->i_ctime.tv_nsec); + str->di_ctime_nsec = cpu_to_be32(inode_ctime_peek(inode).tv_nsec); } /** diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 93b36d026bb4..8f807d18ec52 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -311,7 +311,7 @@ static int ea_dealloc_unstuffed(struct gfs2_inode *ip, struct buffer_head *bh, ea->ea_num_ptrs = 0; } - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_ctime_set_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); gfs2_trans_end(sdp); @@ -763,7 +763,7 @@ static int ea_alloc_skeleton(struct gfs2_inode *ip, struct gfs2_ea_request *er, if (error) goto out_end_trans; - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_ctime_set_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); out_end_trans: @@ -888,7 +888,7 @@ static int ea_set_simple_noalloc(struct gfs2_inode *ip, struct buffer_head *bh, if (es->es_el) ea_set_remove_stuffed(ip, es->es_el); - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_ctime_set_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); gfs2_trans_end(GFS2_SB(&ip->i_inode)); @@ -1106,7 +1106,7 @@ static int ea_remove_stuffed(struct gfs2_inode *ip, struct gfs2_ea_location *el) ea->ea_type = GFS2_EATYPE_UNUSED; } - ip->i_inode.i_ctime = current_time(&ip->i_inode); + inode_ctime_set_current(&ip->i_inode); __mark_inode_dirty(&ip->i_inode, I_DIRTY_DATASYNC); gfs2_trans_end(GFS2_SB(&ip->i_inode)); From patchwork Wed Jun 21 14:45: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: 111107 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4439924vqr; Wed, 21 Jun 2023 08:15:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+4rBvu2D3p/7PmPnFyL4j2K/JW5Kcg/qYXNONItuJi1jFJWP8eq53+iq1IXwzFJO24vw6 X-Received: by 2002:a05:6a20:4299:b0:121:d74e:8b46 with SMTP id o25-20020a056a20429900b00121d74e8b46mr6832808pzj.55.1687360553980; Wed, 21 Jun 2023 08:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360553; cv=none; d=google.com; s=arc-20160816; b=gJesjjQqyipBxFgBdonkfaVlc3HkbAqRsIBueod+aMZGYjITlDzr4+kTOZHhkm8eP5 Sqj6EFQOpPmvgFPineSqV4hNuzQ3F9y2BqDqeZ+vxm2wKTYneadVC0t0kQRIgjO+Peas u43ynRqjQYD1rJ8ZTnH+wwiqZUbiwYvSgu+ACdDuJZjpwTpask3Fr2bPbCE0s6im8AKZ 4QZ1Y8sBZr1czalAtCeYY8vjJG96D8xTw6y63ZRJM9sE2UCmXrTmxsxe3s9uFuWIBqx2 meweZmv2fIHvWysLn+vkXIfdhY5Oteocw832YSiEmL71Nj1KQbUZtxzWrPzbZFsXCzbc EmzA== 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=0IsARCQfg6rQV8R0b80yWhppbAYpx0RyiA+fkVfxC34=; b=Yu+P+3ssonsV0REizG1n7gkojSdKoK6gjS8n1cPa4EKD76KfG+DptRVqQ9gZRu3W3k /ECSezZ3Ciiqrq42WiCVo5fsrsl5esg/AFztAobSA/jk1mSwLb1XmviOjOihSiTWBNHC eI5C3SMnTSli5xVmd6ZnWYIgFTcdb1GAFx6rM6+WveHgPKwYzbN/HdIrIz1C6VlQaIC8 sNbRKHIpMF91FxmSsQ8j10tCW6ppbvsKF/Ej5x6qB0PBpOyEfPpst8V7FPWOlHp0SuNZ QMsKjnV5R/xbRNS+JMEB2cq6fAtfAA6Sd5J3KNw4iFydbyLxMLYs6+DaRiCg6OBU0oa0 cW3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q11OQ8Zm; 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 x11-20020a63aa4b000000b0053fb89f1e10si4223599pgo.501.2023.06.21.08.15.41; Wed, 21 Jun 2023 08:15:53 -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=q11OQ8Zm; 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 S232643AbjFUOva (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232750AbjFUOuD (ORCPT ); Wed, 21 Jun 2023 10:50:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E80C2720; Wed, 21 Jun 2023 07:48:37 -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 CFCFD61599; Wed, 21 Jun 2023 14:48:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B994CC433C8; Wed, 21 Jun 2023 14:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358916; bh=pggVtFIJOHc1WNCGw/P+3qaXBccgFmkuMQjd2r0u1l0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q11OQ8ZmZ/n9TdwyupcKDBpx/CYhNdfVGriqFHvIzk98dH+/2O+EX5/XeMXoOFir9 w3Ro2JtaocJ0QS2i4pXM1CI9omsEqRTNg72Pe6GkPd4PiLDqaFFISG+rP3h9oNZ8k8 LV/W+7Z15TpaIFOhY2u0HoM0P+KAPaosr8VSvgekIFiJab0ztnE9gCdYeWfThYpPZf LBrL7RpwYIoJwvZXFVdu8t6JagcLz9+abcpDst5hKv9Q9xWQQv3qNTVR7FIdlggC7V sBFAZyYbILWWeFs5c8c2V8IUohl14dHSK4WMu6ckndwgQPa56KNBj32xn20cYHS5Hz bme3xz26A8RbA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 35/79] hfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:48 -0400 Message-ID: <20230621144735.55953-34-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 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?1769325780112864009?= X-GMAIL-MSGID: =?utf-8?q?1769325780112864009?= 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 --- fs/hfs/catalog.c | 8 ++++---- fs/hfs/dir.c | 2 +- fs/hfs/inode.c | 13 ++++++------- fs/hfs/sysdep.c | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c index d365bf0b8c77..6fd2ae856178 100644 --- a/fs/hfs/catalog.c +++ b/fs/hfs/catalog.c @@ -133,7 +133,7 @@ int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct i goto err1; dir->i_size++; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); hfs_find_exit(&fd); return 0; @@ -269,7 +269,7 @@ int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str) } dir->i_size--; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); res = 0; out: @@ -337,7 +337,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, if (err) goto out; dst_dir->i_size++; - dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); + dst_dir->i_mtime = inode_ctime_set_current(dst_dir); mark_inode_dirty(dst_dir); /* finally remove the old entry */ @@ -349,7 +349,7 @@ int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, if (err) goto out; src_dir->i_size--; - src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); + src_dir->i_mtime = inode_ctime_set_current(src_dir); mark_inode_dirty(src_dir); type = entry.type; diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index 3e1e3dcf0b48..bb9e651c1008 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c @@ -263,7 +263,7 @@ static int hfs_remove(struct inode *dir, struct dentry *dentry) if (res) return res; clear_nlink(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); hfs_delete_inode(inode); mark_inode_dirty(inode); return 0; diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 441d7fc952e3..d8008d926a19 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -200,7 +200,7 @@ struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); set_nlink(inode, 1); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); HFS_I(inode)->flags = 0; HFS_I(inode)->rsrc_inode = NULL; HFS_I(inode)->fs_blocks = 0; @@ -355,8 +355,8 @@ static int hfs_read_inode(struct inode *inode, void *data) inode->i_mode |= S_IWUGO; inode->i_mode &= ~hsb->s_file_umask; inode->i_mode |= S_IFREG; - inode->i_ctime = inode->i_atime = inode->i_mtime = - hfs_m_to_utime(rec->file.MdDat); + inode->i_atime = inode->i_mtime = hfs_m_to_utime(rec->file.MdDat); + inode_ctime_set(inode, inode->i_mtime); inode->i_op = &hfs_file_inode_operations; inode->i_fop = &hfs_file_operations; inode->i_mapping->a_ops = &hfs_aops; @@ -366,8 +366,8 @@ static int hfs_read_inode(struct inode *inode, void *data) inode->i_size = be16_to_cpu(rec->dir.Val) + 2; HFS_I(inode)->fs_blocks = 0; inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); - inode->i_ctime = inode->i_atime = inode->i_mtime = - hfs_m_to_utime(rec->dir.MdDat); + inode->i_atime = inode->i_mtime = hfs_m_to_utime(rec->dir.MdDat); + inode_ctime_set(inode, inode->i_mtime); inode->i_op = &hfs_dir_inode_operations; inode->i_fop = &hfs_dir_operations; break; @@ -654,8 +654,7 @@ int hfs_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, truncate_setsize(inode, attr->ia_size); hfs_file_truncate(inode); - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); } setattr_copy(&nop_mnt_idmap, inode, attr); diff --git a/fs/hfs/sysdep.c b/fs/hfs/sysdep.c index 2875961fdc10..e2949390fadc 100644 --- a/fs/hfs/sysdep.c +++ b/fs/hfs/sysdep.c @@ -28,7 +28,7 @@ static int hfs_revalidate_dentry(struct dentry *dentry, unsigned int flags) /* fix up inode on a timezone change */ diff = sys_tz.tz_minuteswest * 60 - HFS_I(inode)->tz_secondswest; if (diff) { - inode->i_ctime.tv_sec += diff; + inode_ctime_set_sec(inode, inode_ctime_peek(inode).tv_sec + diff); inode->i_atime.tv_sec += diff; inode->i_mtime.tv_sec += diff; HFS_I(inode)->tz_secondswest += diff; From patchwork Wed Jun 21 14:45:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111090 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4433972vqr; Wed, 21 Jun 2023 08:08:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wF+nKvwpTmaolzBj7oqBBE5hDcdF3x1HN5v4j7636EeCkeTWBcxdXLjhR38gJiz+a3dEv X-Received: by 2002:a17:902:d511:b0:1b6:9958:eaf2 with SMTP id b17-20020a170902d51100b001b69958eaf2mr1929657plg.68.1687360088157; Wed, 21 Jun 2023 08:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360088; cv=none; d=google.com; s=arc-20160816; b=gA0V91kzrpC1RdsH7/VMjyXmE7be907SFvU0FX14FWjsXOI5J0i8G/0j9yLA5y364Q fbG2M8JMH10AZPYsiLdEEVKSnZUUcgFuovPqUDZCGlWuSIub7fiGC2gDntZ88jmSjSqk A02BpwqIU1zEyDbqWPH045Eup2Ytm282ZUE5QjFBT1UgQBJOPD3HMXKq3DtwzmKIGjMp kA9MIoejuJZ8l8lw2SSsDSAm5/PtQwUycNH6uHF11AcoAaNQn3RVWuV0Cc4rAW7zJM2L hkiH7G75sqrGUZ0chfPfu5xWbFtGGFfZb24CQsBIIBmKLoYqMDbmVrzYh3ChqhOvRTmi 6hFQ== 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=jtx305vF23AGof65etWUCzX/jPQk+q/qjGQ2puXmurE=; b=mumphzu0t85WhmOZ6JJR4THpC+qHI/6MylKzFOXgwO6BUv4li5ka3zaBaGkmnuEEOA 3Hmw4sflLx3gwQFz9YK29SIxdiQYH21j6A+a3JV3tTqDpFR5nNNN+DoZCqRfu42HnhWx IxwqfU84iPzXZ8b+woW897Xyv5WobOslmixqgTRRZfdh6ua8m7yFkK8aBdpBYLceA3Hv f4eFd3Oh7gEE5RQkdKsthXfPjaYpUry5ICX0tzH9iQ7Acy8D5AaaNyNc7DWVj94w0nPb eDSMVikb3yISe5m8CrPOkOoq2szEXp8CbZ9P6B8M1CDe0SPiUezsIg+OELv1XgmVRoKb k7fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CTQv9pQz; 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 y17-20020a170902b49100b001ab2431f012si4090612plr.423.2023.06.21.08.07.54; Wed, 21 Jun 2023 08:08:08 -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=CTQv9pQz; 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 S232827AbjFUOwH (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232239AbjFUOu0 (ORCPT ); Wed, 21 Jun 2023 10:50:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DB992959; Wed, 21 Jun 2023 07:48:47 -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 82F50615A1; Wed, 21 Jun 2023 14:48:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 653C9C433C0; Wed, 21 Jun 2023 14:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358917; bh=04irOXozoqZySwXawSaTumKvdGyvq3lEBxeRjcB3L88=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTQv9pQzZfnt0PUYvc0GBuyOYN8vKTZeQzPXgonRxjPD1o3DHEpGx5oC671009eLc ktq8RD5GIE9vUFul0+eHzeO8vFxQwbFQ8r/ea+jIa3YBECR3Jh/3AYWmVa1NWPEOlP wrm+JSQK6mWlZTQdX9f1VBvVK2LG2RLG0eYWkpDOoSZx9SbyPqQwOdJ/uQbetZYujo 6v6Di6UPxLabwfZGXYfX+i4/cNdRJysQGOX+v4Zfa9no7IZvU4YYGjoLiq26Rk9V26 BE+JAQFKXVrKScHKekIfQJoYZlWDMi/JRmm1fcQnoHdboNAMjRih2h6tTdmGvJneBT iCfmaEJxBQHGg== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 36/79] hfsplus: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:49 -0400 Message-ID: <20230621144735.55953-35-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325291927255432?= X-GMAIL-MSGID: =?utf-8?q?1769325291927255432?= 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 --- fs/hfsplus/catalog.c | 8 ++++---- fs/hfsplus/dir.c | 6 +++--- fs/hfsplus/inode.c | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index 35472cba750e..0e1938729669 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c @@ -312,7 +312,7 @@ int hfsplus_create_cat(u32 cnid, struct inode *dir, dir->i_size++; if (S_ISDIR(inode->i_mode)) hfsplus_subfolders_inc(dir); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); hfs_find_exit(&fd); @@ -417,7 +417,7 @@ int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str) dir->i_size--; if (type == HFSPLUS_FOLDER) hfsplus_subfolders_dec(dir); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); hfsplus_mark_inode_dirty(dir, HFSPLUS_I_CAT_DIRTY); if (type == HFSPLUS_FILE || type == HFSPLUS_FOLDER) { @@ -494,7 +494,7 @@ int hfsplus_rename_cat(u32 cnid, dst_dir->i_size++; if (type == HFSPLUS_FOLDER) hfsplus_subfolders_inc(dst_dir); - dst_dir->i_mtime = dst_dir->i_ctime = current_time(dst_dir); + dst_dir->i_mtime = inode_ctime_set_current(dst_dir); /* finally remove the old entry */ err = hfsplus_cat_build_key(sb, src_fd.search_key, @@ -511,7 +511,7 @@ int hfsplus_rename_cat(u32 cnid, src_dir->i_size--; if (type == HFSPLUS_FOLDER) hfsplus_subfolders_dec(src_dir); - src_dir->i_mtime = src_dir->i_ctime = current_time(src_dir); + src_dir->i_mtime = inode_ctime_set_current(src_dir); /* remove old thread entry */ hfsplus_cat_build_key_with_cnid(sb, src_fd.search_key, cnid); diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 56fb5f1312e7..e7b6de12ecef 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -346,7 +346,7 @@ static int hfsplus_link(struct dentry *src_dentry, struct inode *dst_dir, inc_nlink(inode); hfsplus_instantiate(dst_dentry, inode, cnid); ihold(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); sbi->file_count++; hfsplus_mark_mdb_dirty(dst_dir->i_sb); @@ -405,7 +405,7 @@ static int hfsplus_unlink(struct inode *dir, struct dentry *dentry) hfsplus_delete_inode(inode); } else sbi->file_count--; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); out: mutex_unlock(&sbi->vh_mutex); @@ -426,7 +426,7 @@ static int hfsplus_rmdir(struct inode *dir, struct dentry *dentry) if (res) goto out; clear_nlink(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); hfsplus_delete_inode(inode); mark_inode_dirty(inode); out: diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 7d1a675e037d..b9c02df839c8 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -267,7 +267,7 @@ static int hfsplus_setattr(struct mnt_idmap *idmap, } truncate_setsize(inode, attr->ia_size); hfsplus_file_truncate(inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); } setattr_copy(&nop_mnt_idmap, inode, attr); @@ -392,7 +392,7 @@ struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir, inode->i_ino = sbi->next_cnid++; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); set_nlink(inode, 1); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); hip = HFSPLUS_I(inode); INIT_LIST_HEAD(&hip->open_dir_list); @@ -523,7 +523,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) inode->i_size = 2 + be32_to_cpu(folder->valence); inode->i_atime = hfsp_mt2ut(folder->access_date); inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); - inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date); + inode_ctime_set(inode, hfsp_mt2ut(folder->attribute_mod_date)); HFSPLUS_I(inode)->create_date = folder->create_date; HFSPLUS_I(inode)->fs_blocks = 0; if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { @@ -564,7 +564,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) } inode->i_atime = hfsp_mt2ut(file->access_date); inode->i_mtime = hfsp_mt2ut(file->content_mod_date); - inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); + inode_ctime_set(inode, hfsp_mt2ut(file->attribute_mod_date)); HFSPLUS_I(inode)->create_date = file->create_date; } else { pr_err("bad catalog entry used to create inode\n"); @@ -609,7 +609,7 @@ int hfsplus_cat_write_inode(struct inode *inode) hfsplus_cat_set_perms(inode, &folder->permissions); folder->access_date = hfsp_ut2mt(inode->i_atime); folder->content_mod_date = hfsp_ut2mt(inode->i_mtime); - folder->attribute_mod_date = hfsp_ut2mt(inode->i_ctime); + folder->attribute_mod_date = hfsp_ut2mt(inode_ctime_peek(inode)); folder->valence = cpu_to_be32(inode->i_size - 2); if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { folder->subfolders = @@ -644,7 +644,7 @@ int hfsplus_cat_write_inode(struct inode *inode) file->flags &= cpu_to_be16(~HFSPLUS_FILE_LOCKED); file->access_date = hfsp_ut2mt(inode->i_atime); file->content_mod_date = hfsp_ut2mt(inode->i_mtime); - file->attribute_mod_date = hfsp_ut2mt(inode->i_ctime); + file->attribute_mod_date = hfsp_ut2mt(inode_ctime_peek(inode)); hfs_bnode_write(fd.bnode, &entry, fd.entryoffset, sizeof(struct hfsplus_cat_file)); } @@ -700,7 +700,7 @@ int hfsplus_fileattr_set(struct mnt_idmap *idmap, else hip->userflags &= ~HFSPLUS_FLG_NODUMP; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); return 0; From patchwork Wed Jun 21 14:45:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111104 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4439152vqr; Wed, 21 Jun 2023 08:14:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6kXqEAyg6PSpu6lhIDlT8LDQ4AKQs+DkllqH6jVedHKYMWKHChL1XFfQ8RzEu6cTYaoc0F X-Received: by 2002:a05:6808:1b07:b0:3a0:4ff2:340 with SMTP id bx7-20020a0568081b0700b003a04ff20340mr1137656oib.57.1687360496176; Wed, 21 Jun 2023 08:14:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360496; cv=none; d=google.com; s=arc-20160816; b=qQmbnuI+HyZ6toI0J8HEPOdp+tdjon847e5uze9YP7/2+6uT3caoNwQLnCYtaqQYbp JHpLWfXTjHjxwCyIZ0sK3I0CDuBl5vA5K0ugqd/Y6oeJ3kEZ8RnFYsB/hMcbr5xD3oVo RcwJpH1ujVK7Mz74h1iGN9Xej/6o54afMAyVozPEfYztx8z8aQFYZNm7lygAW+BYoF+m oatmfgdtSt1eR2wFZ+9XYB7OWoZQKHw72aqqxuh/x4mSMiADQ1kpGSxImcuTt+ky3vlF wmDnuxy7j1mZYFNLy+Z1i0JPAuMtSTlMGLBXy4OC02b8BKGl5Z1TDaWJbFn4PLcXH+Og i4LA== 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=IXCX0+x7vqplEQ64FTYp4OC9Vg5rhmJUs30JvGz2jh4=; b=fQj6pCrh5TObXb2E29/aVYt0+1Xy57H8it0TYtcPAaN//AmeRUy7Qrr3TC2ck4YEIy OI9RnXBozmkiGjFGgh9wxAjis3mv2y585sB40LW2QHSEfYfo8zSzaYUktq1yBJ3MT0Ls Vu0LhSC71eNCdME7Rdu3s5kF8nONJ2jWYMBYwZCdGlpm08sNvEwfPEXIyZjhQkmVpQ5r 36uTQg+q1Rnoc5FCha+LuUjz2qwkldxNih4GXkyPdEgVFlwxvPPiW2AR0VrqYerVO4NU B0+xqTw+Z3ElNyRGX16Z+qzUEGyNIo9ZanIIL3mPxewO8xfhjjHJU4Bq5316qfertDV/ QqZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=urrRE+Ul; 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 j64-20020a638b43000000b005098590f1edsi1740339pge.757.2023.06.21.08.14.43; Wed, 21 Jun 2023 08:14:56 -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=urrRE+Ul; 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 S232679AbjFUOvf (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbjFUOuG (ORCPT ); Wed, 21 Jun 2023 10:50:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42B5F2736 for ; Wed, 21 Jun 2023 07:48:40 -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 0BB076159A for ; Wed, 21 Jun 2023 14:48:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A660EC433C8; Wed, 21 Jun 2023 14:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358919; bh=7kDZ0zSAuiZG3Ri7kKTPNFkOkI3vdeQNaeHRn7Yk8hM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urrRE+Ul2hVmFhbrwq9sLzT1y4Q0DRerCmZqwlbqL2Ncta4KFzKp7HaNR7245ScwN /L0gu2ol0rpyseaLYWMl8wc0hiNg0t25hbFPjNTofAiMIZ3bRbfFVmau3LmGpfZQza W/+4CsBak8HhirWT1F8eC1YB37WFHe/H5PO3jDGe+dSlwVqs0Wjj6E3Iy3CTbfvJv+ fiqa8JMFh0e1JrdNEaJGSariji2RmP38B7lkCq3kHB3/JyryfrRmaWz8+We4vC+VRh 9XRVLfzXtHM1vK08bNVzGFUAsG+1Av/ycs2PHAp5jUhKTiAAcb0s4jXqQfr9cEV7mX GnSwP/rA6COWw== From: Jeff Layton To: Christian Brauner , Richard Weinberger , Anton Ivanov , Johannes Berg Cc: Al Viro , Jan Kara , linux-um@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 37/79] hostfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:50 -0400 Message-ID: <20230621144735.55953-36-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 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?1769325719314461227?= X-GMAIL-MSGID: =?utf-8?q?1769325719314461227?= 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 --- fs/hostfs/hostfs_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 46387090eb76..2248a2e599a7 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -517,8 +517,8 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st) (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec }; ino->i_mtime = (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec }; - ino->i_ctime = - (struct timespec64){ st->ctime.tv_sec, st->ctime.tv_nsec }; + inode_ctime_set(ino, + (struct timespec64){ st->ctime.tv_sec, st->ctime.tv_nsec }); ino->i_size = st->size; ino->i_blocks = st->blocks; return 0; From patchwork Wed Jun 21 14:45:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4424798vqr; Wed, 21 Jun 2023 07:56:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uuZifuqFwx6LqTznk1PdYQ7sgmbaAyhqVdHr3Ip6xoVDhJvSQ4yOyOBVOh7b1eI5fbRr1 X-Received: by 2002:a05:6808:3af:b0:39a:6c25:d60 with SMTP id n15-20020a05680803af00b0039a6c250d60mr6687329oie.29.1687359414800; Wed, 21 Jun 2023 07:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359414; cv=none; d=google.com; s=arc-20160816; b=KREVMiDfVNTbnL2GEdlKcv8TUqhnuurP4VqsVkCWeN+NaPbksmfzxK1XhG+QObErp7 FLmwm3gYAHPWm/6BYk2IYQY9QtFUExOkgNndvsXDUbA9z0KObb+MFkcZhz7PbTiAXT86 sjXO5xTV4BAXjtZJT6YfSaMx0ykmTAyB/s8G98NXZFLIfvRoOKcULc/FVqz/0gOSv7RH k42xSt3qrDf1JyXQtLMAOK5F2YRJgFj+4I4jhP6MjNE+uJLljUubykhVNyC3ACYQ++T3 3GYIR5KDlA4qk8CRuPR9vuxwS8HLk3elRZBvm0rBMSFx1gREByJo5j6d5jDhhxb2YzmN 3pXQ== 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=WTDnmGovsOTAKUAF1oyYpgYkB+wovB/bs5LGfu85OMk=; b=MWHVSC+6NtbvTxSAhFymZHlL1Xn6kg2ltnsjJKy51xVf+cf68kGwKOhFQIM2JhEQUd X9AkMQTi3G6S5XMzTRrQubUNXC7A8qf4O4/X8Sq+YFwI95MMC686Rv+1Jl/26rEyLbuR OnwDT60WV/3IAQynG9UHOHI3cvhQfHw/eF7SjNvKKmNkV0kHStpQbJaxHI8Q1EFtnigH rpQO3g6cxYUFF6ELlCiJuOTCihOK7f686WixBwnWFSugrFhbgdG2wdcx9t6Ok6j7FUTn RXF00R05Zsi0Yqtcr0dp8Ff7EkMbT/xhJDLOwHm8FHYxT7xCqk0uNUvqKFYCFTNz7Qih NFOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eKBamOQM; 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 u12-20020a63600c000000b005573ed4beb7si294803pgb.819.2023.06.21.07.56.40; Wed, 21 Jun 2023 07:56:54 -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=eKBamOQM; 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 S231720AbjFUOvz (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbjFUOuX (ORCPT ); Wed, 21 Jun 2023 10:50:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1A912940 for ; Wed, 21 Jun 2023 07:48:41 -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 D10CE615A2 for ; Wed, 21 Jun 2023 14:48:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B420AC433C8; Wed, 21 Jun 2023 14:48:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358921; bh=E1H3kjMPqVnnnLtEOaYufq1IWOlpBohF5iQnPvBQJ2Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKBamOQM8CEJKZa5No1alMcSV8Mq2/pCaf+u7haRk9sjMfxJF0ULmIuHuUEZtWtvE w5if+zKnqyQAB08jimvGS1hsVyxlxHYkZRBE2fu1PAc0stkNBbxbZ1TK9I5AMkYwK/ 1uv4SXwDuGssXtsbqtVN2hlDFWr9Yb6NZx5wxRt57vD8e2KyBNtaG+QmMcfg0y6+ny eU8NwLB9DTOExNKwlKR+XfsK8NQqQwJs5n9VgTF7aRpG2Dkcwo7Rn7xnPF/VRUiIvI 7ZCINTUR6ESF52HrnbOcDgvlPl9At78I5AwlgGIEyy9s4S8UORWFpMXwRIb/Y4v1IV 2tm/uPhPJ+nSQ== From: Jeff Layton To: Christian Brauner , Mikulas Patocka Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 38/79] hpfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:51 -0400 Message-ID: <20230621144735.55953-37-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324585562586403?= X-GMAIL-MSGID: =?utf-8?q?1769324585562586403?= 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 --- fs/hpfs/dir.c | 8 ++++---- fs/hpfs/inode.c | 6 +++--- fs/hpfs/namei.c | 26 +++++++++++++++----------- fs/hpfs/super.c | 5 +++-- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index f32f15669996..fe808e6a3962 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -277,10 +277,10 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned in * inode. */ - if (!result->i_ctime.tv_sec) { - if (!(result->i_ctime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->creation_date)))) - result->i_ctime.tv_sec = 1; - result->i_ctime.tv_nsec = 0; + if (!inode_ctime_peek(result).tv_sec) { + if (!(inode_ctime_set_sec(result, local_to_gmt(dir->i_sb, le32_to_cpu(de->creation_date))))) + inode_ctime_set_sec(result, 1); + inode_ctime_set_nsec(result, 0); result->i_mtime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->write_date)); result->i_mtime.tv_nsec = 0; result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(de->read_date)); diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index e50e92a42432..48e71035d88c 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -36,7 +36,7 @@ void hpfs_init_inode(struct inode *i) hpfs_inode->i_rddir_off = NULL; hpfs_inode->i_dirty = 0; - i->i_ctime.tv_sec = i->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(i, inode_ctime_set_nsec(i, 0)); i->i_mtime.tv_sec = i->i_mtime.tv_nsec = 0; i->i_atime.tv_sec = i->i_atime.tv_nsec = 0; } @@ -232,7 +232,7 @@ void hpfs_write_inode_nolock(struct inode *i) if (de) { de->write_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_mtime.tv_sec)); de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_atime.tv_sec)); - de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_ctime.tv_sec)); + de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_ctime_peek(i).tv_sec)); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(hpfs_inode->i_ea_size); hpfs_mark_4buffers_dirty(&qbh); @@ -242,7 +242,7 @@ void hpfs_write_inode_nolock(struct inode *i) if ((de = map_dirent(i, hpfs_inode->i_dno, "\001\001", 2, NULL, &qbh))) { de->write_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_mtime.tv_sec)); de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_atime.tv_sec)); - de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, i->i_ctime.tv_sec)); + de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_ctime_peek(i).tv_sec)); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(/*hpfs_inode->i_ea_size*/0); de->file_size = cpu_to_le32(0); diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 69fb40b2c99a..c065ef3fec52 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c @@ -13,10 +13,10 @@ static void hpfs_update_directory_times(struct inode *dir) { time64_t t = local_to_gmt(dir->i_sb, local_get_seconds(dir->i_sb)); if (t == dir->i_mtime.tv_sec && - t == dir->i_ctime.tv_sec) + t == inode_ctime_peek(dir).tv_sec) return; - dir->i_mtime.tv_sec = dir->i_ctime.tv_sec = t; - dir->i_mtime.tv_nsec = dir->i_ctime.tv_nsec = 0; + dir->i_mtime.tv_sec = inode_ctime_set_sec(dir, t); + dir->i_mtime.tv_nsec = inode_ctime_set_nsec(dir, 0); hpfs_write_inode_nolock(dir); } @@ -59,8 +59,9 @@ static int hpfs_mkdir(struct mnt_idmap *idmap, struct inode *dir, result->i_ino = fno; hpfs_i(result)->i_parent_dir = dir->i_ino; hpfs_i(result)->i_dno = dno; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date))); + inode_ctime_set_nsec(result, 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; @@ -167,8 +168,9 @@ static int hpfs_create(struct mnt_idmap *idmap, struct inode *dir, result->i_fop = &hpfs_file_ops; set_nlink(result, 1); hpfs_i(result)->i_parent_dir = dir->i_ino; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date))); + inode_ctime_set_nsec(result, 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; @@ -250,8 +252,9 @@ static int hpfs_mknod(struct mnt_idmap *idmap, struct inode *dir, hpfs_init_inode(result); result->i_ino = fno; hpfs_i(result)->i_parent_dir = dir->i_ino; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date))); + inode_ctime_set_nsec(result, 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; @@ -326,8 +329,9 @@ static int hpfs_symlink(struct mnt_idmap *idmap, struct inode *dir, result->i_ino = fno; hpfs_init_inode(result); hpfs_i(result)->i_parent_dir = dir->i_ino; - result->i_ctime.tv_sec = result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)); - result->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(result, + result->i_mtime.tv_sec = result->i_atime.tv_sec = local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date))); + inode_ctime_set_nsec(result, 0); result->i_mtime.tv_nsec = 0; result->i_atime.tv_nsec = 0; hpfs_i(result)->i_ea_size = 0; diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 1cb89595b875..cc7602d5485e 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -729,8 +729,9 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) root->i_atime.tv_nsec = 0; root->i_mtime.tv_sec = local_to_gmt(s, le32_to_cpu(de->write_date)); root->i_mtime.tv_nsec = 0; - root->i_ctime.tv_sec = local_to_gmt(s, le32_to_cpu(de->creation_date)); - root->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(root, + local_to_gmt(s, le32_to_cpu(de->creation_date))); + inode_ctime_set_nsec(root, 0); hpfs_i(root)->i_ea_size = le32_to_cpu(de->ea_size); hpfs_i(root)->i_parent_dir = root->i_ino; if (root->i_size == -1) From patchwork Wed Jun 21 14:45:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111105 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4439161vqr; Wed, 21 Jun 2023 08:14:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7zIp1DJl7gGyvV6oncxAhxM8u/Uc9z+Rcu2lmTygE2mx0LeNspy/zdPGVv4nL75F7un63B X-Received: by 2002:a05:6808:428b:b0:39a:abe8:afb9 with SMTP id dq11-20020a056808428b00b0039aabe8afb9mr14346005oib.42.1687360497158; Wed, 21 Jun 2023 08:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360497; cv=none; d=google.com; s=arc-20160816; b=SdJbvA4OT0pzZ91cIn08eqsqoKQ8eb9bsW72n6ewlyjbxG7QxI8aDZgo37IGtLkA9X dJRF/3k6kX7NNFaDNjrMQ/VGBiicgPHod5EjtmaJepYpwvXLmt2RHv5Dkh2WlOq2euDt oXqB3XNfVE0tzj4CWjDOi8DljXBc7879mReWnMKcP5zMlQEeR29CtxUbVsA25SnnJQ6g 2dYlfhEkqDvwbOEXRgG/f5dhjepGe6tCVWy8p3n0B+mFSRIEIPZJbA6ccmwihTk6scYs PFtRyeFmHlMiEccsVegdwMcbInelXDB8vhPR4r3PqyWk9uWEB+zwc2o+1/JDuzdkp5tb r0hA== 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=VkD0/8U7N9zK9X6y4pHc5meZAbDYPgt0B5Cze4gXUyY=; b=aEQCnzUQ4ODIrOX7g13oTIcJBb71Eb+Ca3CJC80DTOio5CQ4pznp/YDX7JJwlIdock bRjEP96h7RhFkY6j/sfFWwFOaDGv4ZgQq06stfQXEMH1n2TGbXaZKc1JXpWpDfjzod6W 8avYlqs78l3C0G/A+K+i+VJc6MW4d7otvUdKSuj2t+bQFfGffm440Ub/eWcCrKxP7pyI xd7gqknUVXsVRzdpapbXYWEaufjL88baurT24ZYbf1Rua7e0X/E56Lt2CCHmWxlelo18 /Z6rCR+4Nv95rie8jwBluew1D9X/lGeWPI8wHtO+3rS/FYMpmJrjdrO1QtRL+ysfdKlN 63fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hSKmtL7G; 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 m25-20020a637119000000b0054ff67d6666si4240906pgc.512.2023.06.21.08.14.43; Wed, 21 Jun 2023 08:14:57 -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=hSKmtL7G; 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 S232850AbjFUOwL (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232412AbjFUOuo (ORCPT ); Wed, 21 Jun 2023 10:50:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ABE7296C for ; Wed, 21 Jun 2023 07:48:52 -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 44A066159B for ; Wed, 21 Jun 2023 14:48:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3B23C433C0; Wed, 21 Jun 2023 14:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358922; bh=UvNq+M9oth0ZwLvHaFU15fGRvb6agUkybQaQqyNXMdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hSKmtL7GOzh8ryKxNvlPtCPaMYjdREurFTyaiU4tT/RKIG0YTrSJ2eVDf3SEBiyMq j5WmOAz0nBbsqQfrOq+RV9ZFdzGj1d+9E3epTOFd4lMEcakc46syFOL9LuADxQIWNj a+f9l8ReAu1jL/NzHaH06oT/DyIYYozoWFslZ+exTUcRJ0B4bOcut3FgOsYyirXx50 5eTemc9IpO6dKCthte5LY8lHUUuYVglt9Yrk//4n8zNrQXKDaPd3q8Yx8cN5VTO1mc pdfRxg4A8WDnTh9BC1E37C3xAPk7o3WbgPYzbRVmhobR/726zRgQebtcbA0AlPP1Qx R2XH4puSJLm5A== From: Jeff Layton To: Christian Brauner , Mike Kravetz , Muchun Song Cc: Al Viro , Jan Kara , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 39/79] hugetlbfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:52 -0400 Message-ID: <20230621144735.55953-38-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325720571881493?= X-GMAIL-MSGID: =?utf-8?q?1769325720571881493?= 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 --- fs/hugetlbfs/inode.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 90361a922cec..7be5a8f5927f 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -889,7 +889,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) i_size_write(inode, offset + len); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); out: inode_unlock(inode); return error; @@ -937,7 +937,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, inode->i_mode = S_IFDIR | ctx->mode; inode->i_uid = ctx->uid; inode->i_gid = ctx->gid; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_op = &hugetlbfs_dir_inode_operations; inode->i_fop = &simple_dir_operations; /* directory inodes start off with i_nlink == 2 (for "." entry) */ @@ -981,7 +981,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, &hugetlbfs_i_mmap_rwsem_key); inode->i_mapping->a_ops = &hugetlbfs_aops; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_mapping->private_data = resv_map; info->seals = F_SEAL_SEAL; switch (mode & S_IFMT) { @@ -1024,7 +1024,7 @@ static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); if (!inode) return -ENOSPC; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); d_instantiate(dentry, inode); dget(dentry);/* Extra count - pin the dentry in core */ return 0; @@ -1056,7 +1056,7 @@ static int hugetlbfs_tmpfile(struct mnt_idmap *idmap, inode = hugetlbfs_get_inode(dir->i_sb, dir, mode | S_IFREG, 0); if (!inode) return -ENOSPC; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); d_tmpfile(file, inode); return finish_open_simple(file, 0); } @@ -1078,7 +1078,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap, } else iput(inode); } - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); return error; } From patchwork Wed Jun 21 14:45:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111116 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4443879vqr; Wed, 21 Jun 2023 08:21:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54l1eftDovR4YswlHlGrMVDHngd1hEYtb49SYAsSups1GJCh7SpyEwEXLD66s8n3jkhc0N X-Received: by 2002:a05:6a00:1392:b0:650:154:8bd with SMTP id t18-20020a056a00139200b00650015408bdmr19797706pfg.17.1687360883843; Wed, 21 Jun 2023 08:21:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360883; cv=none; d=google.com; s=arc-20160816; b=mjOTuWtS6K6vOMQU6K/fUbK8YABRTSdzFfd7CLJRBXRJ37TXAaoXyZtBI2KaRqfLIN +LhZ+xwfndXlap2MpIVsC0u65ARKtJS39NBID+/ELrGf3R5snUqNi1FzAZfMUmYn10zF memx27rGywk0VBR/7mjRGLvnK9dRQzo9Cn8n2uAHWMYcdEUKXewwAoqo0xx+PdPvwro8 Mym70goXrNnACxom63aqVDgfoKgcPH2LO0xkjN+sX6tf7NDTnYDkc9hQvi6k2Sc/QBEa QWEc7+mj0jpOQWgRSF0LHC/kSEOWUKhkHivuF7c2NRdQC7SQvS0GiV60Ki3aB047Wcij AO8A== 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=pctME2YYzFkThuLrWo2qIVNWLmOvIbRpyAiY9cKzFpU=; b=CCDIxg4ZfFzvDMgESwx4ai9P/ChJm7bAhQAvIOMboVEDw0eLcR9BXbevutS9xF6sTK bGVWgvzWuq6jjclBvqnZgNYlfl7m0wPxIW/YXLEGBElqitt3VZCrA3VCH0vNqND8BhOr RNap2jhno4Sw/H5BZ1WCCc001bmEyDLzXhhlAVfoejPU55E1OfV2JxYPK+3O0J5OBLpF 736Y8Wh43A2FmmvlyVJeDX04TDd+Cu8NFo0SJLYChT0uFSJ9xMg+yjOkNXk2EVn9JJ52 7AZOQ7TbzAvCmANGes5+0ofckohEslWWyTgcej4OWijtreC7gI3CNkCxi2UyH1ZL7/up s1Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Wsb3/uGF"; 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 e18-20020aa79812000000b0064f50a4a515si4133693pfl.37.2023.06.21.08.21.11; Wed, 21 Jun 2023 08:21:23 -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="Wsb3/uGF"; 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 S232875AbjFUOwV (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjFUOup (ORCPT ); Wed, 21 Jun 2023 10:50:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F182296F; Wed, 21 Jun 2023 07:48:53 -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 AD281615AA; Wed, 21 Jun 2023 14:48:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96814C433C0; Wed, 21 Jun 2023 14:48:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358924; bh=GOlvR7zQkP7YHCqLCSL4MnqspCPui1thTIrZ1lMD+xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wsb3/uGFyYqh0KgV+TN+qB/TlZ2sZd6ovf4WfWNqA8JQnuDvnSzMOUdqU0zoBDbEf dUR/HCHZjRG9dNvEVI1c+lOhVQXDyIEvXlY3KT7lqWcLF0k8A2rMJ4oRQgbOeqDxlD 5jDAkLbRIM7IQ8p3Up+GGS4QqcfdwshnDnmCGOjgxT5Uqskcm/eBTyO4pGNpY8cd9s er2KDyHUPq9eA7XFuZ2awoe6+6SH6BoJlPDxdxyT0iIq94m7puHa0Q8kL+ayaEpg5V mtYdjXz2jYR55HIrd+XbwOYfEcddFITlwR6hye7VUTFKnhSSHD0LqyRUEfU2eld15q jN2SKRYjLQQNg== From: Jeff Layton To: Christian Brauner , Jan Kara Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 40/79] isofs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:53 -0400 Message-ID: <20230621144735.55953-39-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326126337549487?= X-GMAIL-MSGID: =?utf-8?q?1769326126337549487?= 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 --- fs/isofs/inode.c | 4 ++-- fs/isofs/rock.c | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index df9d70588b60..035fa0271d6e 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1425,10 +1425,10 @@ static int isofs_read_inode(struct inode *inode, int relocated) inode->i_mtime.tv_sec = inode->i_atime.tv_sec = - inode->i_ctime.tv_sec = iso_date(de->date, high_sierra); + inode_ctime_set_sec(inode, iso_date(de->date, high_sierra)); inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); ei->i_first_extent = (isonum_733(de->extent) + isonum_711(de->ext_attr_length)); diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index 48f58c6c9e69..6b7f2a62124d 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c @@ -421,10 +421,9 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, /* Rock ridge never appears on a High Sierra disk */ cnt = 0; if (rr->u.TF.flags & TF_CREATE) { - inode->i_ctime.tv_sec = - iso_date(rr->u.TF.times[cnt++].time, - 0); - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, + iso_date(rr->u.TF.times[cnt++].time, 0)); + inode_ctime_set_nsec(inode, 0); } if (rr->u.TF.flags & TF_MODIFY) { inode->i_mtime.tv_sec = @@ -439,10 +438,9 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, inode->i_atime.tv_nsec = 0; } if (rr->u.TF.flags & TF_ATTRIBUTES) { - inode->i_ctime.tv_sec = - iso_date(rr->u.TF.times[cnt++].time, - 0); - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, + iso_date(rr->u.TF.times[cnt++].time, 0)); + inode_ctime_set_nsec(inode, 0); } break; case SIG('S', 'L'): @@ -534,7 +532,7 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, inode->i_size = reloc->i_size; inode->i_blocks = reloc->i_blocks; inode->i_atime = reloc->i_atime; - inode->i_ctime = reloc->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(reloc)); inode->i_mtime = reloc->i_mtime; iput(reloc); break; From patchwork Wed Jun 21 14:45:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111083 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4428900vqr; Wed, 21 Jun 2023 08:02:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4daLRZHDuZ7ZykrNHXv1WRY61VmIPIULSWYCHWmE5iyVNv8/FkMmVFQY/o9k7GAEe9fJqn X-Received: by 2002:a17:902:f802:b0:1b3:dbaa:f3fb with SMTP id ix2-20020a170902f80200b001b3dbaaf3fbmr9457895plb.22.1687359758030; Wed, 21 Jun 2023 08:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359758; cv=none; d=google.com; s=arc-20160816; b=YCV9KqyAPCtzDAKeF5+gplXPVpMa88ZHkJVlgHIQvVXQ8kI6FkWgs7Fm5+bLgLXkQj R7VWe/9WoT3de5dk7SJar6nBZ94BQanfLDfw4NbJs56IYXyijgDXVh+QERm5ZpWE4KO6 gyFiejhrkQVdjYfH42cG67o8BDSr7UNqra4bJbvIdzmZ8rjvQyX9tkBCBH1zutDK/+DH rEk2ElZLKq7OC8fzb2VuOBz/MXmlxSDEPVVwPOoDX8PBNUG+JnKZf8kM30YXf7avQ9v5 0Zrsfl8b5I1x9Ap9A08XKul2vVry8glDRddGU9ENIK0M/ZbqJA8oSd4ANWWysI/E/rXC ryEg== 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=GuLMDTjnIUyJ/7GtGkztJfuOz0hPQrB5XOq5vaUeCmo=; b=sNlGi6Yub2NHVvv48oIoCUEAh3IDFEBiO8CJXdNMtZLJdAwYkSXurpXBwkX+McZXfG 67iRU5vITaR1J58rT/2eKX5bIjxR+CNrGLeuGggT/dmZNaS1JHpWL3ofRA8Tryo+xcoH wZbNg3DSQnchO9CBpfr0NxKQ05XQ7jkVsQjRyi8r5TgFC1AXP6qhqhtjk249fjbtf0ms PN2n453lPkncCixez7SY2C1o1Uo14LZ24enwCmFRSA2SBtpJkJpGoSODOtUde+LAMmLy gNiaPr15m5ehPZLgAKByi3n6CVW0ecf3YYXQLimj70UhX9g78qcYDyWuY4zvs5hSXrag 6noA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GFTPXVd4; 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 lr8-20020a17090b4b8800b0025e8b20ef05si13222714pjb.130.2023.06.21.08.02.24; Wed, 21 Jun 2023 08:02:38 -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=GFTPXVd4; 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 S232793AbjFUOv7 (ORCPT + 99 others); Wed, 21 Jun 2023 10:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbjFUOuY (ORCPT ); Wed, 21 Jun 2023 10:50:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2C021BEC for ; Wed, 21 Jun 2023 07:48:46 -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 B5D4A6157B for ; Wed, 21 Jun 2023 14:48:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77D30C433C0; Wed, 21 Jun 2023 14:48:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358926; bh=Twhymvij7GMEOcAsaX36D+IkSGE4MqrBW94lrQP4NQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GFTPXVd44hNS4f3FJSjgQd++7tIfGJmG7i+80p4uyFKReYWLxFWQ76WLjhn4RErn0 iqtt1+P+gz2rNFpONT9jue1IeNA/Wp0P1d3/IQirTMf6WqYPASJBonEzVqXXEVKLhA XWV790ovj8nS6KDlRefHRki1WSUFsIKm6UUl1zQF20gYoSpK+NH23ygDWZPdywzBfe 2OvsQayjVMkrgKHhvYQXg7vZrKZbML4325biEnin8Zt52K/2whyEbIlSmxGT+ZlCL7 ttq5/eiWyJY1qecg+Rxhu5kMosxS0qmLWEBkUoPp7z5bkmRUyw59zSR8F0mWLwB92/ I77YvLWhAN7OA== From: Jeff Layton To: Christian Brauner , David Woodhouse , Richard Weinberger Cc: Al Viro , Jan Kara , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 41/79] jffs2: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:54 -0400 Message-ID: <20230621144735.55953-40-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324945883646929?= X-GMAIL-MSGID: =?utf-8?q?1769324945883646929?= 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 --- fs/jffs2/dir.c | 19 ++++++++++--------- fs/jffs2/file.c | 3 ++- fs/jffs2/fs.c | 10 +++++----- fs/jffs2/os-linux.h | 2 +- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 5075a0a6d594..2ade386a2c02 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -204,7 +204,7 @@ static int jffs2_create(struct mnt_idmap *idmap, struct inode *dir_i, if (ret) goto fail; - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime)); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(je32_to_cpu(ri->ctime))); jffs2_free_raw_inode(ri); @@ -237,7 +237,7 @@ static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry) if (dead_f->inocache) set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink); if (!ret) - dir_i->i_mtime = dir_i->i_ctime = ITIME(now); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(now)); return ret; } /***********************************************************************/ @@ -271,7 +271,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink); mutex_unlock(&f->sem); d_instantiate(dentry, d_inode(old_dentry)); - dir_i->i_mtime = dir_i->i_ctime = ITIME(now); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(now)); ihold(d_inode(old_dentry)); } return ret; @@ -422,7 +422,7 @@ static int jffs2_symlink (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(je32_to_cpu(rd->mctime))); jffs2_free_raw_dirent(rd); @@ -566,7 +566,7 @@ static int jffs2_mkdir (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(je32_to_cpu(rd->mctime))); inc_nlink(dir_i); jffs2_free_raw_dirent(rd); @@ -607,7 +607,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry) ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, dentry->d_name.len, f, now); if (!ret) { - dir_i->i_mtime = dir_i->i_ctime = ITIME(now); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(now)); clear_nlink(d_inode(dentry)); drop_nlink(dir_i); } @@ -743,7 +743,7 @@ static int jffs2_mknod (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); + dir_i->i_mtime = inode_ctime_set(dir_i, ITIME(je32_to_cpu(rd->mctime))); jffs2_free_raw_dirent(rd); @@ -864,14 +864,15 @@ static int jffs2_rename (struct mnt_idmap *idmap, * caller won't do it on its own since we are returning an error. */ d_invalidate(new_dentry); - new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now); + new_dir_i->i_mtime = inode_ctime_set(new_dir_i, ITIME(now)); return ret; } if (d_is_dir(old_dentry)) drop_nlink(old_dir_i); - new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); + new_dir_i->i_mtime = inode_ctime_set(new_dir_i, ITIME(now)); + old_dir_i->i_mtime = inode_ctime_set(old_dir_i, ITIME(now)); return 0; } diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 2345ca3f09ee..1935e4eb9aa8 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -317,7 +317,8 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, inode->i_size = pos + writtenlen; inode->i_blocks = (inode->i_size + 511) >> 9; - inode->i_ctime = inode->i_mtime = ITIME(je32_to_cpu(ri->ctime)); + inode->i_mtime = ITIME(je32_to_cpu(ri->ctime)); + inode_ctime_set(inode, inode->i_mtime); } } diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 038516bee1ab..1d77c4616ca5 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -115,7 +115,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) ri->isize = cpu_to_je32((ivalid & ATTR_SIZE)?iattr->ia_size:inode->i_size); ri->atime = cpu_to_je32(I_SEC((ivalid & ATTR_ATIME)?iattr->ia_atime:inode->i_atime)); ri->mtime = cpu_to_je32(I_SEC((ivalid & ATTR_MTIME)?iattr->ia_mtime:inode->i_mtime)); - ri->ctime = cpu_to_je32(I_SEC((ivalid & ATTR_CTIME)?iattr->ia_ctime:inode->i_ctime)); + ri->ctime = cpu_to_je32(I_SEC((ivalid & ATTR_CTIME)?iattr->ia_ctime:inode_ctime_peek(inode))); ri->offset = cpu_to_je32(0); ri->csize = ri->dsize = cpu_to_je32(mdatalen); @@ -148,7 +148,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) } /* It worked. Update the inode */ inode->i_atime = ITIME(je32_to_cpu(ri->atime)); - inode->i_ctime = ITIME(je32_to_cpu(ri->ctime)); + inode_ctime_set(inode, ITIME(je32_to_cpu(ri->ctime))); inode->i_mtime = ITIME(je32_to_cpu(ri->mtime)); inode->i_mode = jemode_to_cpu(ri->mode); i_uid_write(inode, je16_to_cpu(ri->uid)); @@ -284,7 +284,7 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) inode->i_size = je32_to_cpu(latest_node.isize); inode->i_atime = ITIME(je32_to_cpu(latest_node.atime)); inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime)); - inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); + inode_ctime_set(inode, ITIME(je32_to_cpu(latest_node.ctime))); set_nlink(inode, f->inocache->pino_nlink); @@ -388,7 +388,7 @@ void jffs2_dirty_inode(struct inode *inode, int flags) iattr.ia_gid = inode->i_gid; iattr.ia_atime = inode->i_atime; iattr.ia_mtime = inode->i_mtime; - iattr.ia_ctime = inode->i_ctime; + iattr.ia_ctime = inode_ctime_peek(inode); jffs2_do_setattr(inode, &iattr); } @@ -475,7 +475,7 @@ struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_r inode->i_mode = jemode_to_cpu(ri->mode); i_gid_write(inode, je16_to_cpu(ri->gid)); i_uid_write(inode, je16_to_cpu(ri->uid)); - inode->i_atime = inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode->i_mtime)); inode->i_blocks = 0; diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 8da19766c101..2c22fdd4762e 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -35,7 +35,7 @@ struct kvec; #define ITIME(sec) ((struct timespec64){sec, 0}) #define JFFS2_NOW() JFFS2_CLAMP_TIME(ktime_get_real_seconds()) #define I_SEC(tv) JFFS2_CLAMP_TIME((tv).tv_sec) -#define JFFS2_F_I_CTIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_ctime) +#define JFFS2_F_I_CTIME(f) I_SEC(inode_ctime_peek(OFNI_EDONI_2SFFJ(f))) #define JFFS2_F_I_MTIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_mtime) #define JFFS2_F_I_ATIME(f) I_SEC(OFNI_EDONI_2SFFJ(f)->i_atime) #define sleep_on_spinunlock(wq, s) \ From patchwork Wed Jun 21 14:45:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4422973vqr; Wed, 21 Jun 2023 07:53:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42cyaXGkT80iN0Mvi5fe0NWR7DoMbbs0HY6OQg83LXQesLg8XrkS+xl7/AhkyFJZrbvA+m X-Received: by 2002:a05:6808:148a:b0:3a0:427d:4426 with SMTP id e10-20020a056808148a00b003a0427d4426mr4639422oiw.32.1687359213623; Wed, 21 Jun 2023 07:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359213; cv=none; d=google.com; s=arc-20160816; b=ypX8vZ/q9KbgvQAdgGfxwIDCliwOxJdZ38OKm1TpJjUxxBu5gcKJS/LFj06hoXuVDy t9hInp+sbzpPIUT81lTQZy1av9WDE37fNJ/pClbp9ghrGZ5oy1A6n+URejoFIS+nG8/1 xi/W8u4tzjWxHHvT31F6ARyJTrlBH0JBoprxAl1+TmGG6JPbVFj8K9bumf4rRtCBemln mPRN6sicQtsxatoShn1rkDSq3VK+mnJTedOeoZQiNi7BpRQa8OVx1Ze9jmYdwcJ6gjT2 vBwtMEhvAh7TgXNuqJd3wg8H8vf+X6uhNijcQ0SzTsXipuXmNFbDPIzPX9wBC/y5h4zs K8uA== 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=Qn7R3enSanur7FQoR4cNdAVX7Qikk8IaaHSkql0pJo0=; b=l+W/wiFcWve60WR+UJADtDbukqlnrvCwzjoaJ9+klVNT6j8jLm2BJ+kqU818WAncwf xafrPyLZiZmyR3T4EO3z9sqOM51dPNy+Gpl3zGuKljTJq4OLv2CQJkEDw7+3Rax0zTki p+GG7l6eFZMPloxwhs3Zwh3C89o3E/aTos+5Tzd62Byuc8qYZ3Ju8Vi/qV5dzWiCHfY9 3A8ad2OJWrzKG9TkGc4fAlU+M2SGeLCsKGEO8GXm+7q+AYi2pmBQUtRNsraKYttfLgxx sVwyCTte6/KI1OUXsEMcv9R2hCy5gJnqV0o6RurAX4MaLZGASrH3m/X0qgxlZn+3p623 BVpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nswtArtf; 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 190-20020a6301c7000000b0054fe43caa81si1052138pgb.782.2023.06.21.07.53.14; Wed, 21 Jun 2023 07:53:33 -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=nswtArtf; 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 S232809AbjFUOwC (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjFUOum (ORCPT ); Wed, 21 Jun 2023 10:50:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D1422960 for ; Wed, 21 Jun 2023 07:48: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 4DE28612B7 for ; Wed, 21 Jun 2023 14:48:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22B33C433C9; Wed, 21 Jun 2023 14:48:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358928; bh=9yebTq6EVhBoX8rrHf72Octh4HtIc/qpgmB1Krl4OyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nswtArtf3g+CnmHAbFdCtaFgnNqrm0VqhPEHVVkTKvNFtDe21Pa2HNvpoLnvjTpco 8LEvdTuE703VB+2szGDDscnx7jNKNjUds9hwQ2x0+itoN+J6z8Kie8TgajeXRCzAVZ mbTmw6uMRE9fiaBH3qmhwDT/v6SHVqWY3TMyDtubeMEog0lezGHqC5ZZfVry3n2HJ6 PcqQFsBJwq8oXvTGEmybiMAOfAxvNbB1nnqQ37vdEKo0jGn+l66RvS1tqY0CEplk+E /NW/H/nvPQTcbNFNK4+qHlzs+n9QhuSJ8mxDwVC6a2IpCzTGoSfMRLFjqfoaCqedoy zVvtZmRKzMB7A== From: Jeff Layton To: Christian Brauner , Dave Kleikamp Cc: Al Viro , Jan Kara , jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 42/79] jfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:55 -0400 Message-ID: <20230621144735.55953-41-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324374939901490?= X-GMAIL-MSGID: =?utf-8?q?1769324374939901490?= 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: Dave Kleikamp --- fs/jfs/acl.c | 2 +- fs/jfs/inode.c | 2 +- fs/jfs/ioctl.c | 2 +- fs/jfs/jfs_imap.c | 8 ++++---- fs/jfs/jfs_inode.c | 4 ++-- fs/jfs/namei.c | 25 +++++++++++++------------ fs/jfs/super.c | 2 +- fs/jfs/xattr.c | 2 +- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index fb96f872d207..3cd6eb00d881 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@ -116,7 +116,7 @@ int jfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, if (!rc) { if (update_mode) { inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); } rc = txCommit(tid, 1, &inode, 0); diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 8ac10e396050..d9f708fc6439 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c @@ -393,7 +393,7 @@ void jfs_truncate_nolock(struct inode *ip, loff_t length) break; } - ip->i_mtime = ip->i_ctime = current_time(ip); + ip->i_mtime = inode_ctime_set_current(ip); mark_inode_dirty(ip); txCommit(tid, 1, &ip, 0); diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index ed7989bc2db1..db22929938a2 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c @@ -96,7 +96,7 @@ int jfs_fileattr_set(struct mnt_idmap *idmap, jfs_inode->mode2 = flags; jfs_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); return 0; diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 390cbfce391f..f32fb967d360 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -3064,8 +3064,8 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip) ip->i_atime.tv_nsec = le32_to_cpu(dip->di_atime.tv_nsec); ip->i_mtime.tv_sec = le32_to_cpu(dip->di_mtime.tv_sec); ip->i_mtime.tv_nsec = le32_to_cpu(dip->di_mtime.tv_nsec); - ip->i_ctime.tv_sec = le32_to_cpu(dip->di_ctime.tv_sec); - ip->i_ctime.tv_nsec = le32_to_cpu(dip->di_ctime.tv_nsec); + inode_ctime_set_sec(ip, le32_to_cpu(dip->di_ctime.tv_sec)); + inode_ctime_set_nsec(ip, le32_to_cpu(dip->di_ctime.tv_nsec)); ip->i_blocks = LBLK2PBLK(ip->i_sb, le64_to_cpu(dip->di_nblocks)); ip->i_generation = le32_to_cpu(dip->di_gen); @@ -3139,8 +3139,8 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip) dip->di_atime.tv_sec = cpu_to_le32(ip->i_atime.tv_sec); dip->di_atime.tv_nsec = cpu_to_le32(ip->i_atime.tv_nsec); - dip->di_ctime.tv_sec = cpu_to_le32(ip->i_ctime.tv_sec); - dip->di_ctime.tv_nsec = cpu_to_le32(ip->i_ctime.tv_nsec); + dip->di_ctime.tv_sec = cpu_to_le32(inode_ctime_peek(ip).tv_sec); + dip->di_ctime.tv_nsec = cpu_to_le32(inode_ctime_peek(ip).tv_nsec); dip->di_mtime.tv_sec = cpu_to_le32(ip->i_mtime.tv_sec); dip->di_mtime.tv_nsec = cpu_to_le32(ip->i_mtime.tv_nsec); dip->di_ixpxd = jfs_ip->ixpxd; /* in-memory pxd's are little-endian */ diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c index 9e1f02767201..5bbae1ff5129 100644 --- a/fs/jfs/jfs_inode.c +++ b/fs/jfs/jfs_inode.c @@ -97,8 +97,8 @@ struct inode *ialloc(struct inode *parent, umode_t mode) jfs_inode->mode2 |= inode->i_mode; inode->i_blocks = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); - jfs_inode->otime = inode->i_ctime.tv_sec; + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); + jfs_inode->otime = inode_ctime_peek(inode).tv_sec; inode->i_generation = JFS_SBI(sb)->gengen++; jfs_inode->cflag = 0; diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 494b9f4043cf..405b4790b916 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c @@ -149,7 +149,7 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip, mark_inode_dirty(ip); - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_ctime_set_current(dip); mark_inode_dirty(dip); @@ -284,7 +284,7 @@ static int jfs_mkdir(struct mnt_idmap *idmap, struct inode *dip, /* update parent directory inode */ inc_nlink(dip); /* for '..' from child directory */ - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_ctime_set_current(dip); mark_inode_dirty(dip); rc = txCommit(tid, 2, &iplist[0], 0); @@ -390,7 +390,7 @@ static int jfs_rmdir(struct inode *dip, struct dentry *dentry) /* update parent directory's link count corresponding * to ".." entry of the target directory deleted */ - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_ctime_set_current(dip); inode_dec_link_count(dip); /* @@ -512,7 +512,8 @@ static int jfs_unlink(struct inode *dip, struct dentry *dentry) ASSERT(ip->i_nlink); - ip->i_ctime = dip->i_ctime = dip->i_mtime = current_time(ip); + dip->i_mtime = inode_ctime_set_current(ip); + inode_ctime_set(dip, dip->i_mtime); mark_inode_dirty(dip); /* update target's inode */ @@ -822,8 +823,8 @@ static int jfs_link(struct dentry *old_dentry, /* update object inode */ inc_nlink(ip); /* for new link */ - ip->i_ctime = current_time(ip); - dir->i_ctime = dir->i_mtime = current_time(dir); + inode_ctime_set_current(ip); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); ihold(ip); @@ -1023,7 +1024,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip, mark_inode_dirty(ip); - dip->i_ctime = dip->i_mtime = current_time(dip); + dip->i_mtime = inode_ctime_set_current(dip); mark_inode_dirty(dip); /* * commit update of parent directory and link object @@ -1200,7 +1201,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, tblk->xflag |= COMMIT_DELETE; tblk->u.ip = new_ip; } else { - new_ip->i_ctime = current_time(new_ip); + inode_ctime_set_current(new_ip); mark_inode_dirty(new_ip); } } else { @@ -1263,10 +1264,10 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, /* * Update ctime on changed/moved inodes & mark dirty */ - old_ip->i_ctime = current_time(old_ip); + inode_ctime_set_current(old_ip); mark_inode_dirty(old_ip); - new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); mark_inode_dirty(new_dir); /* Build list of inodes modified by this transaction */ @@ -1278,7 +1279,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (old_dir != new_dir) { iplist[ipcount++] = new_dir; - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); mark_inode_dirty(old_dir); } @@ -1411,7 +1412,7 @@ static int jfs_mknod(struct mnt_idmap *idmap, struct inode *dir, mark_inode_dirty(ip); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index d2f82cb7db1b..c810b98254dd 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -818,7 +818,7 @@ static ssize_t jfs_quota_write(struct super_block *sb, int type, } if (inode->i_size < off+len-towrite) i_size_write(inode, off+len-towrite); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); inode_unlock(inode); return len - towrite; diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 931e50018f88..71f005bbe486 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -647,7 +647,7 @@ static int ea_put(tid_t tid, struct inode *inode, struct ea_buffer *ea_buf, if (old_blocks) dquot_free_block(inode, old_blocks); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); return 0; } From patchwork Wed Jun 21 14:45:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111135 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4466764vqr; Wed, 21 Jun 2023 08:57:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7N+G8bnGBd1a9kw2hmaGOalL2IX7yN/E0TMamVBWVddi987V9Eenu/H5sr5LUtDGG+kMHc X-Received: by 2002:a17:90b:d87:b0:260:9cad:c56d with SMTP id bg7-20020a17090b0d8700b002609cadc56dmr5945392pjb.7.1687363032382; Wed, 21 Jun 2023 08:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363032; cv=none; d=google.com; s=arc-20160816; b=Hk514jpD0mgCx6zroGQr0AkVN/dSNMr8uKz4WcvMMTHEPRrt6Ch2p3m8Y71zUNBht2 3vaA3Q8ym75xXDK24KVPxpcYgI5gZjc+eEg68cX6WZi3H89LiLca1YBhLIlcOSUK+L2H nnZOAAIYu8Yp854UP2ZaxBf7bEkvn8fqtEMftgMiAKygu6j9wxNNCfixhSR3PEb2tLLj gDR317/6D9VAGhXrWWc+aa80nIuaWLn2l+8HOeIBhhQppGRx42x+YNcqPXrMGOs6HAgv /oDeEJWtfTFkjIKYSVSN7TlYj+H72HI35eTne5c33dL7z16EudYgTiKStCTrtcRlNFr+ kAVw== 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=vzD1KP4h2wGejrpbL3cHaQqdD9ALpQF46xQ+l5gM7YQ=; b=QQl8HQ7e3fYvbJkjVLoeLg9yGUwTmZGNK5eeVVlv845EczLmGtPsT3R6Hso87CcO3P njdlBk9wXFNo4sL6Ejdn55YxziSKcpLVQjPvw90DE2EuKLtP2c5tHd6WjqNtehiCPodw g1FIWoMzr/gUlsa4O+N/+57nj/ZJYq56qE0MFsW+l3c8Yf2hZ5gC5/g5ig1mzNPIBZi1 N8MIFJ1OZrKraadVJnmo4V0/ODmCfTiabAIZtFPIr4Lvk9sV6U6cTlH5wyXilnqhVvJk T/PlSAGKHuzgXhRopqGtMtjm9mJYsn5Exho2Vayz4lKUdfpeox3oTYS4VAtywQ5oWPoH fC/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MToGmduL; 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 j7-20020a17090a694700b0025e9d537637si4415772pjm.158.2023.06.21.08.56.59; Wed, 21 Jun 2023 08:57:12 -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=MToGmduL; 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 S233020AbjFUO40 (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232975AbjFUOy1 (ORCPT ); Wed, 21 Jun 2023 10:54:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C5E530FF for ; Wed, 21 Jun 2023 07:50:10 -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 9FE5E615BA for ; Wed, 21 Jun 2023 14:48:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 724ACC433C8; Wed, 21 Jun 2023 14:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358930; bh=E0tKqEg9JsFBfaTpAiyL7hNRxFYBS0vx8QAOc1Faa+E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MToGmduLV/vxb3bokuYvzQ6GhoLgfmBP+Fdv1GeIahXxgZxGgtmm/k+w7CzY/TEDl JaVq+byk1TpPZk7sSwfiLtfKaw6rl/Ot9MVOclNBKJLxjvHWy1ZsPsrIToOnBBv/hz aaIIWkUs56aTmGNJ3wYLHa0ao5puAtC3geiep5LF3Nm5QBcOY+3jui9EVv1ygK5CCN cY3BGN+CwcQLoxR1yZ750CJ0B8ZrcAb6PcEzvRxyxQ2iMH0KNB10+X5nv5iUlbnY70 QYKyxIrd7qshAwDlzs0tWyLABlQPiMa99sK4sobt7XvAqrqe5ZsuVA8SjZcDUulMg8 lpHOQ5Jt5WyYw== From: Jeff Layton To: Christian Brauner , Greg Kroah-Hartman , Tejun Heo Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 43/79] kernfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:56 -0400 Message-ID: <20230621144735.55953-42-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 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?1769328378710200126?= X-GMAIL-MSGID: =?utf-8?q?1769328378710200126?= 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: Greg Kroah-Hartman --- fs/kernfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index b22b74d1a115..781093c8acdd 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c @@ -152,7 +152,7 @@ static inline void set_default_inode_attr(struct inode *inode, umode_t mode) { inode->i_mode = mode; inode->i_atime = inode->i_mtime = - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } static inline void set_inode_attr(struct inode *inode, @@ -162,7 +162,7 @@ static inline void set_inode_attr(struct inode *inode, inode->i_gid = attrs->ia_gid; inode->i_atime = attrs->ia_atime; inode->i_mtime = attrs->ia_mtime; - inode->i_ctime = attrs->ia_ctime; + inode_ctime_set(inode, attrs->ia_ctime); } static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) From patchwork Wed Jun 21 14:45:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111092 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4435521vqr; Wed, 21 Jun 2023 08:10:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Txul/Tvf6ug7liKrxFb1zba5IyopKjF8fOovSCuicuZH6Be81SbmY9wI3ODCCnxJ3JaK7 X-Received: by 2002:a17:902:eb4d:b0:1b1:7362:9a18 with SMTP id i13-20020a170902eb4d00b001b173629a18mr9926969pli.27.1687360204479; Wed, 21 Jun 2023 08:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360204; cv=none; d=google.com; s=arc-20160816; b=tNk5VMeMX87rMFupvb31VYG5F8/8U0JHsfaWyozcRrnQ//mQgg3nSJOLvW0DZg/SGl iZ9mJncb6s3afxaAqd7e/QH3JSOctq5Eeft48SBeuvGPmB0wgfSV69zTt0AY07ABwHzQ Oqgy0ASxId52ecOy0lMloWqhnBW8QzXrANJW5KNMU0liWKXtfDsw7d5Psdcdg+ud2h4l t6COg/0uLX+aWgIgho84z1WYhsRI7fnKOPQCgZn+zFYTC/IOXqF8WBQ9DT2HDPdIqoMs 6abK/k1tw4EgTsh9DiHdmJ0wM98kSGog4Wxe1V8SOVpd8OtSgchANTqUta7sOBnY2Hiw Iw5g== 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=g3/sNzkGVICx1TVPTeUJWrrNJKXVRCHG6K8sqO9T0Yw=; b=EFS+a7lRkz/VRQlUrnOfL/7uAJAYLeIEH1iLBT31i0gjH1bdX/A2QZaABSGu87WGmY YjUgMNeSJkvf9TD8zLJUNHoglCMq1YSRfnDWLcYPGDFn51HpGdFP/4HgXiJdde85jgMh QswRO7SnAkMMPKLrqRrbvDgsY5uoP5uabMJTQSzPNq17IJ9vDsOaJMToxqpzPMlDG4FV gMWMLPbebckko4qApviN4aGDydBnHDZf/+gjU7sqier9VO5ZqHrymCZRJAf/npsD2VFY 6/BznVyL5dtDnF19pS/Cejs5w+TdUWSzwDDU2dURqsv7ARpCRIy6NN5dqTSBpdL4fGB7 34mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ayvfvJgo; 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 m7-20020a170902768700b001b11168bde3si4219998pll.521.2023.06.21.08.09.48; Wed, 21 Jun 2023 08:10:04 -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=ayvfvJgo; 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 S232778AbjFUOwy (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232777AbjFUOvz (ORCPT ); Wed, 21 Jun 2023 10:51:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 487121FC9 for ; Wed, 21 Jun 2023 07:49:04 -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 858FA61594 for ; Wed, 21 Jun 2023 14:48:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EF25C433C8; Wed, 21 Jun 2023 14:48:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358932; bh=Y+tTUnB61nyY7kKqbWS86qJFkQ3jYva05dtyWEpGLh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ayvfvJgo1pVIg9LcBf5ofNEIdwVoxsgl7Ok9iCh+qvp7Se8dRNFqm5c3N/LFxJE6M TWXmQPpRxTrsphAMZxDXSbrdhyvAUZqF6GvBnAmxtH9E7aamzvaDZYRSAcHQEeD0vC j5raZLQwTUlRBwuIk57/ba2Jgp6TRIhK+c3kBbbTIVWdzZ5GOyNc4+bLGkiqNUHOxD Jg3W6AtFQT2NC0kdxhXflisNlt3E95u8Dhyy9I4R/wQb8FvdF9j9bva7Vf3dIgbUDY VL2HaCRpJ6cOJVANZFRArnfraUGAZVuk80orP3whwp/WXt16pUUpFZ7PnD18uLr8Fe h7lS9pysPXO/A== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 44/79] minix: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:57 -0400 Message-ID: <20230621144735.55953-43-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325413922661901?= X-GMAIL-MSGID: =?utf-8?q?1769325413922661901?= 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 --- fs/minix/bitmap.c | 2 +- fs/minix/dir.c | 6 +++--- fs/minix/inode.c | 11 ++++++----- fs/minix/itree_common.c | 4 ++-- fs/minix/namei.c | 6 +++--- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c index 870207ba23f1..9d41dce3b8db 100644 --- a/fs/minix/bitmap.c +++ b/fs/minix/bitmap.c @@ -251,7 +251,7 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode) } inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = j; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_blocks = 0; memset(&minix_i(inode)->u, 0, sizeof(minix_i(inode)->u)); insert_inode_hash(inode); diff --git a/fs/minix/dir.c b/fs/minix/dir.c index bf9858f76b6a..03d556635ffc 100644 --- a/fs/minix/dir.c +++ b/fs/minix/dir.c @@ -281,7 +281,7 @@ int minix_add_link(struct dentry *dentry, struct inode *inode) de->inode = inode->i_ino; } dir_commit_chunk(page, pos, sbi->s_dirsize); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); err = minix_handle_dirsync(dir); out_put: @@ -313,7 +313,7 @@ int minix_delete_entry(struct minix_dir_entry *de, struct page *page) else de->inode = 0; dir_commit_chunk(page, pos, len); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); return minix_handle_dirsync(inode); } @@ -436,7 +436,7 @@ int minix_set_link(struct minix_dir_entry *de, struct page *page, else de->inode = inode->i_ino; dir_commit_chunk(page, pos, sbi->s_dirsize); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); return minix_handle_dirsync(dir); } diff --git a/fs/minix/inode.c b/fs/minix/inode.c index e9fbb5303a22..e9c45ecf6ec2 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -501,10 +501,11 @@ static struct inode *V1_minix_iget(struct inode *inode) i_gid_write(inode, raw_inode->i_gid); set_nlink(inode, raw_inode->i_nlinks); inode->i_size = raw_inode->i_size; - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = raw_inode->i_time; + inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode_ctime_set_sec(inode, + raw_inode->i_time); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); inode->i_blocks = 0; for (i = 0; i < 9; i++) minix_inode->u.i1_data[i] = raw_inode->i_zone[i]; @@ -543,10 +544,10 @@ static struct inode *V2_minix_iget(struct inode *inode) inode->i_size = raw_inode->i_size; inode->i_mtime.tv_sec = raw_inode->i_mtime; inode->i_atime.tv_sec = raw_inode->i_atime; - inode->i_ctime.tv_sec = raw_inode->i_ctime; + inode_ctime_set_sec(inode, raw_inode->i_ctime); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); inode->i_blocks = 0; for (i = 0; i < 10; i++) minix_inode->u.i2_data[i] = raw_inode->i_zone[i]; @@ -622,7 +623,7 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode) raw_inode->i_size = inode->i_size; raw_inode->i_mtime = inode->i_mtime.tv_sec; raw_inode->i_atime = inode->i_atime.tv_sec; - raw_inode->i_ctime = inode->i_ctime.tv_sec; + raw_inode->i_ctime = inode_ctime_peek(inode).tv_sec; if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) raw_inode->i_zone[0] = old_encode_dev(inode->i_rdev); else for (i = 0; i < 10; i++) diff --git a/fs/minix/itree_common.c b/fs/minix/itree_common.c index 446148792f41..78e48a6c78a2 100644 --- a/fs/minix/itree_common.c +++ b/fs/minix/itree_common.c @@ -131,7 +131,7 @@ static inline int splice_branch(struct inode *inode, /* We are done with atomic stuff, now do the rest of housekeeping */ - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); /* had we spliced it onto indirect block? */ if (where->bh) @@ -350,7 +350,7 @@ static inline void truncate (struct inode * inode) } first_whole++; } - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); } diff --git a/fs/minix/namei.c b/fs/minix/namei.c index 956d5183828d..f55ea33486c9 100644 --- a/fs/minix/namei.c +++ b/fs/minix/namei.c @@ -98,7 +98,7 @@ static int minix_link(struct dentry * old_dentry, struct inode * dir, { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_link_count(inode); ihold(inode); return add_nondir(dentry, inode); @@ -154,7 +154,7 @@ static int minix_unlink(struct inode * dir, struct dentry *dentry) if (err) return err; - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); inode_dec_link_count(inode); return 0; } @@ -218,7 +218,7 @@ static int minix_rename(struct mnt_idmap *idmap, put_page(new_page); if (err) goto out_dir; - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); From patchwork Wed Jun 21 14:45:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111113 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4443158vqr; Wed, 21 Jun 2023 08:20:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4MiOLdz7U8PVq2Fb2XX3mhUWStkeVjVU2IjRQkGNnaXBul8NMmc1iuPIwwIczjpPae4EFa X-Received: by 2002:a17:903:1ce:b0:1b6:8de4:a2c9 with SMTP id e14-20020a17090301ce00b001b68de4a2c9mr4407901plh.66.1687360823261; Wed, 21 Jun 2023 08:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360823; cv=none; d=google.com; s=arc-20160816; b=V6PMQHL5stg2bZkaUYUpKvHpTobZzg2zfpq2cGI8hQ6r5+mD1mQbHUzjc/+QcCNls1 L21HZW2z8BEyXMsiCg8ceLgEAXaAC84f3z9mv8ASIqUe3XV1iyZVY7PozGDG6v147Uma ILjgCURUaWT8uO2b6szAuFgx4F3IEG3Vnv+jIqexW6NxGTqU41kS+Ga7eJJZmJ7ixv5Q SzC2gp/uYf20sS1pbLh/Cqe271aiwDj+WVDcls01uHKMvVk2FCX5+SJx9SIZ2W1FMjcp 634yRYbrAFO9PUibdHRSL4Egqzctfi3RYWsB6Szc3Lqrgt8ku2Y3PQvmPhK2rz5VCudN IzOg== 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=LK8O8h+b3gpqM5KUvlLNDMKxS5wrmlMCSjd5jdvtKx4=; b=DZIJLpTMAUySm2bOBVjgmqcRI2r88fxijf4QcrospgqCO3L5eRUoiIoCuftHkNZgLn TtyzBwRdOAcRuhinO+6xRSdn3/PlZPayDEn/DJEQK4wyYBW0AfaJwGegNDBI5rUHBWPl 54uJMaGavlFofHxbXWQN7rLZVizKKnWdwQT6BQEJOR8CyuwdTqVaI652D3QbvFfJ1+WA Mo02u76FR9JX+6quLBo8NXeF+MeSBHZ5N+QlEv7X6AACZCqSsf32XV7QAyDsUnvKZ13j I6ZsiE1DQJD+SzSll6a2r1lBUs1yDNqeFW9Brk3tbp2d0r4sU1u2M+YDFJQM4n83WJgP TNAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vfm6clhm; 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 j3-20020a170903028300b001b694ecf48esi689266plr.100.2023.06.21.08.20.09; Wed, 21 Jun 2023 08:20:23 -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=Vfm6clhm; 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 S231464AbjFUOwS (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232503AbjFUOvD (ORCPT ); Wed, 21 Jun 2023 10:51:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46FC1994; Wed, 21 Jun 2023 07:48:54 -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 5F7CC61593; Wed, 21 Jun 2023 14:48:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D00BC433C8; Wed, 21 Jun 2023 14:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358933; bh=MY6mT00ynJC7gWrFRag5H79VJzPsY926+Cc80XaEvT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vfm6clhmA9VGRlnCKwWiGg+3rR+17VSVMNzcNhQspybcY256kPnQfmWJm8pHcPgEL Z3SrWZBk3ANeZerVEi0rn+F8gA0gZzWw4NHfRzmfNzGgC9WJ0fZa9c9dHgWjIy3ZlN M0vYpcJtiOZuSrQPN2EJdT8+9DTANmvT39Xko6dkTmeXSENQtyKT/1n90GKozUqy0j uRKStcoopAVce9dbI5Eo0BB+bIsc4gcI0eJDpZjLyG8x94KK30aZQHklmKnTcbIZ4l Wr98RnSUFNR1Ky+Oew/VpbbvcuO+gKbsGIcvnlRkWwB0iUPfK9smCU6OkHEePWEZKs 401LIyjvC7aPQ== From: Jeff Layton To: Christian Brauner , Trond Myklebust , Anna Schumaker Cc: Al Viro , Jan Kara , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 45/79] nfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:45:58 -0400 Message-ID: <20230621144735.55953-44-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326062493632876?= X-GMAIL-MSGID: =?utf-8?q?1769326062493632876?= 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 --- fs/nfs/callback_proc.c | 2 +- fs/nfs/fscache.h | 4 ++-- fs/nfs/inode.c | 21 +++++++++++---------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index c1eda73254e1..995654050815 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -59,7 +59,7 @@ __be32 nfs4_callback_getattr(void *argp, void *resp, res->change_attr = delegation->change_attr; if (nfs_have_writebacks(inode)) res->change_attr++; - res->ctime = inode->i_ctime; + res->ctime = inode_ctime_peek(inode); res->mtime = inode->i_mtime; res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & args->bitmap[0]; diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index e1706e736c64..98be316c64a0 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h @@ -116,8 +116,8 @@ static inline void nfs_fscache_update_auxdata(struct nfs_fscache_inode_auxdata * memset(auxdata, 0, sizeof(*auxdata)); auxdata->mtime_sec = inode->i_mtime.tv_sec; auxdata->mtime_nsec = inode->i_mtime.tv_nsec; - auxdata->ctime_sec = inode->i_ctime.tv_sec; - auxdata->ctime_nsec = inode->i_ctime.tv_nsec; + auxdata->ctime_sec = inode_ctime_peek(inode).tv_sec; + auxdata->ctime_nsec = inode_ctime_peek(inode).tv_nsec; if (NFS_SERVER(inode)->nfs_client->rpc_ops->version == 4) auxdata->change_attr = inode_peek_iversion_raw(inode); diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index a910b9a638c5..bc4cac08bb24 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -514,7 +514,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) memset(&inode->i_atime, 0, sizeof(inode->i_atime)); memset(&inode->i_mtime, 0, sizeof(inode->i_mtime)); - memset(&inode->i_ctime, 0, sizeof(inode->i_ctime)); + inode_ctime_set_sec(inode, 0); + inode_ctime_set_nsec(inode, 0); inode_set_iversion_raw(inode, 0); inode->i_size = 0; clear_nlink(inode); @@ -535,7 +536,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) else if (fattr_supported & NFS_ATTR_FATTR_MTIME) nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_ctime_set(inode, fattr->ctime); else if (fattr_supported & NFS_ATTR_FATTR_CTIME) nfs_set_cache_invalid(inode, NFS_INO_INVALID_CTIME); if (fattr->valid & NFS_ATTR_FATTR_CHANGE) @@ -731,7 +732,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, if ((attr->ia_valid & ATTR_GID) != 0) inode->i_gid = attr->ia_gid; if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_ctime_set(inode, fattr->ctime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME); @@ -749,7 +750,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_ctime_set(inode, fattr->ctime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME); @@ -765,7 +766,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_ctime_set(inode, fattr->ctime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME); @@ -1444,11 +1445,11 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) nfs_set_cache_invalid(inode, NFS_INO_INVALID_XATTR); } /* If we have atomic WCC data, we may update some attributes */ - ts = inode->i_ctime; + ts = inode_ctime_peek(inode); if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) && (fattr->valid & NFS_ATTR_FATTR_CTIME) && timespec64_equal(&ts, &fattr->pre_ctime)) { - inode->i_ctime = fattr->ctime; + inode_ctime_set(inode, fattr->ctime); } ts = inode->i_mtime; @@ -1510,7 +1511,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec64_equal(&ts, &fattr->mtime)) invalid |= NFS_INO_INVALID_MTIME; - ts = inode->i_ctime; + ts = inode_ctime_peek(inode); if ((fattr->valid & NFS_ATTR_FATTR_CTIME) && !timespec64_equal(&ts, &fattr->ctime)) invalid |= NFS_INO_INVALID_CTIME; @@ -1997,7 +1998,7 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa } if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { - fattr->pre_ctime = inode->i_ctime; + fattr->pre_ctime = inode_ctime_peek(inode); fattr->valid |= NFS_ATTR_FATTR_PRECTIME; } if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && @@ -2190,7 +2191,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) save_cache_validity & NFS_INO_INVALID_MTIME; if (fattr->valid & NFS_ATTR_FATTR_CTIME) - inode->i_ctime = fattr->ctime; + inode_ctime_set(inode, fattr->ctime); else if (fattr_supported & NFS_ATTR_FATTR_CTIME) nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_CTIME; 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: 111066 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4423212vqr; Wed, 21 Jun 2023 07:54:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xDvB0B3QdWZxLZtWgsKCrU/pI2YMqooPCOVN34YYoufswxbfuMxi9/vjVDYSj/zgCznSx X-Received: by 2002:a17:90a:fa6:b0:250:8f09:75f2 with SMTP id 35-20020a17090a0fa600b002508f0975f2mr5086609pjz.22.1687359240563; Wed, 21 Jun 2023 07:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359240; cv=none; d=google.com; s=arc-20160816; b=IESncYlVfWcYqQ0njnzrebimTpjuBeO2PCiXVBpploCVM1/6xi+L/G1QrvAVTBypR7 TB2YKIlAnoh/cr6/nLQjLM8UsNu7syKx5AuOfNy2bZpt3269bSLpEVAwD3YOu9PQxqYO /+AqSDrb45CrmPxPkUHXGhDMKOUQqgFEnn8XRUl8GYLRJ6stzAr9ekmQMPCxZnssr0x1 bNBR9gcArD9n9LcRo63uXg3JKU9MHBHThCqox43v1III4OMiFcyG05x6PYKM9Xz2v7yn g/2COpF+jknO2/j0zKoO7gTVN5bZ98/gwSX/N/JD4wr9TyKIXgsymKv/wv1mxT3fefc2 nHdQ== 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=9ns7d4oAN7rwn/zC+fPdRE3StqbzvCnpIcaPJ2G1nh4=; b=ofAicu3+opZKDn2wcodUmmcUepzikfvGGjqHDsa8WVVYkCvvnLJmAP8iGysmPPLle6 yYijQKzH5ViDMacFrdusWXtilWibhoxdZY3n1V2/bzL6JN2ZJ4QKQj1QiEv7y0vWzwOH KybC82+D6lV14RxrkZ95L3WruThleiu+h4mveCVMfTGMvr+uVDY9+b+go47GJExXAvM+ FsO37orHhyr2YE0ZUgXvRyZdexnMJuvYowvuthmSKbzgGo8q/w7n2dM+TlhGUt5fUB3y JVnEyqB4fEoeFVoiyg35qimiOeL/CYu/B3ycGY7y0l0rZypo0niXqU/WdmzCTFv6P9hr duBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zikb5bQr; 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 gg2-20020a17090b0a0200b00256933298absi12045064pjb.84.2023.06.21.07.53.45; Wed, 21 Jun 2023 07:54:00 -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=Zikb5bQr; 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 S230392AbjFUOw1 (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:27 -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 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?1769324403068135621?= X-GMAIL-MSGID: =?utf-8?q?1769324403068135621?= 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; /* From patchwork Wed Jun 21 14:46:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111084 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4428909vqr; Wed, 21 Jun 2023 08:02:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hyUPMR6WvPQiQl6Bmgmt9GVxqMKXO9XIQs4har6tDRCK/n+CjkpfHE7/RsdLmWkJjhDFA X-Received: by 2002:a05:6830:1311:b0:6b4:6dce:7706 with SMTP id p17-20020a056830131100b006b46dce7706mr7705123otq.36.1687359758328; Wed, 21 Jun 2023 08:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359758; cv=none; d=google.com; s=arc-20160816; b=nUAehp5HEiW5d4gIK35gojnaBrSRAB+gNBAS4NNmxpS6V7n4D0nNewGTi0YI80SJMI WRJDYtU1QEioqeZlzu3aF3hH5iKWACBdPv+8L+XQWN4x6ANy04allctOBnMf1kI69jov PF2ZUne5hRpOZ2f0W20gxBsTxRw1vveQHYoZCAiiMqLPJ6n4qsU/wRJkK4KLzObO4YQG RQHqWDKBU8t8jgyVLHsuFVmExD9mUTxsTBbrEDbHEFZAyojvDXZFsuHniw33EVbPVFNO JoosEILEpw1dCeIesy6IiiyBHn+Z4SsE8SFETN5vBZi5XJ9Hry68AYrmWRr7DOD3/rXu YYyA== 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=J7lG+HSgDjirpasQBnmvF5LhuO+6wV+vBvpyzFOX0wI=; b=GVb2m3MDZQJopo+8pI+UKv6BmRQRIyYZv39642V6wdmfHLjjUvfVUQSt+gqrq7UUqx o6tQEi5Dr/80qPZB/9IrBLuZ3XUJEDFeKr3p6qKJYvueUbfrFDeITYmLYC9whO/UHQDr /b32G7DDgzPoxeRJhQafskujVSxVokFLUeC8QeisIBRIc6ccXlgVR2FlpliuY2mg1XJR IVFN4iCcgv6PqlWp7lgLbfJoUQlfbryij/wv6xzyZbWRJOFNfvVea8fyhc3nG3SfPVQ+ EUhEg/tcvo9Y9GrE2r5lK/wSWJtbznmXHpa0TDmvQKw/u0JdTjlvVGrLunDTVXmPsToT vFoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ph+klMpF; 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 o2-20020a9d4042000000b006b54846927csi2074669oti.116.2023.06.21.08.02.24; Wed, 21 Jun 2023 08:02:38 -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=ph+klMpF; 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 S232965AbjFUOxP (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232657AbjFUOwN (ORCPT ); Wed, 21 Jun 2023 10:52:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C3BC1FD8; Wed, 21 Jun 2023 07:49:12 -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 1B9DB6159F; Wed, 21 Jun 2023 14:48:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1AD7C433C0; Wed, 21 Jun 2023 14:48:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358937; bh=YI0ekcjuxgrtvDegmv/g98VNDJqmIL3E+j0N+sr4RfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ph+klMpFn0NnfmWDST8YV5l2WD5+GGXP+55Ibv5XHUI/SRE5Rr/QHhu2wb8qKDC9Q SWDk5P/k+cbkLXA+CwywekH6U6HMgeFh0407se6Rlngxd2yKsV+T9TmYO+W1WER6Vf 371BWyAvTsp711mSR+V11XY/nphXVkkbyY+0NrHnVBhTP5STIpc9vy6nNdmB3WxOin PzZRehXRlOMo4BMoFb/m/jq6As/dcZS3VWvNQKw4o3NOvpngL7Dwett3bMy+ug6n4C wdVzRonhZu7dlbfp8YkNt/uJydCOnjOoNzsGbV9AWYaxWEVeqs2sy44KWlWxQe6q7p nsYTR01hDaY9w== From: Jeff Layton To: Christian Brauner , Ryusuke Konishi Cc: Al Viro , Jan Kara , linux-nilfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 47/79] nilfs2: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:00 -0400 Message-ID: <20230621144735.55953-46-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324945604210633?= X-GMAIL-MSGID: =?utf-8?q?1769324945604210633?= 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: Ryusuke Konishi --- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 12 ++++++------ fs/nilfs2/ioctl.c | 2 +- fs/nilfs2/namei.c | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index decd6471300b..a51d13a95651 100644 --- a/fs/nilfs2/dir.c +++ b/fs/nilfs2/dir.c @@ -429,7 +429,7 @@ void nilfs_set_link(struct inode *dir, struct nilfs_dir_entry *de, nilfs_set_de_type(de, inode); nilfs_commit_chunk(page, mapping, from, to); nilfs_put_page(page); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); } /* @@ -519,7 +519,7 @@ int nilfs_add_link(struct dentry *dentry, struct inode *inode) de->inode = cpu_to_le64(inode->i_ino); nilfs_set_de_type(de, inode); nilfs_commit_chunk(page, page->mapping, from, to); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); nilfs_mark_inode_dirty(dir); /* OFFSET_CACHE */ out_put: @@ -567,7 +567,7 @@ int nilfs_delete_entry(struct nilfs_dir_entry *dir, struct page *page) pde->rec_len = nilfs_rec_len_to_disk(to - from); dir->inode = 0; nilfs_commit_chunk(page, mapping, from, to); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); out: nilfs_put_page(page); return err; diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index a8ce522ac747..dee831f7426f 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c @@ -366,7 +366,7 @@ struct inode *nilfs_new_inode(struct inode *dir, umode_t mode) atomic64_inc(&root->inodes_count); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = ino; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) { err = nilfs_bmap_read(ii->i_bmap, NULL); @@ -450,10 +450,10 @@ int nilfs_read_inode_common(struct inode *inode, set_nlink(inode, le16_to_cpu(raw_inode->i_links_count)); inode->i_size = le64_to_cpu(raw_inode->i_size); inode->i_atime.tv_sec = le64_to_cpu(raw_inode->i_mtime); - inode->i_ctime.tv_sec = le64_to_cpu(raw_inode->i_ctime); + inode_ctime_set_sec(inode, le64_to_cpu(raw_inode->i_ctime)); inode->i_mtime.tv_sec = le64_to_cpu(raw_inode->i_mtime); inode->i_atime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); - inode->i_ctime.tv_nsec = le32_to_cpu(raw_inode->i_ctime_nsec); + inode_ctime_set_nsec(inode, le32_to_cpu(raw_inode->i_ctime_nsec)); inode->i_mtime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); if (nilfs_is_metadata_file_inode(inode) && !S_ISREG(inode->i_mode)) return -EIO; /* this inode is for metadata and corrupted */ @@ -768,9 +768,9 @@ void nilfs_write_inode_common(struct inode *inode, raw_inode->i_gid = cpu_to_le32(i_gid_read(inode)); raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); raw_inode->i_size = cpu_to_le64(inode->i_size); - raw_inode->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); + raw_inode->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); raw_inode->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); - raw_inode->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + raw_inode->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); raw_inode->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); raw_inode->i_blocks = cpu_to_le64(inode->i_blocks); @@ -875,7 +875,7 @@ void nilfs_truncate(struct inode *inode) nilfs_truncate_bmap(ii, blkoff); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index 1dfbc0c34513..811fab46e277 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c @@ -149,7 +149,7 @@ int nilfs_fileattr_set(struct mnt_idmap *idmap, NILFS_I(inode)->i_flags = oldflags | (flags & FS_FL_USER_MODIFIABLE); nilfs_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c index c7024da8f1e2..251f6021c3db 100644 --- a/fs/nilfs2/namei.c +++ b/fs/nilfs2/namei.c @@ -185,7 +185,7 @@ static int nilfs_link(struct dentry *old_dentry, struct inode *dir, if (err) return err; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -283,7 +283,7 @@ static int nilfs_do_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); drop_nlink(inode); err = 0; out: @@ -387,7 +387,7 @@ static int nilfs_rename(struct mnt_idmap *idmap, goto out_dir; nilfs_set_link(new_dir, new_de, new_page, old_inode); nilfs_mark_inode_dirty(new_dir); - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); if (dir_de) drop_nlink(new_inode); drop_nlink(new_inode); @@ -406,7 +406,7 @@ static int nilfs_rename(struct mnt_idmap *idmap, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); nilfs_delete_entry(old_de, old_page); From patchwork Wed Jun 21 14:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4436869vqr; Wed, 21 Jun 2023 08:11:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jgF7tvHHcc3SZR6qb7VEHisszFtlFye3UTonLZIebBHc2Wx9RsxWAj2HHqvFtME/uKJTs X-Received: by 2002:a17:902:b7c9:b0:1b2:676d:1143 with SMTP id v9-20020a170902b7c900b001b2676d1143mr18513323plz.15.1687360299538; Wed, 21 Jun 2023 08:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360299; cv=none; d=google.com; s=arc-20160816; b=Qa19diKd44YOH2T+SZPWLkQkC9ZST1SbH3MiV0JLb/nUIPB90HsAcm4j5cE6vF4HCf TmA7Y1wj2+vkuXipaEhnHALF9wppXo3Q4yCGO/+jXa5jts8oRmpAAHc6148FpNvm4DZ4 pR03NRLvnfOmsGIqKfOOPWKxZpzakkpVXo07Xp7Fe65SkbAsm5ahPmvbH1MRrQ8z63vv Ih8QMyxD+e7zlblrtx7UslP8OcqJURHTzfBsO2HGJgmbh65Ub1uzQuH5NBhq5d9ikG+W ZRHBCX60NULYWHII9FadIYZpXfz/M0D7Y2rGFdpvewIt9MXc+p223hBynlDS5DToFAsv EdHw== 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=dZcnYY0Oxm9bRkMxDCNCZ0zbn8esw62Yk3QUiahNlYs=; b=CjX/C7LP1UqgsW5gd+EHVr83hYkwxSyK+/3uUOdwRa8l2Yz3J++uwrhk0Hm6Rzf36U PPluUSD3+L5UWnZOZaHaKnryIHEpT/0wx/i5DFz+izzX25AV+jjbqIYYAvTvWtFcqahr lcB+v5UyDqA0UOHznD8lqTysM8Rc3MTuLCG6s6rYz4etHivifjvFePNgVBrrE9NWIoAn yaUxeJpT5eNaD1sx0Qfhz1gM2ffMit2gcLkLg9O4ZgZ5/McNEqU4IKz8CFpUspgOoHaS AJAuLgWzTRf7Cv1yyclSmgas8nHyon8QACZFqpt7MZnH3ogp/v1otNQDJfvpdZAH4lyc jKxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gcAdQAMz; 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 i1-20020a170902c94100b001b3b93609c6si4627762pla.538.2023.06.21.08.11.25; Wed, 21 Jun 2023 08:11:39 -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=gcAdQAMz; 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 S232882AbjFUOwa (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbjFUOvt (ORCPT ); Wed, 21 Jun 2023 10:51:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E04972D55 for ; Wed, 21 Jun 2023 07:48:59 -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 AC2B46157E for ; Wed, 21 Jun 2023 14:48:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A691C433C8; Wed, 21 Jun 2023 14:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358939; bh=SEEgw3h/jPpL+PXMgRE1LQFrTLNf3+Q9wbIwlE7Cr0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gcAdQAMzyrGX5k0WK/Id5YI5rykQYZBVvKLlxg5vMF+8k4rmqKh1fsU5cgbPB5gyB vp8R00GrGH2340dsBfafDn2Se13REpYMWmPPc/mWmdz+f9GMByUZMA69dm2pnlPbv7 iuZ2BE+iuVDdFPLm1FwfOBv6S7rzo4BZ/m6bvFMQjoMwQYl3BPQoSuFeaTbn7yTchS 9jR0ennu4zUPa/KqRRYBhLcpe54un12hHEVvSC3qv4nsz/FF6gfm1MOnlIxo80Smv8 snJtL31ypO9aXMvcDf9+ceBmpf5j0wX+QnzNeXJV6NoMPtI4V3cG+PVgbA9Vdavq9D I8zzvMV7FFb8w== From: Jeff Layton To: Christian Brauner , Anton Altaparmakov , Namjae Jeon Cc: Al Viro , Jan Kara , linux-ntfs-dev@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 48/79] ntfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:01 -0400 Message-ID: <20230621144735.55953-47-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325512904438702?= X-GMAIL-MSGID: =?utf-8?q?1769325512904438702?= 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 --- fs/ntfs/inode.c | 15 ++++++++------- fs/ntfs/mft.c | 3 +-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 6c3f38d66579..285142c22275 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -654,7 +654,7 @@ static int ntfs_read_locked_inode(struct inode *vi) * always changes, when mtime is changed. ctime can be changed on its * own, mtime is then not changed, e.g. when a file is renamed. */ - vi->i_ctime = ntfs2utc(si->last_mft_change_time); + inode_ctime_set(vi, ntfs2utc(si->last_mft_change_time)); /* * Last access to the data within the file. Not changed during a rename * for example but changed whenever the file is written to. @@ -1218,7 +1218,7 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi) vi->i_gid = base_vi->i_gid; set_nlink(vi, base_vi->i_nlink); vi->i_mtime = base_vi->i_mtime; - vi->i_ctime = base_vi->i_ctime; + inode_ctime_set(vi, inode_ctime_peek(base_vi)); vi->i_atime = base_vi->i_atime; vi->i_generation = ni->seq_no = base_ni->seq_no; @@ -1484,7 +1484,7 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi) vi->i_gid = base_vi->i_gid; set_nlink(vi, base_vi->i_nlink); vi->i_mtime = base_vi->i_mtime; - vi->i_ctime = base_vi->i_ctime; + inode_ctime_set(vi, inode_ctime_peek(base_vi)); vi->i_atime = base_vi->i_atime; vi->i_generation = ni->seq_no = base_ni->seq_no; /* Set inode type to zero but preserve permissions. */ @@ -2804,13 +2804,14 @@ int ntfs_truncate(struct inode *vi) */ if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { struct timespec64 now = current_time(VFS_I(base_ni)); + struct timespec64 ctime = inode_ctime_peek(VFS_I(base_ni)); int sync_it = 0; if (!timespec64_equal(&VFS_I(base_ni)->i_mtime, &now) || - !timespec64_equal(&VFS_I(base_ni)->i_ctime, &now)) + !timespec64_equal(&ctime, &now)) sync_it = 1; VFS_I(base_ni)->i_mtime = now; - VFS_I(base_ni)->i_ctime = now; + inode_ctime_set(VFS_I(base_ni), now); if (sync_it) mark_inode_dirty_sync(VFS_I(base_ni)); @@ -2928,7 +2929,7 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, if (ia_valid & ATTR_MTIME) vi->i_mtime = attr->ia_mtime; if (ia_valid & ATTR_CTIME) - vi->i_ctime = attr->ia_ctime; + inode_ctime_set(vi, attr->ia_ctime); mark_inode_dirty(vi); out: return err; @@ -3004,7 +3005,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) si->last_data_change_time = nt; modified = true; } - nt = utc2ntfs(vi->i_ctime); + nt = utc2ntfs(inode_ctime_peek(vi)); if (si->last_mft_change_time != nt) { ntfs_debug("Updating ctime for inode 0x%lx: old = 0x%llx, " "new = 0x%llx", vi->i_ino, (long long) diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 0155f106ec34..68821e312ed2 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -2682,8 +2682,7 @@ ntfs_inode *ntfs_mft_record_alloc(ntfs_volume *vol, const int mode, vi->i_mode &= ~S_IWUGO; /* Set the inode times to the current time. */ - vi->i_atime = vi->i_mtime = vi->i_ctime = - current_time(vi); + vi->i_atime = vi->i_mtime = inode_ctime_set_current(vi); /* * Set the file size to 0, the ntfs inode sizes are set to 0 by * the call to ntfs_init_big_inode() below. From patchwork Wed Jun 21 14:46:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111089 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4433973vqr; Wed, 21 Jun 2023 08:08:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54otIO8AiyDTCrldnlD15QZhRel9fe4tlTwes7ONVWqmc0+ZTMDKdUleKNasCIMfhdDq/l X-Received: by 2002:a17:903:2284:b0:1b6:66f1:358f with SMTP id b4-20020a170903228400b001b666f1358fmr9194222plh.24.1687360088280; Wed, 21 Jun 2023 08:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360088; cv=none; d=google.com; s=arc-20160816; b=U8VaFewHXE31O+sJ7OwuPrbyYESLzYejq1YJdxEHlrykfhtRIX8uLEVW5CPrq5qzIK Pf4aTbkZ38Vuzkash6FPHUEiUirl/xe7gcmKgSu4Q9WVWyGT5opx3dtudZTgHHQe9dfF Q73O5KQJOgg4lqTREdR/XbA8YObj8XPAzEj3A9v48S8YnRH1icXc03AYKu8m1OmDo0Mp M/JMVcEL/zSStgGDEI6vo/J94FdZMVMxALfAO2gwWBjBGqubx25YjZ6ER1VyicVu8uM3 MmIY/w/1RHiBIdiIWH5b7VvXfSf+OiOPh4QtTiiBuF6Sk/0v37KF8yIgaFzPIFpJ7GIL wvBg== 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=8njhI0J2BLtIAGXGKS5OZsTN/5DOJ2HmSsYNzfOBa5g=; b=V2z8ED7Pp5Q5mi2+i4xA6rFOyEBWmzi4bYXu/mcDon6XlUZHSoF6f7HipAwO3iboO7 d4Y7rQ7Vonki12HgCu8nZsd5PBAumoDu0/GFSFCbfCELpEud5Vu3/0KEahS3x6PND8qj gfZHp9vH91qYYs7j4fX13OSAUbDLpXUQJdWSK+t5pwtwNANRwGkUTRFo6FQoVeBPVhP1 QCra75io3ktQrZEpDb9UAVm+Bco8RrD2ja3kthKR2hOlghh5ertWLSeMM+1nTNbn0606 uXMEeu5XAeZFfK6fdEZzn4KyZ67gjEO3iZbao+QNLQmRzvhj66zNrYtpm8oc2UI6lCIE BXHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nG5P6scc; 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 e18-20020a17090301d200b001b024322547si172646plh.577.2023.06.21.08.07.54; Wed, 21 Jun 2023 08:08:08 -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=nG5P6scc; 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 S231896AbjFUOww (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232746AbjFUOvw (ORCPT ); Wed, 21 Jun 2023 10:51:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADDD2735 for ; Wed, 21 Jun 2023 07:49:01 -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 B7D0661572 for ; Wed, 21 Jun 2023 14:49:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D19BC433C0; Wed, 21 Jun 2023 14:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358941; bh=ggTTkYh6IuilLM0I//venIa9AQMvQmdk9UXT783ly/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nG5P6scc+b5lLj/Vq9ZKrD7QcLlwdW68KeIVM5KaOZSk86YGR0eWmn9mlAajiYFZq AQ0REjW40tCADmrz1dWK3qCv8E/mQGeJFb8F23WF078fvzEf6lMx/fSoOkMCXxlnXK CFvZifqe6wslRnKRHOkRCtNGzWpgHn5zV9JNl1bKDlJJgeTgq3f2FAUBAj9IKfGenQ P3GqM16YSz7IOF5tZ2wSPQbLke5noW+debNpX8NaKrLlwep3HiGnqeXaKuRzIi2kpD zY3f4YmuHfIeLv+KcpdRJ6x+sqn7XI9ON8hiVNBGpWraH6aSfcnpWK8PoEkaumXcwo jn70UVESMxKxQ== From: Jeff Layton To: Christian Brauner , Konstantin Komarov Cc: Al Viro , Jan Kara , ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 49/79] ntfs3: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:02 -0400 Message-ID: <20230621144735.55953-48-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 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?1769325291962943036?= X-GMAIL-MSGID: =?utf-8?q?1769325291962943036?= 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 --- fs/ntfs3/file.c | 6 +++--- fs/ntfs3/frecord.c | 4 +++- fs/ntfs3/inode.c | 14 ++++++++------ fs/ntfs3/namei.c | 10 +++++----- fs/ntfs3/xattr.c | 4 ++-- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 1d6c824246c4..032452b3e242 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -342,7 +342,7 @@ static int ntfs_extend(struct inode *inode, loff_t pos, size_t count, err = 0; } - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); if (IS_SYNC(inode)) { @@ -400,7 +400,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size) ni_unlock(ni); ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE; - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (!IS_DIRSYNC(inode)) { dirty = 1; } else { @@ -642,7 +642,7 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) filemap_invalidate_unlock(mapping); if (!err) { - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); } diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index 16bd9faa2d28..4712474d74a7 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -3264,6 +3264,7 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint) if (is_rec_inuse(ni->mi.mrec) && !(sbi->flags & NTFS_FLAGS_LOG_REPLAYING) && inode->i_nlink) { + struct timespec64 ctime; bool modified = false; /* Update times in standard attribute. */ @@ -3280,7 +3281,8 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint) modified = true; } - dup.c_time = kernel2nt(&inode->i_ctime); + ctime = inode_ctime_peek(inode); + dup.c_time = kernel2nt(&ctime); if (std->c_time != dup.c_time) { std->c_time = dup.c_time; modified = true; diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index dc7e7ab701c6..ac1726fc4e16 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -44,6 +44,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, u64 t64; struct MFT_REC *rec; struct runs_tree *run; + struct timespec64 ctime; inode->i_op = NULL; /* Setup 'uid' and 'gid' */ @@ -169,7 +170,8 @@ static struct inode *ntfs_read_mft(struct inode *inode, nt2kernel(std5->cr_time, &ni->i_crtime); #endif nt2kernel(std5->a_time, &inode->i_atime); - nt2kernel(std5->c_time, &inode->i_ctime); + ctime = inode_ctime_peek(inode); + nt2kernel(std5->c_time, &ctime); nt2kernel(std5->m_time, &inode->i_mtime); ni->std_fa = std5->fa; @@ -958,7 +960,7 @@ int ntfs_write_end(struct file *file, struct address_space *mapping, loff_t pos, if (err >= 0) { if (!(ni->std_fa & FILE_ATTRIBUTE_ARCHIVE)) { - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE; dirty = true; } @@ -1658,8 +1660,8 @@ struct inode *ntfs_create_inode(struct mnt_idmap *idmap, struct inode *dir, d_instantiate(dentry, inode); /* Set original time. inode times (i_ctime) may be changed in ntfs_init_acl. */ - inode->i_atime = inode->i_mtime = inode->i_ctime = dir->i_mtime = - dir->i_ctime = ni->i_crtime; + inode->i_atime = inode->i_mtime = inode_ctime_set(inode, ni->i_crtime); + dir->i_mtime = inode_ctime_set(dir, ni->i_crtime); mark_inode_dirty(dir); mark_inode_dirty(inode); @@ -1765,9 +1767,9 @@ int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry) if (!err) { drop_nlink(inode); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); if (inode->i_nlink) mark_inode_dirty(inode); } else if (!ni_remove_name_undo(dir_ni, ni, de, de2, undo_remove)) { diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index 70f8c859e0ad..30e2341533fa 100644 --- a/fs/ntfs3/namei.c +++ b/fs/ntfs3/namei.c @@ -156,8 +156,8 @@ static int ntfs_link(struct dentry *ode, struct inode *dir, struct dentry *de) err = ntfs_link_inode(inode, de); if (!err) { - dir->i_ctime = dir->i_mtime = inode->i_ctime = - current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); + inode_ctime_set_current(inode); mark_inode_dirty(inode); mark_inode_dirty(dir); d_instantiate(de, inode); @@ -324,12 +324,12 @@ static int ntfs_rename(struct mnt_idmap *idmap, struct inode *dir, /* Restore after failed rename failed too. */ _ntfs_bad_inode(inode); } else if (!err) { - inode->i_ctime = dir->i_ctime = dir->i_mtime = - current_time(dir); + inode_ctime_set_current(inode); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(inode); mark_inode_dirty(dir); if (dir != new_dir) { - new_dir->i_mtime = new_dir->i_ctime = dir->i_ctime; + new_dir->i_mtime = inode_ctime_set_current(new_dir); mark_inode_dirty(new_dir); } diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 023f314e8950..fd05965e2a06 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -637,7 +637,7 @@ static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap, if (!err) { set_cached_acl(inode, type, acl); inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); } @@ -924,7 +924,7 @@ static noinline int ntfs_setxattr(const struct xattr_handler *handler, NULL); out: - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); return err; From patchwork Wed Jun 21 14:46:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111136 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4467795vqr; Wed, 21 Jun 2023 08:59:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6STOUvq3Aa+LPtNL2QVqyBZlkzvg/xLTvi0T7m5k/ZAUsLfiTAeBGh+EXjRvjSwRMP+yt+ X-Received: by 2002:a17:902:b48e:b0:1b6:79e3:636d with SMTP id y14-20020a170902b48e00b001b679e3636dmr4744288plr.58.1687363149710; Wed, 21 Jun 2023 08:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363149; cv=none; d=google.com; s=arc-20160816; b=SxqRH7Uk/XC5G9c1nn8qAoomJ1Yn9HK+LfX2NP8iYHMfLpcQln7nbzMihLxadP3edg SURpQoVSWXJdolhiGmnd2MyXUeaMmAr1retxM5gWEEHBSbTyACS8V4PLa0bLWE0P0T/G 2N+jvecaKW3pqiRnIaV1OuGc3oXHohsv3bJIJvitDXepMv2vXKn3Mpaaoc68dg0TyZjq w2Nf4M1pY/2WldfOWo9TnLznX4/L2jaf6Y84lYd62ymUlGfn8xR0mvpyZ/igMgRxlMoK w1rqSTxZbJibPYz1LMPbLAZdKEWZst34F02pDV1+bdjLuxT3kOxBGT/9xek/8bhNAUfa chpQ== 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=ofNnnLe1RY86pueAWJPFjwrIdpGQbtL8eOBu73ev6Ts=; b=u4YdCarXsTSGP9pYnY4JJTDWpij//Aavptj8dPQ3we6t0OIS8N1jRz1rwoKHPOAx7C nxknR5F3hA49wLoW2L/61/ZolhNjh1bUyGlLlNbXFIVaTDZDytJHzHEESsh5JpqvRdih 9TtZCul0178l5Rixo6unWDhHeaangFbnw7gYwCdRngJJHJH3A+pbFcqf1WCrNOs615wu oX28ZRWfG2ld/PL2whxajaBGCP7uzJ7kZBmG7pqkSKqeSVHX8A/PjLF/tETgRAMsdSZW Gse43CT0HhGZP7JjCwG54a8fzrT0Avo8um/Y3gcKI03M5yvfIGeKw8ZJyNQy6dCLjKch nL1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7LTN3mf; 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 n15-20020a170902e54f00b001a970d40828si3602947plf.603.2023.06.21.08.58.56; Wed, 21 Jun 2023 08:59:09 -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=V7LTN3mf; 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 S232690AbjFUO4X (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232692AbjFUOyA (ORCPT ); Wed, 21 Jun 2023 10:54:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD953213A for ; Wed, 21 Jun 2023 07:50:03 -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 366F761599 for ; Wed, 21 Jun 2023 14:49:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7DCEC433C9; Wed, 21 Jun 2023 14:49:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358944; bh=UuqMBTONYbc7aVinRr/zs9pDqPs8q0L6lD8o19D4jVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V7LTN3mfcbnP9AWyugkh4MzC5gkZ6+oaj8OapsfvnPRQwD04ZZEWF+OMVViCBosN2 fnocFQEGmeWE4wZ/IthtLfRmne+mwXR1QMxDsH7RKpllieHcQJCl3zOPRtawnLeqx+ HMipzqWyf/qgPHVsv14i9dSEkDhU6FHi/I/Xlx0ZnbLggBE0IrA/cRLsAfqWkCo3QS y0a61VXFA/Lppyf3hcwJYis1zEXTLgzLTVlj3+9u3BhvOEienc6FylJq/zkMGuCoOr x/0UmeT7bpWkphg5ytglGMmLdmc8xdltT3wy0RIPmNg3aWWHrEKPKPKgHei6tvK7Nm CKyqox+a2HM4g== From: Jeff Layton To: Christian Brauner , Mark Fasheh , Joel Becker , Joseph Qi Cc: Al Viro , Jan Kara , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org Subject: [PATCH 50/79] ocfs2: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:03 -0400 Message-ID: <20230621144735.55953-49-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769328501778725785?= X-GMAIL-MSGID: =?utf-8?q?1769328501778725785?= 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 --- fs/ocfs2/acl.c | 6 +++--- fs/ocfs2/alloc.c | 6 +++--- fs/ocfs2/aops.c | 2 +- fs/ocfs2/dir.c | 8 ++++---- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/dlmglue.c | 10 ++++++---- fs/ocfs2/file.c | 16 +++++++++------- fs/ocfs2/inode.c | 14 ++++++++------ fs/ocfs2/move_extents.c | 6 +++--- fs/ocfs2/namei.c | 22 ++++++++++++---------- fs/ocfs2/refcounttree.c | 14 +++++++------- fs/ocfs2/xattr.c | 6 +++--- 12 files changed, 61 insertions(+), 53 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 9fd03eaf15f8..ad03021412b4 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -191,10 +191,10 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, } inode->i_mode = new_mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); di->i_mode = cpu_to_le16(inode->i_mode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + di->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 51c93929a146..0455b5e0d659 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -7436,10 +7436,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, } inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); - di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 1); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 8dfc284e85f0..873fad14046d 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -2048,7 +2048,7 @@ int ocfs2_write_end_nolock(struct address_space *mapping, } inode->i_blocks = ocfs2_inode_sector_count(inode); di->i_size = cpu_to_le64((u64)i_size_read(inode)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); if (handle) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 694471fc46b8..06fffb5c0fc7 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -1658,7 +1658,7 @@ int __ocfs2_add_entry(handle_t *handle, offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); if (ocfs2_dirent_would_fit(de, rec_len)) { - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); if (retval < 0) { mlog_errno(retval); @@ -2962,11 +2962,11 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, ocfs2_dinode_new_extent_list(dir, di); i_size_write(dir, sb->s_blocksize); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); di->i_size = cpu_to_le64(sb->s_blocksize); - di->i_ctime = di->i_mtime = cpu_to_le64(dir->i_ctime.tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(dir->i_ctime.tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_ctime_peek(dir).tv_sec); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_ctime_peek(dir).tv_nsec); ocfs2_update_inode_fsync_trans(handle, dir, 1); /* diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index ba26c5567cff..8b5a161d827c 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -337,7 +337,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) if (inode) { inode->i_ino = get_next_ino(); inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inc_nlink(inode); inode->i_fop = &simple_dir_operations; @@ -360,7 +360,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, inode->i_ino = get_next_ino(); inode_init_owner(&nop_mnt_idmap, inode, parent, mode); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); ip = DLMFS_I(inode); ip->ip_conn = DLMFS_I(parent)->ip_conn; diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index c28bc983a7b1..0d5679955657 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2162,6 +2162,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; struct ocfs2_meta_lvb *lvb; + struct timespec64 ctime; lvb = ocfs2_dlm_lvb(&lockres->l_lksb); @@ -2184,8 +2185,8 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); lvb->lvb_iatime_packed = cpu_to_be64(ocfs2_pack_timespec(&inode->i_atime)); - lvb->lvb_ictime_packed = - cpu_to_be64(ocfs2_pack_timespec(&inode->i_ctime)); + ctime = inode_ctime_peek(inode); + lvb->lvb_ictime_packed = cpu_to_be64(ocfs2_pack_timespec(&ctime)); lvb->lvb_imtime_packed = cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); @@ -2208,6 +2209,7 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; struct ocfs2_meta_lvb *lvb; + struct timespec64 ctime; mlog_meta_lvb(0, lockres); @@ -2238,8 +2240,8 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) be64_to_cpu(lvb->lvb_iatime_packed)); ocfs2_unpack_timespec(&inode->i_mtime, be64_to_cpu(lvb->lvb_imtime_packed)); - ocfs2_unpack_timespec(&inode->i_ctime, - be64_to_cpu(lvb->lvb_ictime_packed)); + ctime = inode_ctime_peek(inode); + ocfs2_unpack_timespec(&ctime, be64_to_cpu(lvb->lvb_ictime_packed)); spin_unlock(&oi->ip_lock); return 0; } diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 91a194596552..52f126ebd0c2 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -232,8 +232,10 @@ int ocfs2_should_update_atime(struct inode *inode, return 0; if (vfsmnt->mnt_flags & MNT_RELATIME) { + struct timespec64 ctime = inode_ctime_peek(inode); + if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) || - (timespec64_compare(&inode->i_atime, &inode->i_ctime) <= 0)) + (timespec64_compare(&inode->i_atime, &ctime) <= 0)) return 1; return 0; @@ -294,7 +296,7 @@ int ocfs2_set_inode_size(handle_t *handle, i_size_write(inode, new_i_size); inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); if (status < 0) { @@ -415,12 +417,12 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, } i_size_write(inode, new_i_size); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); di = (struct ocfs2_dinode *) fe_bh->b_data; di->i_size = cpu_to_le64(new_i_size); - di->i_ctime = di->i_mtime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, fe_bh); @@ -824,7 +826,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, i_size_write(inode, abs_to); inode->i_blocks = ocfs2_inode_sector_count(inode); di->i_size = cpu_to_le64((u64)i_size_read(inode)); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); di->i_mtime_nsec = di->i_ctime_nsec; @@ -2043,7 +2045,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, goto out_inode_unlock; } - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); if (ret < 0) mlog_errno(ret); diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index bb116c39b581..1627948574fc 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -263,6 +263,7 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, struct super_block *sb; struct ocfs2_super *osb; int use_plocks = 1; + struct timespec64 ts; sb = inode->i_sb; osb = OCFS2_SB(sb); @@ -306,8 +307,9 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec); inode->i_mtime.tv_sec = le64_to_cpu(fe->i_mtime); inode->i_mtime.tv_nsec = le32_to_cpu(fe->i_mtime_nsec); - inode->i_ctime.tv_sec = le64_to_cpu(fe->i_ctime); - inode->i_ctime.tv_nsec = le32_to_cpu(fe->i_ctime_nsec); + ts.tv_sec = le64_to_cpu(fe->i_ctime); + ts.tv_nsec = le32_to_cpu(fe->i_ctime_nsec); + inode_ctime_set(inode, ts); if (OCFS2_I(inode)->ip_blkno != le64_to_cpu(fe->i_blkno)) mlog(ML_ERROR, @@ -1314,8 +1316,8 @@ int ocfs2_mark_inode_dirty(handle_t *handle, fe->i_mode = cpu_to_le16(inode->i_mode); fe->i_atime = cpu_to_le64(inode->i_atime.tv_sec); fe->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); - fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + fe->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + fe->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); fe->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); fe->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); @@ -1352,8 +1354,8 @@ void ocfs2_refresh_inode(struct inode *inode, inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec); inode->i_mtime.tv_sec = le64_to_cpu(fe->i_mtime); inode->i_mtime.tv_nsec = le32_to_cpu(fe->i_mtime_nsec); - inode->i_ctime.tv_sec = le64_to_cpu(fe->i_ctime); - inode->i_ctime.tv_nsec = le32_to_cpu(fe->i_ctime_nsec); + inode_ctime_set_sec(inode, le64_to_cpu(fe->i_ctime)); + inode_ctime_set_nsec(inode, le32_to_cpu(fe->i_ctime_nsec)); spin_unlock(&OCFS2_I(inode)->ip_lock); } diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index b1e32ec4a9d4..f8543a3509ee 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -950,9 +950,9 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) } di = (struct ocfs2_dinode *)di_bh->b_data; - inode->i_ctime = current_time(inode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + inode_ctime_set_current(inode); + di->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 17c52225b87d..3e0c6e2c2669 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -690,6 +690,7 @@ static int ocfs2_link(struct dentry *old_dentry, struct ocfs2_dinode *fe = NULL; struct ocfs2_super *osb = OCFS2_SB(dir->i_sb); struct ocfs2_dir_lookup_result lookup = { NULL, }; + struct timespec64 ts; sigset_t oldset; u64 old_de_ino; @@ -793,10 +794,10 @@ static int ocfs2_link(struct dentry *old_dentry, } inc_nlink(inode); - inode->i_ctime = current_time(inode); + ts = inode_ctime_set_current(inode); ocfs2_set_links_count(fe, inode->i_nlink); - fe->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - fe->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + fe->i_ctime = cpu_to_le64(ts.tv_sec); + fe->i_ctime_nsec = cpu_to_le32(ts.tv_nsec); ocfs2_journal_dirty(handle, fe_bh); err = ocfs2_add_entry(handle, dentry, inode, @@ -995,7 +996,7 @@ static int ocfs2_unlink(struct inode *dir, ocfs2_set_links_count(fe, inode->i_nlink); ocfs2_journal_dirty(handle, fe_bh); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); if (S_ISDIR(inode->i_mode)) drop_nlink(dir); @@ -1537,7 +1538,7 @@ static int ocfs2_rename(struct mnt_idmap *idmap, new_dir_bh, &target_insert); } - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); mark_inode_dirty(old_inode); status = ocfs2_journal_access_di(handle, INODE_CACHE(old_inode), @@ -1546,8 +1547,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (status >= 0) { old_di = (struct ocfs2_dinode *) old_inode_bh->b_data; - old_di->i_ctime = cpu_to_le64(old_inode->i_ctime.tv_sec); - old_di->i_ctime_nsec = cpu_to_le32(old_inode->i_ctime.tv_nsec); + old_di->i_ctime = cpu_to_le64(inode_ctime_peek(old_inode).tv_sec); + old_di->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(old_inode).tv_nsec); ocfs2_journal_dirty(handle, old_inode_bh); } else mlog_errno(status); @@ -1586,9 +1587,9 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (new_inode) { drop_nlink(new_inode); - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); } - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); if (update_dot_dot) { status = ocfs2_update_entry(old_inode, handle, @@ -1610,7 +1611,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (old_dir != new_dir) { /* Keep the same times on both directories.*/ - new_dir->i_ctime = new_dir->i_mtime = old_dir->i_ctime; + new_dir->i_mtime = inode_ctime_peek(old_dir); + inode_ctime_set(new_dir, new_dir->i_mtime); /* * This will also pick up the i_nlink change from the diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 564ab48d03ef..8416c624782f 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3750,9 +3750,9 @@ static int ocfs2_change_ctime(struct inode *inode, goto out_commit; } - inode->i_ctime = current_time(inode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + inode_ctime_set_current(inode); + di->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ocfs2_journal_dirty(handle, di_bh); @@ -4073,10 +4073,10 @@ static int ocfs2_complete_reflink(struct inode *s_inode, * we want mtime to appear identical to the source and * update ctime. */ - t_inode->i_ctime = current_time(t_inode); + inode_ctime_set_current(t_inode); - di->i_ctime = cpu_to_le64(t_inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(t_inode->i_ctime.tv_nsec); + di->i_ctime = cpu_to_le64(inode_ctime_peek(t_inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(t_inode).tv_nsec); t_inode->i_mtime = s_inode->i_mtime; di->i_mtime = s_di->i_mtime; @@ -4456,7 +4456,7 @@ int ocfs2_reflink_update_dest(struct inode *dest, if (newlen > i_size_read(dest)) i_size_write(dest, newlen); spin_unlock(&OCFS2_I(dest)->ip_lock); - dest->i_ctime = dest->i_mtime = current_time(dest); + dest->i_mtime = inode_ctime_set_current(dest); ret = ocfs2_mark_inode_dirty(handle, dest, d_bh); if (ret) { diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 4ac77ff6e676..a137e9e05fa4 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -3421,9 +3421,9 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, goto out; } - inode->i_ctime = current_time(inode); - di->i_ctime = cpu_to_le64(inode->i_ctime.tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + inode_ctime_set_current(inode); + di->i_ctime = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); } out: From patchwork Wed Jun 21 14:46:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111080 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4425903vqr; Wed, 21 Jun 2023 07:59:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4v7F8bffcIrFLaELBPvR54P+EjHu/u0NO4Jqd/q6cwkkC2QEbv/Ne1jKEKxhY/upKKwbQR X-Received: by 2002:a17:902:e801:b0:1b5:4262:ec7b with SMTP id u1-20020a170902e80100b001b54262ec7bmr15111959plg.27.1687359540069; Wed, 21 Jun 2023 07:59:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687359540; cv=none; d=google.com; s=arc-20160816; b=LnJx3+xBHrD/Tsv538z5d0zYR9AeEV/bYQ4IEgljJparA9xW0I6YyZAIWlQaZmuD9d csis4LHfefd2G6XtsChcle5u+X8WNHgjkq1Zzc8DdZtdV680K7G7H17XzL8im1j5FZ13 l1EE+G6w66M8BztmiR/8XMdjqMHwIExwm0kVOgA5d4YHf7vKOn9jWngvnHpWtjXrKh2s HO8AvTK268R4O5LxaonHBn0VkwsKQW4zLql27yQl25RMVmRlETgMJaAGuB556pAfNIpC WpzhcEhjwrMM5y+G94U+cSJ0FxrqJy32yg9K8iMD0im3PLJe4gMNlIaz4cosWgk4kCjL nBMQ== 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=mfxmr3tq3asWkad3A6W2eWoDsLLc3QDZevPjg+tC8IU=; b=SF2zDz2BE73vYw8sMuAVTC55ABGroa3fyGqGOOUwuAi+I8FIAIQvE8YbxWjD7t4/PY vnl4fvoCYImlHl/VZSGK0P0fWJKruhnP+EkHH6Lenqc3YBh6oMfJVirOxY9pAMSVxd2a MqeUynjZGkaSQXOHqUgJLZNAy3fq1OGFhtxcH0EnEwQRIhqbAXzWGEE/HydSXs4YreOR cFKcuh+vmXcEdBni7R6LDseVuMhBnkWD1LMrraBXGD8ZBEut9f6sOzbVDj4zozVcac6A wMBn3//8ZSepzp1wi2K7bvYM5gMyz/dhuPGBbikRathAZKDb6S+xVpBl0SX7bS8IU1Vh AM1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uxs4ILcj; 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 c7-20020a170903234700b001ac2ff9fbf8si718140plh.403.2023.06.21.07.58.47; Wed, 21 Jun 2023 07:59:00 -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=uxs4ILcj; 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 S232388AbjFUOw6 (ORCPT + 99 others); Wed, 21 Jun 2023 10:52:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbjFUOv5 (ORCPT ); Wed, 21 Jun 2023 10:51:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E542F1FD4 for ; Wed, 21 Jun 2023 07:49:06 -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 BE86E6159A for ; Wed, 21 Jun 2023 14:49:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D0AFC433C8; Wed, 21 Jun 2023 14:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358946; bh=w0GRo5owbosOIL5IOwRPzqacdqpxHdKA8CfKDsWGpQQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uxs4ILcjp4N2ppOX8asPwYn830WjQU9Lbf/fB7KjgK5wnPYMoVBac0vGJNnyIz/r1 oIoWqVhtgSfZgo0GiceGIDjeJEx1tG6Rk/GQmIzVVG6Zyit0v5uGPe9Hmqm9oAm35j YFm+QXkwHpqJZXyt+/hgjwni0zmTTvcRkc8r5Pvx5ZJ68IfLlGmH2XLp63fe1X/WSx +0Yrp3gVDK5Uwbdh2FNWN3vG9jVEEvZQs6U5GdA+xhPOfBKtJHT2g6d6xU8ffV8Xc5 dh4qXmHXVxShHTqR8oofalh+t08v0XK8JYbjN9d8eCjGfvCHUvAf+OUyyyKaJ8bhd9 Q9T0BAQmVi1WQ== From: Jeff Layton To: Christian Brauner , Bob Copeland Cc: Al Viro , Jan Kara , linux-karma-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 51/79] omfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:04 -0400 Message-ID: <20230621144735.55953-50-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769324716801580165?= X-GMAIL-MSGID: =?utf-8?q?1769324716801580165?= 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: Bob Copeland --- fs/omfs/dir.c | 4 ++-- fs/omfs/inode.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c index 82cf7e9a665f..9b302b859335 100644 --- a/fs/omfs/dir.c +++ b/fs/omfs/dir.c @@ -143,7 +143,7 @@ static int omfs_add_link(struct dentry *dentry, struct inode *inode) mark_buffer_dirty(bh); brelse(bh); - dir->i_ctime = current_time(dir); + inode_ctime_set_current(dir); /* mark affected inodes dirty to rebuild checksums */ mark_inode_dirty(dir); @@ -399,7 +399,7 @@ static int omfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (err) goto out; - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); mark_inode_dirty(old_inode); out: return err; diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index c4c79e07efc7..d420e5a53de3 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c @@ -51,7 +51,7 @@ struct inode *omfs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); inode->i_mapping->a_ops = &omfs_aops; - 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_op = &omfs_dir_inops; @@ -134,8 +134,8 @@ static int __omfs_write_inode(struct inode *inode, int wait) oi->i_head.h_magic = OMFS_IMAGIC; oi->i_size = cpu_to_be64(inode->i_size); - ctime = inode->i_ctime.tv_sec * 1000LL + - ((inode->i_ctime.tv_nsec + 999)/1000); + ctime = inode_ctime_peek(inode).tv_sec * 1000LL + + ((inode_ctime_peek(inode).tv_nsec + 999)/1000); oi->i_ctime = cpu_to_be64(ctime); omfs_update_checksums(oi); @@ -232,10 +232,10 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino) inode->i_atime.tv_sec = ctime; inode->i_mtime.tv_sec = ctime; - inode->i_ctime.tv_sec = ctime; + inode_ctime_set_sec(inode, ctime); inode->i_atime.tv_nsec = nsecs; inode->i_mtime.tv_nsec = nsecs; - inode->i_ctime.tv_nsec = nsecs; + inode_ctime_set_nsec(inode, nsecs); inode->i_mapping->a_ops = &omfs_aops; From patchwork Wed Jun 21 14:46:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4438865vqr; Wed, 21 Jun 2023 08:14:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6jlcOCtgE/zQ4hGlaorFVQFp1FTl17F4Jpl98QUCYjOzTH6OgYK1IGoOD7XASGafgHQAy8 X-Received: by 2002:a17:902:e5c2:b0:1b6:72af:623d with SMTP id u2-20020a170902e5c200b001b672af623dmr5366673plf.55.1687360474063; Wed, 21 Jun 2023 08:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360474; cv=none; d=google.com; s=arc-20160816; b=Fdp2Qhg1lu8IiquIV/oJPS8bOFxY/jJGC55W/QLKNFZe4VfkiHM/vW/aU/CFOxXXNT B8cbyYY2RF/HR4TsODgZa6+0eQNHHzkKGK4Po9SBB7QFSVbFxQf4FJQnqnK33bXJspL/ zta/kI958bhjMjur9DDChKvDsDE9I7LgtcN+1ptrSI0XGPBr6K0/IMiNWCDrCqHvIMpU UHEUmjeA+DY/Hpt+brB/dIF4PBd2pJmlh+RIslQTQBlLKbSPrbQbDbp4X08GRM8d+XbX kLO2sC0e+xUDj+o0ZC4QvTy4IjJK63HWqYhAgWKKOxRFfStEWu7XmLAtF5pBJUNCfBMm BSDw== 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=B/Fs+8kXSh6zDEwCz2jf3TKFVyuJ8D04wO71Igu+1L0=; b=wnVnxNYmKgl8+DbXPhjxul+YSd5XnBQNIe1XuM3u65MyRVO4sRD5ukldCI8va2BCY3 Snsvy74tUm3SxPpL8HIPKcCpTuATD0e6tvINCeMF11THRLLxLFwAcUbyYGKa2h7QLHjC JZAPRk8Ut1u7RGwwwdvWra9pcPISoHgiYAWSjqSYkD8K246tDyCfKxLeUpXKyYFT3KxM zqIM43FbHu4gI20stIQEoWc4xvo8Ix/jzBXt6/ZoRJuwJw7w8aiaEKuCiCRi/ELeZmYy nfKKJh8nWQzPOkggaH3umWsLnDawyRXM+F1IqjQRfhoNnEZ+sYPLR4T9lQhfm6IujrON panA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bdUKZYYL; 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 y21-20020a1709027c9500b001b3d69d5489si1464199pll.184.2023.06.21.08.14.20; Wed, 21 Jun 2023 08:14:34 -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=bdUKZYYL; 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 S232788AbjFUOxG (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232402AbjFUOv6 (ORCPT ); Wed, 21 Jun 2023 10:51:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10DB42D66 for ; Wed, 21 Jun 2023 07:49:08 -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 E5447615BB for ; Wed, 21 Jun 2023 14:49:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF26BC433C8; Wed, 21 Jun 2023 14:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358947; bh=JQjWRhfzUQZACyGM7HIbqAr9d+i/Io57Za+SRGPmvhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bdUKZYYLvTy45nvYztdff8e4VCJRwe0ffrexOXDSI/yBlBydc35TzkNnWHmjw5Y/9 goZxRzSDEzkVWtknVfxfec/Aj+AM2uZRtFVAjAdhfFi3l6MC85srSB3iAHNs95m3/L 49QZNErjFRDRnCclr1i3sMxkV5OVBXqyjbGJeI7tuFchrrCJQL58vdJl7XNIFAxCMp 2izD9l1u0LjQ2LXJEub3cMDopxpAIEW+hPjkSzGFSJd73gsxei4tzG/JvBsyqyfm8v eME5qHvJOsz0sZQAVec1IErkai6ZKxqxfuw5C+zuqT16qJ0E8s9NZVMyFSJuIw+YjH 0AJ7qyewiqMdA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 52/79] openpromfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:05 -0400 Message-ID: <20230621144735.55953-51-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325695984451290?= X-GMAIL-MSGID: =?utf-8?q?1769325695984451290?= 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 --- fs/openpromfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index f0b7f4d51a17..5d5066078638 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -237,7 +237,7 @@ static struct dentry *openpromfs_lookup(struct inode *dir, struct dentry *dentry if (IS_ERR(inode)) return ERR_CAST(inode); if (inode->i_state & I_NEW) { - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); ent_oi = OP_I(inode); ent_oi->type = ent_type; ent_oi->u = ent_data; @@ -388,7 +388,7 @@ static int openprom_fill_super(struct super_block *s, struct fs_context *fc) } root_inode->i_mtime = root_inode->i_atime = - root_inode->i_ctime = current_time(root_inode); + inode_ctime_set_current(root_inode); root_inode->i_op = &openprom_inode_operations; root_inode->i_fop = &openprom_operations; root_inode->i_mode = S_IFDIR | S_IRUGO | S_IXUGO; From patchwork Wed Jun 21 14:46:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111088 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4433165vqr; Wed, 21 Jun 2023 08:07:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5oSlpK9xY+8TvRwwa1JVpHJPaltpSs6Rc4NOPbvNqB8trWB99rYwl+QNZozyS7Ci56KubV X-Received: by 2002:a17:902:a706:b0:1b3:a949:cfdf with SMTP id w6-20020a170902a70600b001b3a949cfdfmr4885481plq.4.1687360032947; Wed, 21 Jun 2023 08:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360032; cv=none; d=google.com; s=arc-20160816; b=mNykNgMyHjxnIoRuGslZM8tNXS50TX9OL7t2glq5OcD0YALFn9P8kfkMFYi1ZbRn2g NgP2cDzGar9n6S2z80GOO+/5dbBt85FxSaWW4m3+xFYke5M4YcAh46TBQm2ctISVfRmN NXOlqnMPURQ2dONzpmFYxsgg80RFgDC59Dnjp0wdfkZT6/GVricMOLAbnjULvLvT4ONZ yoTWXAAy0Lwd6/FGVU5HWmLO5dbP8hL3CYjNnu4nEKmC4YJcuIMrc9At7qITV8UO8Ata fdqZFlBaMcj0iOej35nBjXwMzuOFOjHxdGiqiBmzPJCNqyXp86Zwr9bS9Fkicx4MC2Kp uk5A== 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=rGfVq111FvX0bHXQnUvaAXTVhCqNTOApwa5RoyyRBuE=; b=kCWqhBYXVLMUXWFAonjE6DyvyK0hIjFlZM/xNAU/jHtZigVz6W2sIhfAaPYI0z/aZD 9CF4Mn5/YxbCD9/9g+4yjjanBfLuQ40wj0mqNtFFA+0qI/zNbfXY6w1B6UAQICwQ/pv4 I3KI01Etb/N6BSXYUT8sEaZs0pEjjqr4mEDYTciLwRbAFlBofp2bWteewuhkEasW+ch3 k/i9KG6Z+cp7vMKQMeXFGixWypDN4YnQ+XjtZ8XioEPvmQ4oPxJoRl4v1HwOA/LNAUKc SF2lfEgUCaOn1S0DH8cs8LppBqAJbNyj7lc1MdoHxZEewrB/gFe+2Coody105zGhNzAl hbkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="M2Kiy/TW"; 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 e4-20020a170902ef4400b001b66bacd96bsi1846991plx.58.2023.06.21.08.06.56; Wed, 21 Jun 2023 08:07:12 -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="M2Kiy/TW"; 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 S232412AbjFUOxK (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232834AbjFUOwJ (ORCPT ); Wed, 21 Jun 2023 10:52:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D6882D78 for ; Wed, 21 Jun 2023 07:49:09 -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 7DFB66159B for ; Wed, 21 Jun 2023 14:49:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C2CBC433C8; Wed, 21 Jun 2023 14:49:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358948; bh=TT+04QQZnz99pJf+AzV0cI1/YUAXPqB9Pvl9TXy66DM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M2Kiy/TWHPTWtVMq2IQKiNJpOFmMpEOkwMq6gjMdSpL/oBcqJMdghcj8XxI6ZtOap JV+svVArl//qprrnuYBiEC1FDGwGEY9LisET3pamty5lBdtY6b+/lNO72u1fefvTJ/ ydCYxiIhPK09JUDMErq7IgUVAVDKfgGzuPZdD4dL9hoi5p+JMGCXJRJFFT7j6OAr26 qMNCsMXefF56TkSPNkDXPXKF8rII+TfhuUSa9HH1L+0vx36k7nXrA1Nv+/VjVylQCX bg6fx60/SKkrRFj9qLKlZvFvvPw8bbJ85fko/U18hI2VDYAbatT/ff1v7Jp/02cDqO pqWN7agHhleZQ== From: Jeff Layton To: Christian Brauner , Mike Marshall , Martin Brandenburg Cc: Al Viro , Jan Kara , devel@lists.orangefs.org, linux-kernel@vger.kernel.org Subject: [PATCH 53/79] orangefs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:06 -0400 Message-ID: <20230621144735.55953-52-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325233757251629?= X-GMAIL-MSGID: =?utf-8?q?1769325233757251629?= 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 --- fs/orangefs/namei.c | 2 +- fs/orangefs/orangefs-utils.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c index 77518e248cf7..14085537ba1c 100644 --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -421,7 +421,7 @@ static int orangefs_rename(struct mnt_idmap *idmap, ret); if (new_dentry->d_inode) - new_dentry->d_inode->i_ctime = current_time(new_dentry->d_inode); + inode_ctime_set_current(new_dentry->d_inode); op_release(new_op); return ret; diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index 46b7dcff18ac..4d12efb2ee85 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -361,11 +361,11 @@ int orangefs_inode_getattr(struct inode *inode, int flags) downcall.resp.getattr.attributes.atime; inode->i_mtime.tv_sec = (time64_t)new_op-> downcall.resp.getattr.attributes.mtime; - inode->i_ctime.tv_sec = (time64_t)new_op-> - downcall.resp.getattr.attributes.ctime; + inode_ctime_set_sec(inode, + (time64_t)new_op->downcall.resp.getattr.attributes.ctime); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); /* special case: mark the root inode as sticky */ inode->i_mode = type | (is_root_handle(inode) ? S_ISVTX : 0) | From patchwork Wed Jun 21 14:46:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111098 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4437809vqr; Wed, 21 Jun 2023 08:13:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48/uCnEgQJo5UeQAOXsUhWfL7SLCXwPCKLJPoNg7FP0iXo52/VXrsER38MvAApvFzfakF7 X-Received: by 2002:a05:6a00:244a:b0:666:8cbb:6e02 with SMTP id d10-20020a056a00244a00b006668cbb6e02mr19594185pfj.8.1687360382634; Wed, 21 Jun 2023 08:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360382; cv=none; d=google.com; s=arc-20160816; b=FbMWNj4FzXVrqTqe/qce6Ubzr36PWpNDm5//EWwNWT1lBDmjiX09CA12P22nhOY37x f/gMTrxWTnq1WtTTEEsZ5cKU5MKDi+O1XhyDDKkteoycZHEQoYyeKjgE9LmlWf8uUY1+ vWzqu01xE03GVYGfxpUXiGzzf4QvfSxkI414omH5n9ES3qKqaGz+/hEGXq39bFLc2l4e zLxQvBGkPqE2rdecoFLW+a/HFGZxf+Nt5/D2G9IcO7ZLzLi1zvi7uiDhusbR5j4RVime JErH512SX/1gkV+INDXujpU/PArE/OZZLezDnN/YZoAnTVyoIgimC/orgvpMBnYt5F9b t3Ew== 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=IzN+4TrwDQE/s98IkGnF/yqzbOkikh04UZOGbZuqFzo=; b=rIvmMBY2Def7vhYImxqEYd7Swkm7KbcoFV7YqeqlFIeQPQbGtLvEhmVLv7+o7TY7y9 q2GABlEbKtBkV0F8Si+QyOcQtNal2eW+styFqlsnEMILYu5bq8dqJf/X+PEjqtYNB+Sw XqPzSTJfKqwA7hiU3gZF5+BoIvUSy5+Ri12X6d7GhmiUDp6SwVyQkwrGoEs7O3JVL7Ey Mi3kOkgKFVe9HAN22NeSN46HES2YIfUmkb2aKQNlVo6jRv0kEaSJcWUqvXFk/Ahw19Kp mCoDLVeVjRmUzkTFyriTyx4Q+7TNDdlF9QshKg49gFbXhfQd27Cspmzgr0u4ELjXOV1g yDmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IIOagbf4; 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 u2-20020a637902000000b0055387ef9633si1128029pgc.804.2023.06.21.08.12.49; Wed, 21 Jun 2023 08:13:02 -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=IIOagbf4; 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 S232624AbjFUOxM (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232592AbjFUOwL (ORCPT ); Wed, 21 Jun 2023 10:52:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35EAE2D7C; Wed, 21 Jun 2023 07:49:11 -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 1287B61596; Wed, 21 Jun 2023 14:49:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE600C433C0; Wed, 21 Jun 2023 14:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358950; bh=YWuokfMJ+4rhgsv839ofdmeql5mHi2OINpoubcGpHfQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IIOagbf41K//lPF2/RO6T6Q5+Xe/GO1RvWVI/XL+oj89Hlvg040jUCa3I74FwjDJT CJLs5m8r2RvvSFTtMUXujc6DP3fJkU9mQ7h5goH8M+BpBiUO0KBj6G6F0NG5Flio54 jjHv5hY+vES2eZOQPHMcVCpyy8tU035oESGmxyI0xwUfCrP+TicwbpVV8HKL+jHoBG j1u7oE1BpXsHkcZZApRcJ5CuI/3mVRjeXtsvEH7WoOgyjQWDPRtGX/1WOAY6YS1UlI yc8Sb5evqBTN6lIFkgLp3qLOwJpI+Z05vtg61orV6upUy76HSwv3v52zltYxzTIN/S V4ReCo+RuQdNA== From: Jeff Layton To: Christian Brauner , Miklos Szeredi Cc: Al Viro , Jan Kara , linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 54/79] overlayfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:07 -0400 Message-ID: <20230621144735.55953-53-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325600443901278?= X-GMAIL-MSGID: =?utf-8?q?1769325600443901278?= 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 Reviewed-by: Amir Goldstein --- fs/overlayfs/file.c | 7 +++++-- fs/overlayfs/util.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 21245b00722a..b47013d4bd4e 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -239,6 +239,7 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence) static void ovl_file_accessed(struct file *file) { struct inode *inode, *upperinode; + struct timespec64 ct, uct; if (file->f_flags & O_NOATIME) return; @@ -249,10 +250,12 @@ static void ovl_file_accessed(struct file *file) if (!upperinode) return; + ct = inode_ctime_peek(inode); + uct = inode_ctime_peek(upperinode); if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) || - !timespec64_equal(&inode->i_ctime, &upperinode->i_ctime))) { + !timespec64_equal(&ct, &uct))) { inode->i_mtime = upperinode->i_mtime; - inode->i_ctime = upperinode->i_ctime; + inode_ctime_set(inode, uct); } touch_atime(&file->f_path); diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 7ef9e13c404a..e3746f9a202f 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -1202,6 +1202,6 @@ void ovl_copyattr(struct inode *inode) inode->i_mode = realinode->i_mode; inode->i_atime = realinode->i_atime; inode->i_mtime = realinode->i_mtime; - inode->i_ctime = realinode->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(realinode)); i_size_write(inode, i_size_read(realinode)); } From patchwork Wed Jun 21 14:46:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111131 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4461708vqr; Wed, 21 Jun 2023 08:48:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FQUhlvZInaPCzK9n0mQhrVogtim50k7KTyXxnBUG9ZWtmnqBzRoWSHh+QXCp/ARdWHbV0 X-Received: by 2002:a05:6a00:1493:b0:668:9b2d:b534 with SMTP id v19-20020a056a00149300b006689b2db534mr8236250pfu.1.1687362523387; Wed, 21 Jun 2023 08:48:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687362523; cv=none; d=google.com; s=arc-20160816; b=hrIBFJtbBVgoBpiFPvCib+htStINAWKo8vvRzljcjfvzCYNKTM/2XJvt+23lo55dQ0 xSPF45TnwW8PhRh3JWI47fGjmfNPtjoMudjtK0ynZ0joHdoklXRInsAjxs8bzzj7Yhft h8cpVfitviyESiUE8B2k/uCpEXKCfk7+VdZyN7GeRuD6EsB74592efEBFczxfbtt2EPw /c5jcYamU+woUgf/QGPe17r6fFCOE1a8eRu7A7B2Av2Mid1t5tWUX+JJzSAA7lE10+97 DlXwhhIQ6hEIQvjGsRjUR73h0M293+csjTe7aUVdpbU1LSQvLeiRUhtruVWHD6oX7Lwf rHdA== 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=4ICYar483VpAW29FlEPj983E2KDlgggtaMdI3lrFYLE=; b=UGleN/Z8qVFYUmA07gKT0Wh/jGFNj7VJVnI1y21SofpKrZtAIVgA2I9ksp27pgRxWE 9vhxME7k1uzf9PD5CvYrNoqxvj0D1rl5Hb1TmHX6MKlqpc1w56g7UOaHu2cVn9H/7xuP 0JAPhMk1+Lpywor9aVrJA4B90iZ6OiLNRk+7F0RuSBnouj5iXKvD2eL6fpAWBNFozhvD L9ZSOdSsdM/jr5ymUZQ4Rt1VGx1WXU65H0X+sts+KCIb7dLz/y+M+Pn6FvWYPjk05sza fugJBqhqOM8Xv1+Xp5CC5/mP5uP/aw49cBxCrAjO7gBjzgtbw4wVLDc/7P41AJ+aziSx nAig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RT8HOh2a; 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 d12-20020aa797ac000000b0066871b54e15si4261354pfq.359.2023.06.21.08.48.29; Wed, 21 Jun 2023 08:48:43 -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=RT8HOh2a; 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 S233064AbjFUO4b (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232785AbjFUOyp (ORCPT ); Wed, 21 Jun 2023 10:54:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F093435A6; Wed, 21 Jun 2023 07:50:20 -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 2D3F8615A6; Wed, 21 Jun 2023 14:49:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8695C433C9; Wed, 21 Jun 2023 14:49:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358952; bh=1rG9x7ERKlXPL28fdmfGNObNC3MxW/4isCj9mvzuWg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RT8HOh2ac+RrlE5gqK4Rn6tQ61Z4LxN7negTXG9UJpCXXm44qb5mZouTQhdP4AjWX eLdGf6xXRIgGvKQKKvTmaVMaEUpsdDJHx+mKlHr8fidNcZ23duMQiALp+rYRUInxyV ttop9om2eqSR6JlxvxzJ4BTigVr8xEQcd/OQHtEdAiAq9n1zD4hdTLaLHGtqebKosD uPjz4hsfISSRoF8SkNBaf4mvY98OSNy886txs75Foo9c305QWT73m3iqev/EpgMV2Q gEEce0+WNhKrdDw9ji3Txx1gYqaXL+82uCWLh0MFoRwxMjeAsqvjFsbD2fYdMrptTr qwFg6uNQ7vT7g== From: Jeff Layton To: Christian Brauner , Luis Chamberlain , Kees Cook , Iurii Zaikin Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 55/79] proc: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:08 -0400 Message-ID: <20230621144735.55953-54-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 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?1769327845327525779?= X-GMAIL-MSGID: =?utf-8?q?1769327845327525779?= 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: Luis Chamberlain --- fs/proc/base.c | 2 +- fs/proc/inode.c | 2 +- fs/proc/proc_sysctl.c | 2 +- fs/proc/self.c | 2 +- fs/proc/thread_self.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 05452c3b9872..354f7f9ad05b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1902,7 +1902,7 @@ struct inode *proc_pid_make_inode(struct super_block *sb, ei = PROC_I(inode); inode->i_mode = mode; inode->i_ino = get_next_ino(); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_op = &proc_def_inode_operations; /* diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 67b09a1d9433..61f4fc0a6261 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -660,7 +660,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) inode->i_private = de->data; inode->i_ino = de->low_ino; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); PROC_I(inode)->pde = de; if (is_empty_pde(de)) { make_empty_dir_inode(inode); diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 4e5488975415..abb7e524b28b 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -463,7 +463,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, head->count++; spin_unlock(&sysctl_lock); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_mode = table->mode; if (!S_ISDIR(table->mode)) { inode->i_mode |= S_IFREG; diff --git a/fs/proc/self.c b/fs/proc/self.c index 72cd69bcaf4a..bb5dbdd30627 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c @@ -46,7 +46,7 @@ int proc_setup_self(struct super_block *s) struct inode *inode = new_inode(s); if (inode) { inode->i_ino = self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index a553273fbd41..373680bd0635 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c @@ -46,7 +46,7 @@ int proc_setup_thread_self(struct super_block *s) struct inode *inode = new_inode(s); if (inode) { inode->i_ino = thread_self_inum; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; From patchwork Wed Jun 21 14:46:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111137 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4467825vqr; Wed, 21 Jun 2023 08:59:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4nG0ce0qaT9JXntYdEAPFYY2S+iONtMKH7KVz3qXE5l50v+s0/ks2Es8uemWQwehBqwqx+ X-Received: by 2002:a05:6a20:158a:b0:10c:467a:536f with SMTP id h10-20020a056a20158a00b0010c467a536fmr20701055pzj.14.1687363152618; Wed, 21 Jun 2023 08:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363152; cv=none; d=google.com; s=arc-20160816; b=y9tclnGdyfPNa8tj5zewYiknIfIUGpGVoJ+1f5LsR4N3+oRDDSFdVr3gUJoLh7fkCz IbxIKPiwTTXjwZOYk4SAmJmLNGZrBGY+CI+KDh1n/TFAsjz/oIHWIsJ5wsOT/AYQEVUm glmwJk0RPaYKUVTevSqSeIjkYqZ0tUziASPVHdby54om4JMo/K9E8EWP2cmC6Sh1rjKm qFQK9exRLisCFI/iY083zWriUTckDs2kFLykBWxjfD9UTfcLlJZpe6Mm+k75BRnfsxQf l9e0jOgNLP07cBpuAvU8IFjfsv17HLAHwh4iNSJrm5pd+1c2z2dEm7WFlPhwhkC25vya svFw== 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=8rC99QzeU2IcO9I5IK6DzNpCP8uRjL6uSXhzK74rBF4=; b=ihbPpI1rHkvvIM96bF4qnvNX6Gl2E7MBqi+B7sIsEVKd+6bf65mwsObn6rsp9TR4tS uvGtpJ26YW/iZpL2/dsMlIwMNgWIs2F8Ztc6yYfldAeaIPPL0CRDxXrn6ZHc32OkPu8K 1OCBk2aPS87HGO6haqqn/2pFw3rwIW/4i61en7ldKMZv9hgG/bfAJEZJwkRYhf8G67zR j50t1g2tSXfHnQy1DGPUIOudqF/SDut+6umaQ6f8kknT34dRK4PI+zaadgWRODHbepl+ Gp6vqTdGx+11GNUx7sp3Ky4WRRsef/fwBdFWqSWcE+hM7m/T+/mYYRrhWUB06tGoW28o Ymeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=owSMvesL; 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 p2-20020aa79e82000000b00668873710d9si4417281pfq.162.2023.06.21.08.58.57; Wed, 21 Jun 2023 08:59:12 -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=owSMvesL; 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 S233071AbjFUO4f (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233105AbjFUOy5 (ORCPT ); Wed, 21 Jun 2023 10:54:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 909F535BD; Wed, 21 Jun 2023 07:50:27 -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 9FC076157B; Wed, 21 Jun 2023 14:49:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DFA8C433C8; Wed, 21 Jun 2023 14:49:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358954; bh=Vg/q4ub2LEKrZ4zBjRc7OAhNi+XpqXacU3lh8zGDHJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=owSMvesLWC51zX/w3HurcDsigUZBkUjBx89d/v/tKRNiBBfM/VPhtcpo9dR8B3ZMc PDe+zG2re5PUV2UEoOrM44yZHSL3P+gwidySNM86UXsHOIUSf0Qky5oJOnhwT+qYA1 VHjBdUj8aQhn7E2OJZeHktqkQXMulITgMesuwodMynt+FeodeotnCrKXtehojXdeP7 Rt5fDUl3pvcPlLE3os7F2iynv0K5izO/6hmJUsAU9Ve36RmcIDosxIvUwnFlexo8aD jsOHq3F8CCbhDrNkVWbhpXiTw0SnWBypegWbqxSnOuDF1wlYqhYk6Oc8oJmKfY5I3P dUULt9UrCqVDg== From: Jeff Layton To: Christian Brauner , Kees Cook , Tony Luck , "Guilherme G. Piccoli" Cc: Al Viro , Jan Kara , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 56/79] pstore: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:09 -0400 Message-ID: <20230621144735.55953-55-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 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?1769328504955821208?= X-GMAIL-MSGID: =?utf-8?q?1769328504955821208?= 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: Kees Cook --- fs/pstore/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index ffbadb8b3032..20624d6006e6 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c @@ -223,7 +223,7 @@ static struct inode *pstore_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); } return inode; } @@ -390,7 +390,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) inode->i_private = private; if (record->time.tv_sec) - inode->i_mtime = inode->i_ctime = record->time; + inode->i_mtime = inode_ctime_set(inode, record->time); d_add(dentry, inode); From patchwork Wed Jun 21 14:46:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111129 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4458618vqr; Wed, 21 Jun 2023 08:43:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6R5SqX8EUeIb8oEW0INGRqJULvveRnxmiTFieYkKz+CDHP5CwWsunsb7ZgMawRSLBHSgZ7 X-Received: by 2002:a05:6a20:3c8e:b0:120:abf9:4f0a with SMTP id b14-20020a056a203c8e00b00120abf94f0amr15980815pzj.15.1687362237753; Wed, 21 Jun 2023 08:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687362237; cv=none; d=google.com; s=arc-20160816; b=rAiA4xgpl8b+3Zm7sp2F/eqipPe5ioukkDnJoU2rbc5wIxtR3lEaV0L+f6oP3o+/VF xsX95ECGktcd15JcMr4kjkZPK4viKEwXb5KWEvJuQcSCk3truiwAHNAyj1LHjbXyCuSa svfEouMdEM/CA9gRg+SvABJrUMoc14tDz6TyvbwqmFO7BPYObDs54Cm8V8h4CTT2xSM6 E49ETG08Pfw51LSpkH+/jlKtaUGh7NKgounPuGxOTi3ue6nVXQvXsXsQajnQUaOy71Zr d3+0oslDUlrTJCw6433U3QQJMtCEUq99tFxLOc/KqHuRTkVURkjq7zoo5AStv7Nf9dZR Ms6Q== 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=9XMdacXuFdrwWNWaEiUGMj3YwXkqM34JeMiM371gp7g=; b=nO6Kr1nrM+dIkaC+AMtNQ0BjQ42a/AAqL6WOcLRLi0bZRSSVNpHWy4+mpxCQyl+lmP c8qZkLCiPbLvMgyNreCqG8xawZ1/dsA5l8/4zdG8N4OaWhV2GwJChtVAq/qyG+RZ4RJG vHLFq7Wvsq+TMjQsLXfJlMW219A+yLzIu4tSpXU9zEJVtS/nmJUwsCScGDQmOfuR+zI3 b7r61gYy46cirtnCVz/nA6OJJgoCgmQK13I5umd40TLYoIfyjmwnQ1ZYP3TIz2idXcGr mOJsz3rv2f0KpGHPF4ulPSJ+7+C07HQZFviT2fIE5xeSBXja02AeKf84omfCKaCgaapC Y6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WoUD345L; 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 l73-20020a633e4c000000b0055391572218si183132pga.26.2023.06.21.08.43.42; Wed, 21 Jun 2023 08:43:57 -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=WoUD345L; 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 S233049AbjFUO43 (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233058AbjFUOyk (ORCPT ); Wed, 21 Jun 2023 10:54:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91A7D35A4 for ; Wed, 21 Jun 2023 07:50:19 -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 D80AB6157D for ; Wed, 21 Jun 2023 14:49:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1CB9C433C0; Wed, 21 Jun 2023 14:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358955; bh=f1rttWyEovUo0PnSxIfPqjg/fvLapokvDJ8MLoxkPYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WoUD345LPEF4hodSkjDYo5jbDC614zugtoeX1ouA1gScMBog1mZZYzmATLhoTkySU LFuPoSmt+olr3KHqx8+VmRJFW/KeJPLkuxYI+lPde4RamxgyZa9XxPETK+DGxumHFO KIwkMqbgaJC8LAAQ+ZbiB9ppRUDv8cCEdqIScHWCOZP3d8eBMuKKN9V2XLvH+iUySx A1gejL3krjz8/+bD/6xXL6saZhNjKHvd4qAMpeYWSCkyn1fUj3B+Ft+ohp071f8PCQ pPQHqK4yuEyzI9l5GBMhtSq5KLVffyNyX68NbI2pDLjbQLuDCCntxY+oB9xDpD5PKB GJwP1DSIe0M6A== From: Jeff Layton To: Christian Brauner , Anders Larsen Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 57/79] qnx4: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:10 -0400 Message-ID: <20230621144735.55953-56-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769327545839636090?= X-GMAIL-MSGID: =?utf-8?q?1769327545839636090?= 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: Anders Larsen --- fs/qnx4/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 391ea402920d..3fde90b3f99b 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -305,8 +305,8 @@ struct inode *qnx4_iget(struct super_block *sb, unsigned long ino) inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_sec = le32_to_cpu(raw_inode->di_atime); inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_sec = le32_to_cpu(raw_inode->di_ctime); - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, le32_to_cpu(raw_inode->di_ctime)); + inode_ctime_set_nsec(inode, 0); inode->i_blocks = le32_to_cpu(raw_inode->di_first_xtnt.xtnt_size); memcpy(qnx4_inode, raw_inode, QNX4_DIR_ENTRY_SIZE); From patchwork Wed Jun 21 14:46:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111118 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4444671vqr; Wed, 21 Jun 2023 08:22:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4EqjJw7iHOfEm0QAxzL3Oq0qWoPcr6ttzgTR+Wjx8HwdB6cI6bs4Eu7tMmJ2UWgy1rl0eG X-Received: by 2002:a05:6a00:1507:b0:66a:2771:6c4d with SMTP id q7-20020a056a00150700b0066a27716c4dmr4189817pfu.4.1687360960508; Wed, 21 Jun 2023 08:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360960; cv=none; d=google.com; s=arc-20160816; b=07vTC/zks/nx/3SZunHGx8eS3XN5IlHNqORzt6HZZ5cGSSdhoaR+MUL12Z6u5SBSPL ZBiP6n4pKSAWklu/HyMSaAR8/XT0UkTXVfMYh64Cg9nMjnCi5XbaONaHPNS0JS6kEfbC /VTLHE/5rDrYgKku8Zo2fHsSF3bgHVoG7J9C952bOJi5h7iKCR5k1oyr4iTs2Ex5Nofh 7nhs661HW8y4PBBGxYlRsjMcl4aHC0VYEj0HDyYRP75oZaHPj/GlLGz/tqfG+78SxME0 4nBvDPa8ooSowNNQbUDArAd4+NkLF6Jlkp5hO6T3/j+96hehPSPH/h/+F9QnBAwEHXDB e+eA== 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=CywxzfmzCL5mBpoqBrtjOH7CsmZ13WIcbCLneO9QqmU=; b=osd7XWPwXZ+HJ7xa2/lVMQJmb/akgpP3dHNLc8gd/sAQWaNSWcEQaNh5UwfNo+OM37 R/hs4sBMuOWs+jOJBbCNc7m3UrZvpaRePJIIxx1dqK8qR+DzRoH1wRv9MRiDvrkqgQ/3 3f0ySb+kzXjHcLRwWhiKA1rsLPtxQDeUCI0HWqyfz/cyWsm3PPVr8SyxJRfqCfUCfkmB VV7VX9bl58HaN3o9fdUYjbzqbDcHrpg6wAGLxyD3E7sxiv4Eeyp2kAV+4gUotPsZ6Aj2 YkXol3DsW8C8aCLZCsE/vy+T+WZZHcOZ6uSuZn8+nxSDhJEJjALBvAiiEZ2sFaYBubad a+MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MJU3kKp2; 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 a24-20020a637f18000000b0054b57b5e049si4151644pgd.28.2023.06.21.08.22.27; Wed, 21 Jun 2023 08:22:40 -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=MJU3kKp2; 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 S233010AbjFUOx6 (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232938AbjFUOxG (ORCPT ); Wed, 21 Jun 2023 10:53:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EC1830E5 for ; Wed, 21 Jun 2023 07:49:36 -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 154CD6159C for ; Wed, 21 Jun 2023 14:49:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B53EC433C8; Wed, 21 Jun 2023 14:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358956; bh=q0RNJR11+YxsF2T3Uf94Nm8LmJtlc14VfDKVIjwrbxI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MJU3kKp2cCLJCijVGQWsIBH/mtgTrWrjyx6bwxp0If06rbf4YWU5zndMYVllGNrAt GxMkIz90NeZxUTQyv1W9pFQjDRm5DkX93/jR5ImoUOVzup8fgH8w59dRHMAGjbnRjX VqU9gKjhaloS+k1VW3pLXDV+EgYSgBOZZWJ593P8uTxHXOVD+ivizNxbOV8aNj06ze z7mW2mmc7CFY566MhpqwA1HuGaXLrrnB30Se2GcGwOX52hC0y9CrxPU28fFmfccyTA XVEYlcG0GiQWlGzRa7KNcL0ZMXDAYUY6+8Frc0ALYzrmyaCZjaVaUFqNAr85VIzkfk Gg9sYPgTI/3Bw== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 58/79] qnx6: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:11 -0400 Message-ID: <20230621144735.55953-57-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326206470600496?= X-GMAIL-MSGID: =?utf-8?q?1769326206470600496?= 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 --- fs/qnx6/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index 85b2fa3b211c..ff86c7100aaa 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -562,8 +562,8 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino) inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_atime); inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_ctime); - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, fs32_to_cpu(sbi, raw_inode->di_ctime)); + inode_ctime_set_nsec(inode, 0); /* calc blocks based on 512 byte blocksize */ inode->i_blocks = (inode->i_size + 511) >> 9; From patchwork Wed Jun 21 14:46:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111130 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4458834vqr; Wed, 21 Jun 2023 08:44:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4NsmqPu3en5pn6J/JQMYd1XRl39t/f5k+y+CuB7+wGYJoTYj3jzt9GHphR/N/28wgntSD6 X-Received: by 2002:a05:6870:713:b0:1ad:1500:811a with SMTP id ea19-20020a056870071300b001ad1500811amr1752082oab.23.1687362256810; Wed, 21 Jun 2023 08:44:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687362256; cv=none; d=google.com; s=arc-20160816; b=K8GMJzr/5ewct3awx16M53L9TZmy5SbMDHE/eWl0EUrXI9WNa1BZ1KwTA3CXP9a6HB Hmg5wYXFLsqg7QTG3wLLPneCFr44bATV5G0wGNllYniUJ24r9vBWKLFQP4gkCeAUZrfE /ioWLmLpvPIUXu1LRoGmd470/sE0kFuF2LO2ZxOpH9HcTfKXY9fFgRMjCHFCEGcXLrOw 8fAz6uN52EXpJ0dMVWDtCMsy/vOReP0TCzUdYYLCzBF1v0N/6LDcKoANUA6xMNvukvgW 5NdWHrUCedTZPuBr/gf8HHoeBWX9AzCb9ha9otcJPBhU8OUKTUiymcg1y9DQ441ZtlwW +LDg== 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=d844ooOzOZP6m33Oi9J5xBTJnggKbtRO//pdjCdp9kw=; b=Y+ZLbTrTvTThrH8NkmkwYU3J9tDtaLvUfekPXR1OW5Jp6mcrFh3UnCf2XUAIjmDP/B mI8KDxqqS1xZrrRp9fa8ZIQFPxjJ5Gd2LKhZbd/xuKz1+os4liiXA13A5uslrCY064R8 1jOxb/6l6D/yTZOszdK8qhbliRuZtlgjcOTRNvdf9+ikiq2zSDKpF3imqjKSfPTORVlb hk+BMmFjJJLqC/LtlPhDp5qB364IhULQrsMCA46OdhjDrfiIqbgoAtovRYUP1zrI3JTf NrNsluDSSnhs2IftM75P0bj62Wi5J/ON7lacQQvArRgMvBSCdXN7xwfe+G98L9/CswIF HTdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kUMowuMG; 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 e124-20020a636982000000b0053ef95fa919si4327680pgc.458.2023.06.21.08.44.04; Wed, 21 Jun 2023 08:44:16 -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=kUMowuMG; 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 S233023AbjFUOyH (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232836AbjFUOxH (ORCPT ); Wed, 21 Jun 2023 10:53:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCD3930E7 for ; Wed, 21 Jun 2023 07:49:36 -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 3E612615AB for ; Wed, 21 Jun 2023 14:49:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34408C433CA; Wed, 21 Jun 2023 14:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358957; bh=9cf+rH9kIsp3ZdLPeIcUhtZoPqtWvR8jGtbLUaFhpUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kUMowuMGo8c8jIEEdOPRab7yvrLW1WXFIFcuUwWIO7pQME8C9y3GZxSyoj9yiPgsD lDfPUhzrXC5W1WkyeWeLiGdlWDjj1fhCqomgki1LceK/z9uYIwrckvnLlWxeDjZZAY 8makJ9OibkYRct2oU2fhg2Vnxk2ClaVK/kS416g3wg+HjRhQbJwGolzJ+9iA2sNOUG 8HeI2Syhp/xyo9vhFzR9sHsyLII6Xxib49dvdrdzobDzsl9Pc5/VdYEqNhUaeRywMT DXUx9tYxc6kzsbrVbrvi7x6o+ULo7oz2Fnf4ZQSNW+RkJO5u1HuzTMnA9H6FEg3TJc cN7K3re9zC2Zg== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 59/79] ramfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:12 -0400 Message-ID: <20230621144735.55953-58-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769327565772833796?= X-GMAIL-MSGID: =?utf-8?q?1769327565772833796?= 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 --- fs/ramfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index fef477c78107..87f59dc5f6f2 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -65,7 +65,7 @@ struct inode *ramfs_get_inode(struct super_block *sb, inode->i_mapping->a_ops = &ram_aops; mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); mapping_set_unevictable(inode->i_mapping); - 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) { default: init_special_inode(inode, mode, dev); @@ -105,7 +105,7 @@ ramfs_mknod(struct mnt_idmap *idmap, struct inode *dir, d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ error = 0; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); } return error; } @@ -138,7 +138,7 @@ static int ramfs_symlink(struct mnt_idmap *idmap, struct inode *dir, if (!error) { d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); } else iput(inode); } From patchwork Wed Jun 21 14:46:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4437137vqr; Wed, 21 Jun 2023 08:12:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TfhjX0rkXjuOk8yk9DBdxk87bTiNlxBKJemHnUjX9KGKwMBWzag4iKyKARCNTFb5ddUVF X-Received: by 2002:a05:6a21:338b:b0:121:8d14:4963 with SMTP id yy11-20020a056a21338b00b001218d144963mr11373191pzb.7.1687360321808; Wed, 21 Jun 2023 08:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360321; cv=none; d=google.com; s=arc-20160816; b=Am13wUJY7RJSzSMzk4KvpFo2rziTodE/+H1I0HNOV0JJsmsqLVTJfUO8jJ5uyf6XzA 6tWIEUUC5s5E9FRzhVZiddhLTt9g/C8WLugjSbW+6tBGVT1DdMw6iIJc7wVYPAtNLx09 ImNq70RhV74KJAB1ilrvF6vYInLJQXfvwIoAxisFE26NrQRfzjf7JyFxkr83z1s8iAea RXP15ZZRCv/IgvLi6WAYnVZh5MTuV9nACiYgyqCp8GGmBMAMIs/hr9PgrGTHCU7/KZ1j q8CzZL0BjrG15TwX9/FBmechpMG89gotA9awnef1tNrANZNV2vum6Rh3XCfYghjLcqId egBw== 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=MET8MfIqwCDDHjF9zbsfL5r5GbeVEgyGWYFaYEkODb4=; b=S5JmoPFMkNeWYerSUBL954q2lQgPHrBlyHxydz34gnJOXDOwPU2N+vP9Sc+1+JCE85 WUybbaFDk7R1RNwuIgfnmEa9YiJsychW5muufwq+a6Ds2UGxu6KHFaMdVQUrURQNixOr J21QhLEMXtXnCIYgEL7r2w0C7HLcXTXpYQ0MtKwSHdMzJ68JCk9Kjtg0DNGRo4QJiV8g Hn8y4YJFTEom3HT5ZB/LE+ApuYfO0fV4n2jApZbP6ODF60JmZniXiF57HR37ek4hcq8a 0wRctbEmjfrjlrhID+pSC+/BeC0AL2O8mnzwCxwtFtfzVYoUXvSGX78fOaenssojgOkk bEeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KRzNvvlX; 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 w6-20020aa79a06000000b00666eb3ab9e3si4315454pfj.387.2023.06.21.08.11.46; Wed, 21 Jun 2023 08:12:01 -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=KRzNvvlX; 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 S232983AbjFUOxe (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232001AbjFUOwv (ORCPT ); Wed, 21 Jun 2023 10:52:51 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC09E10EC; Wed, 21 Jun 2023 07:49:20 -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 8DC6D6158D; Wed, 21 Jun 2023 14:49:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73F5FC433C8; Wed, 21 Jun 2023 14:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358960; bh=WcJHdoVjXFAYNwmKvs+DtsQu+/wxVUJsdB/1zy7Ed4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KRzNvvlXaerWowU1n1skElsx8cjUkEYuXSsrGgjXayI4k1mLDSXLJJ6MITMS3TWHt a/EOsAOCW34HPosJgOJ3rT1dJn63iAt4314F4S6jESdj34JtsUZDt3Et+a80gXHjWB CTT/eeHHNNWcKX175fAxu9tPQz1ei84JxHvy7XBDqI6d58w2F4SLhFRbI2PHqdMyZc XtX0hDRdB0iHfziF9OoN0WwaHDAtzEMmj8l85caTxbFIU2YKMi3+z8ZYzNS+dHZpXB y42zayIXq60Mka7yfTPinES5ysNBXORIiiopB9xyxUOw48S8XvDpGlsfUEdEYXDGCZ McRbEaIUnAIQg== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 60/79] reiserfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:13 -0400 Message-ID: <20230621144735.55953-59-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325536959197387?= X-GMAIL-MSGID: =?utf-8?q?1769325536959197387?= 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 --- fs/reiserfs/inode.c | 14 +++++++------- fs/reiserfs/ioctl.c | 4 ++-- fs/reiserfs/namei.c | 21 ++++++++++----------- fs/reiserfs/stree.c | 4 ++-- fs/reiserfs/super.c | 2 +- fs/reiserfs/xattr.c | 5 +++-- fs/reiserfs/xattr_acl.c | 2 +- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 77bd3b27059f..3d4e18af8dac 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1259,9 +1259,9 @@ static void init_inode(struct inode *inode, struct treepath *path) inode->i_size = sd_v1_size(sd); inode->i_atime.tv_sec = sd_v1_atime(sd); inode->i_mtime.tv_sec = sd_v1_mtime(sd); - inode->i_ctime.tv_sec = sd_v1_ctime(sd); + inode_ctime_set_sec(inode, sd_v1_ctime(sd)); inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); inode->i_mtime.tv_nsec = 0; inode->i_blocks = sd_v1_blocks(sd); @@ -1314,8 +1314,8 @@ static void init_inode(struct inode *inode, struct treepath *path) i_gid_write(inode, sd_v2_gid(sd)); inode->i_mtime.tv_sec = sd_v2_mtime(sd); inode->i_atime.tv_sec = sd_v2_atime(sd); - inode->i_ctime.tv_sec = sd_v2_ctime(sd); - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, sd_v2_ctime(sd)); + inode_ctime_set_nsec(inode, 0); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; inode->i_blocks = sd_v2_blocks(sd); @@ -1374,7 +1374,7 @@ static void inode2sd(void *sd, struct inode *inode, loff_t size) set_sd_v2_gid(sd_v2, i_gid_read(inode)); set_sd_v2_mtime(sd_v2, inode->i_mtime.tv_sec); set_sd_v2_atime(sd_v2, inode->i_atime.tv_sec); - set_sd_v2_ctime(sd_v2, inode->i_ctime.tv_sec); + set_sd_v2_ctime(sd_v2, inode_ctime_peek(inode).tv_sec); set_sd_v2_blocks(sd_v2, to_fake_used_blocks(inode, SD_V2_SIZE)); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) set_sd_v2_rdev(sd_v2, new_encode_dev(inode->i_rdev)); @@ -1394,7 +1394,7 @@ static void inode2sd_v1(void *sd, struct inode *inode, loff_t size) set_sd_v1_nlink(sd_v1, inode->i_nlink); set_sd_v1_size(sd_v1, size); set_sd_v1_atime(sd_v1, inode->i_atime.tv_sec); - set_sd_v1_ctime(sd_v1, inode->i_ctime.tv_sec); + set_sd_v1_ctime(sd_v1, inode_ctime_peek(inode).tv_sec); set_sd_v1_mtime(sd_v1, inode->i_mtime.tv_sec); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) @@ -1986,7 +1986,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, /* uid and gid must already be set by the caller for quota init */ - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_size = i_size; inode->i_blocks = 0; inode->i_bytes = 0; diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index 6bf9b54e58ca..5d129a0b3ce7 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c @@ -55,7 +55,7 @@ int reiserfs_fileattr_set(struct mnt_idmap *idmap, } sd_attrs_to_i_attrs(flags, inode); REISERFS_I(inode)->i_attrs = flags; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); err = 0; unlock: @@ -107,7 +107,7 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) err = -EFAULT; goto setversion_out; } - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); setversion_out: mnt_drop_write_file(filp); diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 52240cc891cf..fa4d11b21279 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c @@ -572,7 +572,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, } dir->i_size += paste_size; - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); if (!S_ISDIR(inode->i_mode) && visible) /* reiserfs_mkdir or reiserfs_rename will do that by itself */ reiserfs_update_sd(th, dir); @@ -966,7 +966,8 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) inode->i_nlink); clear_nlink(inode); - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(dir); + inode_ctime_set_current(inode); + dir->i_mtime = inode_ctime_set_current(dir); reiserfs_update_sd(&th, inode); DEC_DIR_INODE_NLINK(dir) @@ -1070,11 +1071,11 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) inc_nlink(inode); goto end_unlink; } - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); reiserfs_update_sd(&th, inode); dir->i_size -= (de.de_entrylen + DEH_SIZE); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); reiserfs_update_sd(&th, dir); if (!savelink) @@ -1250,7 +1251,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, return err ? err : retval; } - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); reiserfs_update_sd(&th, inode); ihold(inode); @@ -1325,7 +1326,6 @@ static int reiserfs_rename(struct mnt_idmap *idmap, int jbegin_count; umode_t old_inode_mode; unsigned long savelink = 1; - struct timespec64 ctime; if (flags & ~RENAME_NOREPLACE) return -EINVAL; @@ -1576,14 +1576,13 @@ static int reiserfs_rename(struct mnt_idmap *idmap, mark_de_hidden(old_de.de_deh + old_de.de_entry_num); journal_mark_dirty(&th, old_de.de_bh); - ctime = current_time(old_dir); - old_dir->i_ctime = old_dir->i_mtime = ctime; - new_dir->i_ctime = new_dir->i_mtime = ctime; + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); /* * thanks to Alex Adriaanse for patch * which adds ctime update of renamed object */ - old_inode->i_ctime = ctime; + inode_ctime_set_current(old_inode); if (new_dentry_inode) { /* adjust link number of the victim */ @@ -1592,7 +1591,7 @@ static int reiserfs_rename(struct mnt_idmap *idmap, } else { drop_nlink(new_dentry_inode); } - new_dentry_inode->i_ctime = ctime; + inode_ctime_set_current(new_dentry_inode); savelink = new_dentry_inode->i_nlink; } diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index ce5003986789..c7f0aa0e9a2e 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -2004,7 +2004,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, if (update_timestamps) { inode->i_mtime = current_time(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } reiserfs_update_sd(th, inode); @@ -2029,7 +2029,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, if (update_timestamps) { /* this is truncate, not file closing */ inode->i_mtime = current_time(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } reiserfs_update_sd(th, inode); diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 929acce6e731..0ff67c74aac2 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c @@ -2587,7 +2587,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type, return err; if (inode->i_size < off + len - towrite) i_size_write(inode, off + len - towrite); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); return len - towrite; } diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 651027967159..469d700d97a9 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c @@ -466,12 +466,13 @@ int reiserfs_commit_write(struct file *f, struct page *page, static void update_ctime(struct inode *inode) { struct timespec64 now = current_time(inode); + struct timespec64 ctime = inode_ctime_peek(inode); if (inode_unhashed(inode) || !inode->i_nlink || - timespec64_equal(&inode->i_ctime, &now)) + timespec64_equal(&ctime, &now)) return; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); } diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 138060452678..07ef471aa436 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c @@ -285,7 +285,7 @@ __reiserfs_set_acl(struct reiserfs_transaction_handle *th, struct inode *inode, if (error == -ENODATA) { error = 0; if (type == ACL_TYPE_ACCESS) { - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); } } From patchwork Wed Jun 21 14:46:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111151 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4477103vqr; Wed, 21 Jun 2023 09:09:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ48ievOzPppenOSYyIxx32U/lx3TSdaJNgulWNKDJi8sHbnz3PrED4l9vf7AeKaqo9PRtu7 X-Received: by 2002:a05:6a21:900c:b0:106:25b3:2f92 with SMTP id tq12-20020a056a21900c00b0010625b32f92mr9470967pzb.52.1687363781850; Wed, 21 Jun 2023 09:09:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363781; cv=none; d=google.com; s=arc-20160816; b=TQZH1C39QgEzxeNQfQD8s9AagtwbkfiP6PAlOcT0FDiL1mJ/VHnCoObFJ2rsuPSSJT VeLGq4HHsV3lkOH6dWr2v2y/n5nT5L0pHUu6Sa6HhVxfJf9gBwP7wKCYZj5uOq+i0DuL IVmH6XjZX40FprjaunHlPWRSNVwvqHORR1FiERX90t6PFBjLk8jz1U50ueuLHpLGOUcB VcCtjTw6/85SJzoTSVULyinYhCxRkcBxzLm+4x3pAo1eVGV5KTM0QEOyYpFOginQd+Gm b1FfK1n/ajgOezmRgqZYPngZgHH9tiAWkuImQbbzU3sq3zwfSSoEOUpATKnPAHNx/7rD QAWQ== 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=rZ37FSrPKBFJbxFMACmctq7Q5mC2cKrCuN+k9Tg8RV4=; b=zzCZEoVeKYWzoxX77GmeNyF8Zosa+EuQxyk4lAnfSnMjY/EfPgbT2WyMsz/5AlOdUl 4IScqoba/U7y6xPQUy28thYQFRC9PBcX+8WTstdLb+aiVxQl4Xkdw0XbpTWPqP840bTg SUdbfbF3Y4tFsWcwD+KpYDzdZu42o0ID7XdCJ8UnVfgMfmesZjSOqaSFHrL3Bjk0guOI DOpmMy82C9MLRv2Id4Lw5g+w//QiDl2r83yQC10tqSk/m0cp40E5RY3noDhsFf0cQTp0 dISC99+/X9Wt1tdhQeRWKzt8yH2ZQJZCcyk+Tu8NLd5tFV27VgFx7Dwa4gnMnRptmRg1 6jLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=I6davxw0; 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 q4-20020aa78424000000b0065ef9f22da9si1764262pfn.19.2023.06.21.09.09.27; Wed, 21 Jun 2023 09:09:41 -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=I6davxw0; 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 S233035AbjFUOyN (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232946AbjFUOxJ (ORCPT ); Wed, 21 Jun 2023 10:53:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E28D2101 for ; Wed, 21 Jun 2023 07:49:41 -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 BAD74615A9 for ; Wed, 21 Jun 2023 14:49:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B72B8C433C8; Wed, 21 Jun 2023 14:49:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358961; bh=nkhHCNGuJB7cLw9t9M4IrpbsQgRvxk6x/r8fxSR7EIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6davxw0bJQjROX9caeCfWoQ0sApzeoXR1M/iBz9F0t5ViFmHv7S4Z58jN/+1cYhf xH0TRPzWF4nQAPMYmv0iysbne5Bbrmb+rTrkFyD1OSH6jHKi0Zz9C0pY8kszmpPcfh V650KPb2HmRSOcLWX0PiRa2sCfYCFABkEDApPZ1qAfGGKSWIuz7n0aGvY9EpVE6Xok IX2CmQVa4iZnx6b3gnAa2V+f8jHtpcWJ2tZCES/vTPoxY5dMQiGQAouWY/jcu9QZlw kPAPJme4pQRo89xYsOiFDK7thZlnnQJ20ZRAebj7gXtGxLuPVbbh/bXj3Wzoe0MaML OwvoJsfc9Y0/Q== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 61/79] romfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:14 -0400 Message-ID: <20230621144735.55953-60-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769329165085805272?= X-GMAIL-MSGID: =?utf-8?q?1769329165085805272?= 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 --- fs/romfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/romfs/super.c b/fs/romfs/super.c index c59b230d55b4..1adea5c249a6 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -322,8 +322,8 @@ static struct inode *romfs_iget(struct super_block *sb, unsigned long pos) set_nlink(i, 1); /* Hard to decide.. */ i->i_size = be32_to_cpu(ri.size); - i->i_mtime.tv_sec = i->i_atime.tv_sec = i->i_ctime.tv_sec = 0; - i->i_mtime.tv_nsec = i->i_atime.tv_nsec = i->i_ctime.tv_nsec = 0; + i->i_mtime.tv_sec = i->i_atime.tv_sec = inode_ctime_set_sec(i, 0); + i->i_mtime.tv_nsec = i->i_atime.tv_nsec = inode_ctime_set_nsec(i, 0); /* set up mode and ops */ mode = romfs_modemap[nextfh & ROMFH_TYPE]; From patchwork Wed Jun 21 14:46:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4442082vqr; Wed, 21 Jun 2023 08:18:50 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tv1djw67l3LBQaFcbKQLedkUJfPtNjbZWVPUf/NEqZ+m9ISgfsjBg/3wZ+wT3UXapKMPS X-Received: by 2002:a05:6a21:33a1:b0:122:6107:8d7a with SMTP id yy33-20020a056a2133a100b0012261078d7amr6982381pzb.54.1687360730276; Wed, 21 Jun 2023 08:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360730; cv=none; d=google.com; s=arc-20160816; b=rq5yQUzaZGCA0BxGsWvVyBFh0Cf+kj4Xms9wTyk/DyWDnJ1S5Y264aQIyuRCuBUlqi 9blFjNHrADl/ChdfmfdcsKkASADZEn3y/y08guYYOBKcdy5dQR+ykCzK9MdntzQxn/B9 XHlitIheDH7hMAxHtjjW+zrSicdKW8SDKfRY4pIZB7leFst86X8JDqEqSRZzCrFe5uJC EjK2LRRUHq6CMxoENy+TiQuA2omF+3HzlGJ8py0vJPVk/+7V/Y6QsLwJLF/d+FgtW3d0 de0UoQp1MYve085K7OM2Szb7+a59ly8M56VUWqLySCBKNwq5ucTWUXgHrafMBEDrs7Bz bTHw== 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=kmwzWDav2VOBe1RQLa+AUKYFEwnHFdLS2tpagjFh60k=; b=B+sFjQonoC5Rn/m4fDq3C9bJ72zizxg84maPjtmV9jVxh8N6GA+L50nTFqrGD2ndGU jMgOmFgHgaN5jvzNApr9FySkJ0PWHl1R89Z3EauN59x6IbYjZUgECKTUBgWRaBVTR7uw jI9xvFtjRZLVclcQUdlKrLDBCkrS7l/Tr73dyXzX73o5CNeBnOFu9cm7HMZVsSOsypCy nSx61IkBIO+NboyroBfWW6Wo3TFbmY5APIYtKqDHDeedxsv5Dk9nVhagsjMQLUNJ7VC7 s5WR7P5Q3wZn93ol6UQKQS25PwmP2bD2c3+WtxFlnWGs/VTFcz7qR/SqTzs4Ju0AdwxD 9knA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AFUtyRRg; 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 e11-20020a056a0000cb00b006688882d4d8si4096892pfj.403.2023.06.21.08.18.37; Wed, 21 Jun 2023 08:18:50 -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=AFUtyRRg; 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 S232782AbjFUOxq (ORCPT + 99 others); Wed, 21 Jun 2023 10:53:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232901AbjFUOwy (ORCPT ); Wed, 21 Jun 2023 10:52:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E13530D7; Wed, 21 Jun 2023 07:49:24 -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 5FE8B615A2; Wed, 21 Jun 2023 14:49:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AEBFC433C0; Wed, 21 Jun 2023 14:49:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358963; bh=j/gKc8SO+4X9/hfbQM/fEoyBcWp5HKq3m4pNjrKuEFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AFUtyRRgG16CLUiWlHJn2d041S5iJKhOLRSpXXIJJGZBQ0mamVeVi2A1t0Ihnq4Yp a7pcZcjpYEDpgSY75qaU/hgozxQOHRHSDOYpwiq9rXPpx3QXJUKEz7d6Dxpna+rriT h2oAFOp6/PjdAZHy26Wea960Yfxa+0gHVaVyyi/qkfqLsmBU4GCn2P1/fXmnicDAWd YBbya+f6juc7CYF839ABApgexrVvSYG4slOYRFtxV2h9ybi/SMo3lAn6Z0osrzJ9NN 5OnNllJ2PKwQJSVehywRkovsNOjcSD/loezxWxsVgIfkfZ4DMH/3byUQbi5lEsFkB7 OSFrwMTCf2btw== From: Jeff Layton To: Christian Brauner , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Namjae Jeon , Sergey Senozhatsky Cc: Al Viro , Jan Kara , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Subject: [PATCH 62/79] smb: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:15 -0400 Message-ID: <20230621144735.55953-61-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 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?1769325965400532903?= X-GMAIL-MSGID: =?utf-8?q?1769325965400532903?= 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: Tom Talpey Reviewed-by: Sergey Senozhatsky --- fs/smb/client/file.c | 4 ++-- fs/smb/client/fscache.h | 5 +++-- fs/smb/client/inode.c | 15 +++++++-------- fs/smb/client/smb2ops.c | 2 +- fs/smb/server/smb2pdu.c | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 0a5fe8d5314b..07fed94b7501 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -1085,7 +1085,7 @@ int cifs_close(struct inode *inode, struct file *file) !test_bit(CIFS_INO_CLOSE_ON_LOCK, &cinode->flags) && dclose) { if (test_and_clear_bit(CIFS_INO_MODIFIED_ATTR, &cinode->flags)) { - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); } spin_lock(&cinode->deferred_lock); cifs_add_deferred_close(cfile, dclose); @@ -2596,7 +2596,7 @@ static int cifs_partialpagewrite(struct page *page, unsigned from, unsigned to) write_data, to - from, &offset); cifsFileInfo_put(open_file); /* Does mm or vfs already set times? */ - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); if ((bytes_written > 0) && (offset)) rc = 0; else if (bytes_written < 0) diff --git a/fs/smb/client/fscache.h b/fs/smb/client/fscache.h index 173999610997..1c50d286c3a4 100644 --- a/fs/smb/client/fscache.h +++ b/fs/smb/client/fscache.h @@ -50,12 +50,13 @@ void cifs_fscache_fill_coherency(struct inode *inode, struct cifs_fscache_inode_coherency_data *cd) { struct cifsInodeInfo *cifsi = CIFS_I(inode); + struct timespec64 ctime = inode_ctime_peek(&cifsi->netfs.inode); memset(cd, 0, sizeof(*cd)); cd->last_write_time_sec = cpu_to_le64(cifsi->netfs.inode.i_mtime.tv_sec); cd->last_write_time_nsec = cpu_to_le32(cifsi->netfs.inode.i_mtime.tv_nsec); - cd->last_change_time_sec = cpu_to_le64(cifsi->netfs.inode.i_ctime.tv_sec); - cd->last_change_time_nsec = cpu_to_le32(cifsi->netfs.inode.i_ctime.tv_nsec); + cd->last_change_time_sec = cpu_to_le64(ctime.tv_sec); + cd->last_change_time_nsec = cpu_to_le32(ctime.tv_nsec); } diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c index 1087ac6104a9..d986b280b6c3 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -172,7 +172,7 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) else inode->i_atime = fattr->cf_atime; inode->i_mtime = fattr->cf_mtime; - inode->i_ctime = fattr->cf_ctime; + inode_ctime_set(inode, fattr->cf_ctime); inode->i_rdev = fattr->cf_rdev; cifs_nlink_fattr_to_inode(inode, fattr); inode->i_uid = fattr->cf_uid; @@ -1744,9 +1744,9 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) cifs_inode = CIFS_I(inode); cifs_inode->time = 0; /* will force revalidate to get info when needed */ - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); } - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); cifs_inode = CIFS_I(dir); CIFS_I(dir)->time = 0; /* force revalidate of dir as well */ unlink_out: @@ -2060,8 +2060,8 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) */ cifsInode->time = 0; - d_inode(direntry)->i_ctime = inode->i_ctime = inode->i_mtime = - current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); + inode_ctime_set(d_inode(direntry), inode->i_mtime); rmdir_exit: free_dentry_path(page); @@ -2267,9 +2267,8 @@ cifs_rename2(struct mnt_idmap *idmap, struct inode *source_dir, /* force revalidate to go get info when needed */ CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0; - source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime = - target_dir->i_mtime = current_time(source_dir); - + source_dir->i_mtime = inode_ctime_set_current(source_dir); + target_dir->i_mtime = inode_ctime_set_current(target_dir); cifs_rename_exit: kfree(info_buf_source); free_dentry_path(page2); diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index 5639d8c48570..52564a5dd2b1 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -1391,7 +1391,7 @@ smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon, if (file_inf.LastWriteTime) inode->i_mtime = cifs_NTtimeToUnix(file_inf.LastWriteTime); if (file_inf.ChangeTime) - inode->i_ctime = cifs_NTtimeToUnix(file_inf.ChangeTime); + inode_ctime_set(inode, cifs_NTtimeToUnix(file_inf.ChangeTime)); if (file_inf.LastAccessTime) inode->i_atime = cifs_NTtimeToUnix(file_inf.LastAccessTime); diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index d31926194ebf..7a741ab6835c 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -4768,7 +4768,7 @@ static int find_file_posix_info(struct smb2_query_info_rsp *rsp, file_info->LastAccessTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode->i_mtime); file_info->LastWriteTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_ctime); + time = ksmbd_UnixTimeToNT(inode_ctime_peek(inode)); file_info->ChangeTime = cpu_to_le64(time); file_info->DosAttributes = fp->f_ci->m_fattr; file_info->Inode = cpu_to_le64(inode->i_ino); @@ -5409,7 +5409,7 @@ int smb2_close(struct ksmbd_work *work) rsp->LastAccessTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode->i_mtime); rsp->LastWriteTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_ctime); + time = ksmbd_UnixTimeToNT(inode_ctime_peek(inode)); rsp->ChangeTime = cpu_to_le64(time); ksmbd_fd_put(work, fp); } else { @@ -5628,7 +5628,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, if (file_info->ChangeTime) attrs.ia_ctime = ksmbd_NTtimeToUnix(file_info->ChangeTime); else - attrs.ia_ctime = inode->i_ctime; + attrs.ia_ctime = inode_ctime_peek(inode); if (file_info->LastWriteTime) { attrs.ia_mtime = ksmbd_NTtimeToUnix(file_info->LastWriteTime); @@ -5673,7 +5673,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, return -EACCES; inode_lock(inode); - inode->i_ctime = attrs.ia_ctime; + inode_ctime_set(inode, attrs.ia_ctime); attrs.ia_valid &= ~ATTR_CTIME; rc = notify_change(idmap, dentry, &attrs, NULL); inode_unlock(inode); From patchwork Wed Jun 21 14:46:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4457072vqr; Wed, 21 Jun 2023 08:41:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5M+0LXA2aDGBbk6iTegOZUh83Ll63iopbIIOUY/M1SJ6Iz5oeGZMwVsl1IUrtq7JCCaY4F X-Received: by 2002:a05:6808:23c7:b0:3a0:438e:ebc4 with SMTP id bq7-20020a05680823c700b003a0438eebc4mr4053942oib.41.1687362086531; Wed, 21 Jun 2023 08:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687362086; cv=none; d=google.com; s=arc-20160816; b=EFp7MkK31o3YhsFbuUpoqTWSEza0o3fjB/x5Cz4zKtLJWPnaAZ3S32deGldxikytzg rxUAbPSju/Nn6Lpj1KRUko9zrvyJyqedUq0gsEDzOWZoRCzsROgQ2tntjgehNScVvxZA pIlwUyV9oRLJ26FFmoLlstBXgc07rx+XotGaawaMYXOo/FjODIPH2pHs7qZPYF4CQ2X9 RXLTfLj2IPdj7u3U5prEHwjb+ytZsHf0v7Xh8kKiZJXqxzzRDHOgE+yziUJAC62YKDwb 5K3n8G18FE9scHk/IwoQrkGbwmaN9m0xNO4Ly7l45cNOKc0kaGyKeZd1UdrfcWVz++Ff FeTw== 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=/3XHyck1DJF5YAuyASeuPXEPSYYuMdh4+HQSCMGVJ2Y=; b=xmRejY6rnAmTnkMMovxbKk1GtU8ICcR6Pcpe95ad/229G/Vw2N9T3Mu0+FD2Xq0feK R5RpQHk3W7EMenZ/nxXidBfvj00hI3o25ebPkUGPOc0Jha1qD1k43sga+HziV+XtSYKl iAumBlNPftAtpuemdrMNNNzFTjSzMnNFC5HgEP+X25PC/XbIuH0ls1OhOwJ8GkU6qVnE NAtE0PtOwqrVUkpaxNMf/2lThoxSQrDU9/05qvW+0fjBuMkcsfsSju+h0MEeqrqwANon GxTiLfuAzh8D0/Y8uYeIgqbTPzkUB2EwnrfYr9feA+TfTZVNi+P6BUKYhsnwGVaf7GGE NHcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UBCccNdG; 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 l16-20020a17090aaa9000b0025c1af5672fsi622312pjq.112.2023.06.21.08.41.11; Wed, 21 Jun 2023 08:41:26 -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=UBCccNdG; 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 S233084AbjFUO4i (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233159AbjFUOzD (ORCPT ); Wed, 21 Jun 2023 10:55:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6950026A0 for ; Wed, 21 Jun 2023 07:50:33 -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 9B51061593 for ; Wed, 21 Jun 2023 14:49:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80F2BC433CB; Wed, 21 Jun 2023 14:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358965; bh=vtvQrPGrR+t0jK7eRQgHPWabkEM1OAXF8ZWhtRTMT2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UBCccNdGTlI5Ha0bcEzRIJatGLygln/MjrProEFyLo5R7ak5KDtMwfIlU/XPo1haF F2+Cnhz3NLRQKxD6XMWtUJQ0vZrKrnukvuu27+0bXxseESMYGqBZb5aMojsa8Jafyv K1C5l31IS74SyXai5ad4J4vWOt35AlGU5WnPCMAXMuvXLl1jZvXOqq9HEqB1k7NOsW GVQKj67tkfk45b+i08QC3B2wQPdnpp5bnF5i61mRbyb0+dTsWY9mfTtHXABl+cw+vk GSVvQSfn/jy2v6ejfybgTQLr8KWl/MqFkjCcvDE00CITxog3v16vSE0p7o7I4Bdvlx QO71PSpC0basQ== From: Jeff Layton To: Christian Brauner , Phillip Lougher Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 63/79] squashfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:16 -0400 Message-ID: <20230621144735.55953-62-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769327387580929572?= X-GMAIL-MSGID: =?utf-8?q?1769327387580929572?= 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 --- fs/squashfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c index 24463145b351..3d619b294c52 100644 --- a/fs/squashfs/inode.c +++ b/fs/squashfs/inode.c @@ -61,7 +61,7 @@ static int squashfs_new_inode(struct super_block *sb, struct inode *inode, inode->i_ino = le32_to_cpu(sqsh_ino->inode_number); inode->i_mtime.tv_sec = le32_to_cpu(sqsh_ino->mtime); inode->i_atime.tv_sec = inode->i_mtime.tv_sec; - inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; + inode_ctime_set_sec(inode, inode->i_mtime.tv_sec); inode->i_mode = le16_to_cpu(sqsh_ino->mode); inode->i_size = 0; From patchwork Wed Jun 21 14:46:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111144 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4470097vqr; Wed, 21 Jun 2023 09:01:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4y59w904PLpsGoE/dtoqy27i11nKpAaartPeh/ulaDpcoOIzH9256k0Pl1bUlq1vPhWtfE X-Received: by 2002:a05:6830:1d5b:b0:6b5:a440:a6c8 with SMTP id p27-20020a0568301d5b00b006b5a440a6c8mr4195295oth.30.1687363315873; Wed, 21 Jun 2023 09:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363315; cv=none; d=google.com; s=arc-20160816; b=oXDYxycx+HWCAYlA3QA6BNL1BJ9QmFHXfusAe36lz6CC4/gHQKFpQlP0tzPn8tgCmQ WLLZfO7brSKUVYFpknlWsCrJq9VSGtD2jreMrkehdBB8gtx3PwxYnZoLPMolu608PFjm LdrDocW6DglFgz0whmh2MQwKVPmhBhv0pKwHzgzrplzjaO3hkBpiMs1WYJztp0Xawh1Z 7gF0pIuLJnbs7dLNbsDizz72QFpwIP3P08LFk6OvUSWcMWs8ul3Ykoai4AMGOBFCftcO X3r7MavCK4PxhPI0xi08524WBRYaRIXhozQrkjDj+4UB+GKzdy0+KofkjXICCybn5AfT ihOA== 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=vW+RUT0mn1sj/Cxm8VsxeyI3zavyNOUZrpXrer1Zc8w=; b=NxpLyZDdyQNPKKQeVa7+IGgRSPulbmq3xpsuWJYm6KGhlZffN7BuXiizhaEhXlufiT HF/EkDtsaYlOm13OA6vfa6iTLEeiTH8yD+KvvbS4mn72yFVDjgecLFTKbBYte8/PX+8y gCNBKM5QUHzkzcH2K49pvfO3BqHonVLLxtnc44tvL6iCMQqP2PTIc/1uQJ2PxxKkXGB0 5Rl8+4sxhVWkeUE0P0j9aCXRAaqFTpA8EebhNciveUMD7S2xKuJ3GcIVzU24kq2DfVh7 W2yJdXiiT/VVo5RtLVsXFIQZgtrfe4yhZmCH0+CyOeGJR0OSe4P33MVmhdo4dtm09Wce UZRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sc0OSfSD; 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 t13-20020a654b8d000000b00542b2e4c96bsi4403133pgq.475.2023.06.21.09.01.41; Wed, 21 Jun 2023 09:01:55 -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=Sc0OSfSD; 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 S232791AbjFUO4o (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233195AbjFUOzK (ORCPT ); Wed, 21 Jun 2023 10:55:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DCF93AB0 for ; Wed, 21 Jun 2023 07:50:37 -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 6BD8E61572 for ; Wed, 21 Jun 2023 14:49:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6742CC433C0; Wed, 21 Jun 2023 14:49:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358966; bh=3yeFR++O7YTbL3qL8lqgEnCWrLLy3z6LDcBZ2euddMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sc0OSfSDrB2wRWT+hvakF+s22aeNS4E81l9ekBU2zRTAGMrvuWwn+QvLvEuVrFwBx 8+uDiclhRCSIWbWr0/dT/ZAbrV/EVK7j+Y0hrRL/W2gQ5bGeZMIuFJT5MXvGsGSvgk Riy55/uaTTnIf/IhMFwh1Pwh8AnCgbSkXMi5zc4BD1L5RWNcvcERCcD8HsmHDRBNYU l0GNIwzhrBwS5TnF06LhFwbZYskP9R9e+9n1RJEmmeST/DL39ou7DinalNexvVIk+c sg04PbTeMnbyyfm7Ivt1tUP3ixVqib6PY+CMExdxgyLP0KJKmaqGDggSKALjf6FAjF 6k9SoTix31zPg== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 64/79] sysv: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:17 -0400 Message-ID: <20230621144735.55953-63-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769328676211178158?= X-GMAIL-MSGID: =?utf-8?q?1769328676211178158?= 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 --- fs/sysv/dir.c | 6 +++--- fs/sysv/ialloc.c | 2 +- fs/sysv/inode.c | 6 +++--- fs/sysv/itree.c | 4 ++-- fs/sysv/namei.c | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index 0140010aa0c3..7c145f2e8b97 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c @@ -224,7 +224,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode) memset (de->name + namelen, 0, SYSV_DIRSIZE - namelen - 2); de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino); dir_commit_chunk(page, pos, SYSV_DIRSIZE); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); err = sysv_handle_dirsync(dir); out_page: @@ -249,7 +249,7 @@ int sysv_delete_entry(struct sysv_dir_entry *de, struct page *page) } de->inode = 0; dir_commit_chunk(page, pos, SYSV_DIRSIZE); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); return sysv_handle_dirsync(inode); } @@ -346,7 +346,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct page *page, } de->inode = cpu_to_fs16(SYSV_SB(inode->i_sb), inode->i_ino); dir_commit_chunk(page, pos, SYSV_DIRSIZE); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); return sysv_handle_dirsync(inode); } diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index e732879036ab..ade57ef69e3f 100644 --- a/fs/sysv/ialloc.c +++ b/fs/sysv/ialloc.c @@ -165,7 +165,7 @@ struct inode * sysv_new_inode(const struct inode * dir, umode_t mode) dirty_sb(sb); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_ino = fs16_to_cpu(sbi, ino); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_blocks = 0; memset(SYSV_I(inode)->i_data, 0, sizeof(SYSV_I(inode)->i_data)); SYSV_I(inode)->i_dir_start_lookup = 0; diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index 9e8d4a6fb2f3..53143b9e125a 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -202,8 +202,8 @@ struct inode *sysv_iget(struct super_block *sb, unsigned int ino) inode->i_size = fs32_to_cpu(sbi, raw_inode->i_size); inode->i_atime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_atime); inode->i_mtime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_mtime); - inode->i_ctime.tv_sec = fs32_to_cpu(sbi, raw_inode->i_ctime); - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_sec(inode, fs32_to_cpu(sbi, raw_inode->i_ctime)); + inode_ctime_set_nsec(inode, 0); inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; inode->i_blocks = 0; @@ -256,7 +256,7 @@ static int __sysv_write_inode(struct inode *inode, int wait) raw_inode->i_size = cpu_to_fs32(sbi, inode->i_size); raw_inode->i_atime = cpu_to_fs32(sbi, inode->i_atime.tv_sec); raw_inode->i_mtime = cpu_to_fs32(sbi, inode->i_mtime.tv_sec); - raw_inode->i_ctime = cpu_to_fs32(sbi, inode->i_ctime.tv_sec); + raw_inode->i_ctime = cpu_to_fs32(sbi, inode_ctime_peek(inode).tv_sec); si = SYSV_I(inode); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) diff --git a/fs/sysv/itree.c b/fs/sysv/itree.c index 58d7f43a1371..5b3bc071d270 100644 --- a/fs/sysv/itree.c +++ b/fs/sysv/itree.c @@ -183,7 +183,7 @@ static inline int splice_branch(struct inode *inode, *where->p = where->key; write_unlock(&pointers_lock); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); /* had we spliced it onto indirect block? */ if (where->bh) @@ -423,7 +423,7 @@ void sysv_truncate (struct inode * inode) } n++; } - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (IS_SYNC(inode)) sysv_sync_inode (inode); else diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index fcf163fea3ad..d5aa9468c362 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c @@ -103,7 +103,7 @@ static int sysv_link(struct dentry * old_dentry, struct inode * dir, { struct inode *inode = d_inode(old_dentry); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -161,7 +161,7 @@ static int sysv_unlink(struct inode * dir, struct dentry * dentry) err = sysv_delete_entry(de, page); if (!err) { - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); inode_dec_link_count(inode); } unmap_and_put_page(page, de); @@ -230,7 +230,7 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir, unmap_and_put_page(new_page, new_de); if (err) goto out_dir; - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); From patchwork Wed Jun 21 14:46:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4476651vqr; Wed, 21 Jun 2023 09:09:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YAInpNfiyen+d9+AnOUIk3z9Nuqkh0WiDzdFXphw48KZfucjC+8ui8t3f3m4800+jwaDD X-Received: by 2002:a05:6a00:1913:b0:668:7292:b2c2 with SMTP id y19-20020a056a00191300b006687292b2c2mr8047507pfi.2.1687363748524; Wed, 21 Jun 2023 09:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363748; cv=none; d=google.com; s=arc-20160816; b=y1T99p6c2X1CJISanSboib0YgV0+NcVP5poTiV40s0+hdTFR4RVSNM/1m3A4se8K1S gOg6yQ8lOThBdqhpxtyGW3611/TRxNaqScBMjKtGhsL+WAD/iFma5frtuiga+XuTXr7T qHjuJb0/s0DPM82n9sCSOqhdQG0zu46szUS7g3rJEgO1NeyrH2vYIhOo9iVRiS6ayqQn /CT58y2DcQACFWRh2D+3PYVpy46oIrePaaZeKqs1Obj9EWDI9IlM+1YQJNWMF77dO7nr aRqOmxe/G+MfhkA5ZbhFCQEx6TQkAnaa9YXwoYqww8Ob/wHOTJ9RB0uGHGg8IRs3EETW enjA== 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=dgjZgLI+li1AM1ruqXm9kQWAL+gIe+luqEPf1CQ/kvI=; b=OQPvcSoZgeG83wOoJk10hR0kX3PGgQkDgJeJaGINJ7XUT8obY6AfIjR2bIg+ap4Iu0 epR62r1rBl1ao0KjTY0XG73Q6Ao9676JAyYb83l53MSv5n+LxD0hz5I3897LXg+36iyz hkgecNl3K0YjzIuU/kvetbqpHUrJFH+1Uv9Hfia0MZHW702ddeWo1FuZSA26CIu+ohW6 kZ4kv7jgpWhlmRIFwyFZHBq4PKtmrTJptSWdkP/Vp2U5Bw2/21jTgksfL3eyqep3Qaa0 jzyFDIsAghTBCBpevvkku0eK7FzN6P6Hb/h2zCvwqv60yEfPb2JVm6/tZPTHsgqn6QQs seYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Im8pjHUr; 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 w17-20020a63af11000000b00542897dcc22si4211756pge.516.2023.06.21.09.08.54; Wed, 21 Jun 2023 09:09:08 -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=Im8pjHUr; 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 S233111AbjFUO4q (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233213AbjFUOzL (ORCPT ); Wed, 21 Jun 2023 10:55:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2567C3C06; Wed, 21 Jun 2023 07:50:40 -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 E308F615B8; Wed, 21 Jun 2023 14:49:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94ECDC433C0; Wed, 21 Jun 2023 14:49:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358968; bh=779b5HE/gvZfyI1PxNLGg0MlvOtGaaXF4FcVZ7xYTIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Im8pjHUrm9nuFtUPKuM8vt6t+ZDLxcnatmzdgIVyfOyIM59sPWXF8qu4TWQRg3zcC 4vTcClWgaTi9fHtCXeLeu//chHjKju8AMuFU6O/LX4AdDt8b1sAlm+Vq4CoYcCH849 uP5lIbhLNZ2l9HfkEZVfwE52vLArtLLG8SkJ3len8vwlo+PvpZr8XDNphqy1VVPWlj 3dCwlhwnQbpP6pOjVNX7cKTTYDga5xewV22cckb1dJDRyH2stVoX6+9/OFnBfplBuB 4hXxLyzWAbqVoE2c3OMF/I1rxDwOftY1dKwQh+d8vtfwsPK22ffp7SxXWMAsw5SJ1Y VY8uxgAtkE6EQ== From: Jeff Layton To: Christian Brauner , Steven Rostedt , Masami Hiramatsu Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH 65/79] tracefs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:18 -0400 Message-ID: <20230621144735.55953-64-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769329130082219644?= X-GMAIL-MSGID: =?utf-8?q?1769329130082219644?= 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 --- fs/tracefs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 57ac8aa4a724..aae4b5645efd 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -132,7 +132,7 @@ static struct inode *tracefs_get_inode(struct super_block *sb) struct inode *inode = new_inode(sb); if (inode) { inode->i_ino = get_next_ino(); - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); } return inode; } From patchwork Wed Jun 21 14:46:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111120 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4444897vqr; Wed, 21 Jun 2023 08:23:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5w1+Tolo2lrmyo8tz1mdAuiTPlb3INy3jekJxnX+yRo4OCV7IZ3old4S1fedPf2ijR3rgk X-Received: by 2002:a17:903:124d:b0:1b0:3a74:7fc4 with SMTP id u13-20020a170903124d00b001b03a747fc4mr12284509plh.24.1687360983258; Wed, 21 Jun 2023 08:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360983; cv=none; d=google.com; s=arc-20160816; b=HELz04I/FhPyPn9rFar3GOFcfRRQ8IE+Fzy188A8L02wGCyhvJA8tSicV8XaAaBbfd S73QzNr8Y63H8+xrqKeYq0WTkOTsEWmiJdadEnpv3S2EKRO3Oy6Ots7sJasIv+e1tYFA gi3fHMdsypIKB5LbncgpyilE8l8WUkdmJY0pDwgs0Err2GCl3OpfiOZO6lx5FCgdAoM7 wFJXRtcI0IZ3/tsmudd9QSWwnzX26ELQ1ezqnY0qCdBVttLCrnBqHLtm9jq6v2or1+j2 tkvz40mLx+KH5xnY52AfdtstySvZJ6Yxpwl1nf84uqS4LZpaOAT8F6ow6eznKl/FmD2c h/2g== 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=Nzf3QT4dLLXSG2zpVlrpu/rDynZTwJ+AzRFL0sJlW84=; b=r0T8+jkCgcIwG0CWrAEDFh8lTk//3dEgUpFGnKw3X+NE1nWEBQPOCSlYTvGfvMrPwu pVjwmphJ5SGdlDJFYEdTOddr0YqlTYF0kojC/COW81uSidLlnoCR21x61DY7v5CJN35z mKJia2uX7H1NqZmUwLfXiLtz6x9G9w7LeXzMTB1NelqTZGROOwr49pIyYVTL/zjZfWEv 3LoGIqd4xHOVaToKvxli0HTH/oAXgwZ9gjp+6MwBmO+tKYg7ERdUaPCM4q9TIuKEzijA LJ4j0FTu74ldzj9rNjxnlmK9PZxrd0Go+tqcz58hERPGPMypjBhHDeTnxEs7D7BQQbzY 6KIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mhLiYYPm; 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 kj13-20020a17090306cd00b001b54ff18ecfsi4037505plb.386.2023.06.21.08.22.49; Wed, 21 Jun 2023 08:23:03 -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=mhLiYYPm; 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 S233104AbjFUO4l (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233112AbjFUOy6 (ORCPT ); Wed, 21 Jun 2023 10:54:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B3353A84 for ; Wed, 21 Jun 2023 07:50:28 -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 4C6F9615B5 for ; Wed, 21 Jun 2023 14:49:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DDEEC433C0; Wed, 21 Jun 2023 14:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358970; bh=bWfKou76bFFjObS87FXTEtpJCLJj//Ee7jkqO2cLFu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mhLiYYPm7NVKGNQtohUL1QsckjE7jWHddEG0eG0Dd5MeQONM4c5tPIMwbaTZpOKN5 7gE/KZvcOX1L2j5X7dMDQStzCSBL7GDFb1Pvqkp50C58XEzs0X5Bpe7EGbSGrZWH2e orLE+IgHLKWEqAd3vc75jlrAH8ucg+KmPPcXnncDJ4X9pzBkg95y2jsDYuCTAt8eBQ BvDNYP0B5gbUxzqUeAfhofA2KSZ/ccUxnlM7o4lYIOlMtsByRLbk9Tmr9Brg2MT2hX fvnSgbVkk/V/923zJLWnq9kytHnt9ePWxPM+6c/mf913x55Gii4bpsyToBoTRz7m56 jye04OQwA5Ksg== From: Jeff Layton To: Christian Brauner , Richard Weinberger Cc: Al Viro , Jan Kara , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 66/79] ubifs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:19 -0400 Message-ID: <20230621144735.55953-65-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 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?1769326230500224873?= X-GMAIL-MSGID: =?utf-8?q?1769326230500224873?= 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 --- fs/ubifs/debug.c | 4 ++-- fs/ubifs/dir.c | 39 +++++++++++++++++++-------------------- fs/ubifs/file.c | 16 +++++++++------- fs/ubifs/ioctl.c | 2 +- fs/ubifs/journal.c | 4 ++-- fs/ubifs/super.c | 4 ++-- fs/ubifs/xattr.c | 6 +++--- 7 files changed, 38 insertions(+), 37 deletions(-) diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 9c9d3f0e36a4..114c2b00aa29 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -243,8 +243,8 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) (unsigned int)inode->i_mtime.tv_sec, (unsigned int)inode->i_mtime.tv_nsec); pr_err("\tctime %u.%u\n", - (unsigned int)inode->i_ctime.tv_sec, - (unsigned int)inode->i_ctime.tv_nsec); + (unsigned int) inode_ctime_peek(inode).tv_sec, + (unsigned int) inode_ctime_peek(inode).tv_nsec); pr_err("\tcreat_sqnum %llu\n", ui->creat_sqnum); pr_err("\txattr_size %u\n", ui->xattr_size); pr_err("\txattr_cnt %u\n", ui->xattr_cnt); diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index ef0499edc248..39588e3e3a8b 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -96,8 +96,7 @@ struct inode *ubifs_new_inode(struct ubifs_info *c, struct inode *dir, inode->i_flags |= S_NOCMTIME; inode_init_owner(&nop_mnt_idmap, inode, dir, mode); - inode->i_mtime = inode->i_atime = inode->i_ctime = - current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); inode->i_mapping->nrpages = 0; if (!is_xattr) { @@ -325,7 +324,7 @@ static int ubifs_create(struct mnt_idmap *idmap, struct inode *dir, mutex_lock(&dir_ui->ui_mutex); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -765,10 +764,10 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, inc_nlink(inode); ihold(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -838,11 +837,11 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) } lock_2_inodes(dir, inode); - inode->i_ctime = current_time(dir); + inode_ctime_set(inode, current_time(dir)); drop_nlink(inode); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 1, 0); if (err) goto out_cancel; @@ -940,12 +939,12 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) } lock_2_inodes(dir, inode); - inode->i_ctime = current_time(dir); + inode_ctime_set(inode, current_time(dir)); clear_nlink(inode); drop_nlink(dir); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 1, 0); if (err) goto out_cancel; @@ -1019,7 +1018,7 @@ static int ubifs_mkdir(struct mnt_idmap *idmap, struct inode *dir, inc_nlink(dir); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) { ubifs_err(c, "cannot create directory, error %d", err); @@ -1110,7 +1109,7 @@ static int ubifs_mknod(struct mnt_idmap *idmap, struct inode *dir, mutex_lock(&dir_ui->ui_mutex); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -1210,7 +1209,7 @@ static int ubifs_symlink(struct mnt_idmap *idmap, struct inode *dir, mutex_lock(&dir_ui->ui_mutex); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = dir->i_ctime = inode->i_ctime; + dir->i_mtime = inode_ctime_set(inode, inode_ctime_peek(inode)); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -1415,7 +1414,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, * rename. */ time = current_time(old_dir); - old_inode->i_ctime = time; + inode_ctime_set(old_inode, time); /* We must adjust parent link count when renaming directories */ if (is_dir) { @@ -1444,8 +1443,8 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, old_dir->i_size -= old_sz; ubifs_inode(old_dir)->ui_size = old_dir->i_size; - old_dir->i_mtime = old_dir->i_ctime = time; - new_dir->i_mtime = new_dir->i_ctime = time; + old_dir->i_mtime = inode_ctime_set(old_dir, time); + new_dir->i_mtime = inode_ctime_set(new_dir, time); /* * And finally, if we unlinked a direntry which happened to have the @@ -1462,7 +1461,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, clear_nlink(new_inode); else drop_nlink(new_inode); - new_inode->i_ctime = time; + inode_ctime_set(new_inode, time); } else { new_dir->i_size += new_sz; ubifs_inode(new_dir)->ui_size = new_dir->i_size; @@ -1589,10 +1588,10 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, lock_4_inodes(old_dir, new_dir, NULL, NULL); time = current_time(old_dir); - fst_inode->i_ctime = time; - snd_inode->i_ctime = time; - old_dir->i_mtime = old_dir->i_ctime = time; - new_dir->i_mtime = new_dir->i_ctime = time; + inode_ctime_set(fst_inode, time); + inode_ctime_set(snd_inode, time); + old_dir->i_mtime = inode_ctime_set(old_dir, time); + new_dir->i_mtime = inode_ctime_set(new_dir, time); if (old_dir != new_dir) { if (S_ISDIR(fst_inode->i_mode) && !S_ISDIR(snd_inode->i_mode)) { diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 6738fe43040b..f9ba69f6fbab 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1092,7 +1092,7 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr) if (attr->ia_valid & ATTR_MTIME) inode->i_mtime = attr->ia_mtime; if (attr->ia_valid & ATTR_CTIME) - inode->i_ctime = attr->ia_ctime; + inode_ctime_set(inode, attr->ia_ctime); if (attr->ia_valid & ATTR_MODE) { umode_t mode = attr->ia_mode; @@ -1192,7 +1192,7 @@ static int do_truncation(struct ubifs_info *c, struct inode *inode, mutex_lock(&ui->ui_mutex); ui->ui_size = inode->i_size; /* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); /* Other attributes may be changed at the same time as well */ do_attr_changes(inode, attr); err = ubifs_jnl_truncate(c, inode, old_size, new_size); @@ -1239,7 +1239,7 @@ static int do_setattr(struct ubifs_info *c, struct inode *inode, mutex_lock(&ui->ui_mutex); if (attr->ia_valid & ATTR_SIZE) { /* Truncation changes inode [mc]time */ - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); /* 'truncate_setsize()' changed @i_size, update @ui_size */ ui->ui_size = inode->i_size; } @@ -1364,8 +1364,10 @@ int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) static inline int mctime_update_needed(const struct inode *inode, const struct timespec64 *now) { + struct timespec64 ctime = inode_ctime_peek(inode); + if (!timespec64_equal(&inode->i_mtime, now) || - !timespec64_equal(&inode->i_ctime, now)) + !timespec64_equal(&ctime, now)) return 1; return 0; } @@ -1396,7 +1398,7 @@ int ubifs_update_time(struct inode *inode, struct timespec64 *time, if (flags & S_ATIME) inode->i_atime = *time; if (flags & S_CTIME) - inode->i_ctime = *time; + inode_ctime_set(inode, *time); if (flags & S_MTIME) inode->i_mtime = *time; @@ -1432,7 +1434,7 @@ static int update_mctime(struct inode *inode) return err; mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); @@ -1570,7 +1572,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf) struct ubifs_inode *ui = ubifs_inode(inode); mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index 67c5108abd89..a4da17f4cceb 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c @@ -118,7 +118,7 @@ static int setflags(struct inode *inode, int flags) ui->flags &= ~ioctl2ubifs(UBIFS_SETTABLE_IOCTL_FLAGS); ui->flags |= ioctl2ubifs(flags); ubifs_set_inode_flags(inode); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index dc52ac0f4a34..86f5d73cd613 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -454,8 +454,8 @@ static void pack_inode(struct ubifs_info *c, struct ubifs_ino_node *ino, ino->creat_sqnum = cpu_to_le64(ui->creat_sqnum); ino->atime_sec = cpu_to_le64(inode->i_atime.tv_sec); ino->atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); - ino->ctime_sec = cpu_to_le64(inode->i_ctime.tv_sec); - ino->ctime_nsec = cpu_to_le32(inode->i_ctime.tv_nsec); + ino->ctime_sec = cpu_to_le64(inode_ctime_peek(inode).tv_sec); + ino->ctime_nsec = cpu_to_le32(inode_ctime_peek(inode).tv_nsec); ino->mtime_sec = cpu_to_le64(inode->i_mtime.tv_sec); ino->mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); ino->uid = cpu_to_le32(i_uid_read(inode)); diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 32cb14759796..29c2f40acac9 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -146,8 +146,8 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum) inode->i_atime.tv_nsec = le32_to_cpu(ino->atime_nsec); inode->i_mtime.tv_sec = (int64_t)le64_to_cpu(ino->mtime_sec); inode->i_mtime.tv_nsec = le32_to_cpu(ino->mtime_nsec); - inode->i_ctime.tv_sec = (int64_t)le64_to_cpu(ino->ctime_sec); - inode->i_ctime.tv_nsec = le32_to_cpu(ino->ctime_nsec); + inode_ctime_set_sec(inode, (int64_t)le64_to_cpu(ino->ctime_sec)); + inode_ctime_set_nsec(inode, le32_to_cpu(ino->ctime_nsec)); inode->i_mode = le32_to_cpu(ino->mode); inode->i_size = le64_to_cpu(ino->size); diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 349228dd1191..d5955e1fbb7d 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c @@ -134,7 +134,7 @@ static int create_xattr(struct ubifs_info *c, struct inode *host, ui->data_len = size; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = current_time(host); + inode_ctime_set_current(host); host_ui->xattr_cnt += 1; host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); host_ui->xattr_size += CALC_XATTR_BYTES(size); @@ -215,7 +215,7 @@ static int change_xattr(struct ubifs_info *c, struct inode *host, ui->data_len = size; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = current_time(host); + inode_ctime_set_current(host); host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); host_ui->xattr_size += CALC_XATTR_BYTES(size); @@ -474,7 +474,7 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host, return err; mutex_lock(&host_ui->ui_mutex); - host->i_ctime = current_time(host); + inode_ctime_set_current(host); host_ui->xattr_cnt -= 1; host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); host_ui->xattr_size -= CALC_XATTR_BYTES(ui->data_len); From patchwork Wed Jun 21 14:46:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4436872vqr; Wed, 21 Jun 2023 08:11:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7rOVkW2l86/6j4u+mNIn6CWaiD2oXE03/asJCkONa1YaJfxSGwmYRAYYDFsQi+CKtfyzX9 X-Received: by 2002:a17:90a:a66:b0:258:99d1:6b84 with SMTP id o93-20020a17090a0a6600b0025899d16b84mr11875288pjo.41.1687360299729; Wed, 21 Jun 2023 08:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360299; cv=none; d=google.com; s=arc-20160816; b=UPgLhfkJCCwgpftbnHhfzutaLuWYulzFkSXdPe0PPBjtX+L/1WIYimfCYKXtAtfrto kHgZHIBIVaYQ4D+UuuUchdxcKiScfNKU6LdDChOuaael3DWtOsO/vGdkMamhXnHItbe+ BxP3LyYNiIe4iRUaDiI4cSS+/HmG7hR5SpN7oWLijUPNtNdIoekDJZ25Y0/dgaq951j0 dpfnQl0sgHeAf4K63fIM4b1GiMZ429LX563PdL5Z6P/wt/6xbTH0AB+pFO5Qppq13Fi1 dYpLksR4PyZ+2YldBQahEOkNe6UniSGzuAgxwQd4v6CYMuLGDbdv6r7S+isz6ClwA2Jy 6tcQ== 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=Ak51BeUfCqTjqDclQIwwbIVqWpGGBj/fBz0BPL1oXas=; b=AXPXso3/z5n12RK6EleS3SU5d4Ok73CIpX4qNwHYrXeRGKqGjIwPrGfZE1ngHzQunZ qLXXkMcw4lZILx0J5VYTZjWOXiyn/e5xVCqJGM3i0K5ZvdJxRy8Xt6s/NXP7qKFezjA1 HK9blkNDKZJ90vpck7xAdhkeL15Cvp4byIibguxK5TYUCkMFYU/9XTfX7HtrltJVdy/T hVI4GmDul3M7p1BWc9g/j7K1wXrZqrv0K96AOuy4LYhJhOQLQ7VALOkwwISsX2+XtzVY deMCnrQxJBE/DwldI/iYx5zVFoeXPCyFiqtMgebSbu37sbsDNp6o//fjFZ5BWV49yQrs lucQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tddGOEwI; 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 w8-20020a63f508000000b0054fbd904b6dsi2232902pgh.500.2023.06.21.08.11.25; Wed, 21 Jun 2023 08:11:39 -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=tddGOEwI; 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 S233011AbjFUOyB (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232937AbjFUOxG (ORCPT ); Wed, 21 Jun 2023 10:53:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AE1130DE for ; Wed, 21 Jun 2023 07:49:34 -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 EEC7A615C9 for ; Wed, 21 Jun 2023 14:49:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4D71C433C8; Wed, 21 Jun 2023 14:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358972; bh=6QoqtM/yLv5wl60ALByHpdG2UYIXCUSz8axrRGF+yAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tddGOEwI+4i7EAHz9lvAtVvCNgOeWxZ5bXAlo7sgSQzNzTQ/Y4HQvHIYv8N5jGTyw WtoFJG0/maQDiaGilCW6Tk+QF2JMBsOliJbDEyAnwXRYYQgbyqEKIs22Yb05ZheUlH cgdF0KoSTG2GT/8zQmAW+INTtmTgFXdNzi3NBO9VJcdORqYc8U1Qx5pYZXOHx0wa/t CC1etQwYNLP4XuFMMwmbaHQ7cbT/aYH94sx2aTl0j+nkEW1Le/35Bn/Ww9/3YkrJA5 ADJvJmRlju7WKpDNgXLoWNz49YraoYAoWWR0Zr6qFiBjYSJiOEF4Ah56mAyyZ9wZP6 MNWYxu8jfnlSw== From: Jeff Layton To: Christian Brauner , Jan Kara Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 67/79] udf: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:20 -0400 Message-ID: <20230621144735.55953-66-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325513561183837?= X-GMAIL-MSGID: =?utf-8?q?1769325513561183837?= 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 --- fs/udf/ialloc.c | 2 +- fs/udf/inode.c | 17 ++++++++++------- fs/udf/namei.c | 24 ++++++++++++------------ 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 5f7ac8c84798..6320b15113e4 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -100,7 +100,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; else iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); iinfo->i_crtime = inode->i_mtime; if (unlikely(insert_inode_locked(inode) < 0)) { make_bad_inode(inode); diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 28cdfc57d946..4c31a51e0d18 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -910,7 +910,7 @@ static int inode_getblk(struct inode *inode, struct udf_map_rq *map) map->oflags = UDF_BLK_NEW | UDF_BLK_MAPPED; iinfo->i_next_alloc_block = map->lblk + 1; iinfo->i_next_alloc_goal = newblocknum + 1; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (IS_SYNC(inode)) udf_sync_inode(inode); @@ -1298,7 +1298,7 @@ int udf_setsize(struct inode *inode, loff_t newsize) goto out_unlock; } update_time: - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); if (IS_SYNC(inode)) udf_sync_inode(inode); else @@ -1329,6 +1329,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) int bs = inode->i_sb->s_blocksize; int ret = -EIO; uint32_t uid, gid; + struct timespec64 ctime; reread: if (iloc->partitionReferenceNum >= sbi->s_partitions) { @@ -1501,13 +1502,14 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) inode->i_size = le64_to_cpu(fe->informationLength); iinfo->i_lenExtents = inode->i_size; + ctime = inode_ctime_peek(inode); if (iinfo->i_efe == 0) { inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << (inode->i_sb->s_blocksize_bits - 9); udf_disk_stamp_to_time(&inode->i_atime, fe->accessTime); udf_disk_stamp_to_time(&inode->i_mtime, fe->modificationTime); - udf_disk_stamp_to_time(&inode->i_ctime, fe->attrTime); + udf_disk_stamp_to_time(&ctime, fe->attrTime); iinfo->i_unique = le64_to_cpu(fe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); @@ -1522,7 +1524,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) udf_disk_stamp_to_time(&inode->i_atime, efe->accessTime); udf_disk_stamp_to_time(&inode->i_mtime, efe->modificationTime); udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); - udf_disk_stamp_to_time(&inode->i_ctime, efe->attrTime); + udf_disk_stamp_to_time(&ctime, efe->attrTime); iinfo->i_unique = le64_to_cpu(efe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); @@ -1799,7 +1801,7 @@ static int udf_update_inode(struct inode *inode, int do_sync) udf_time_to_disk_stamp(&fe->accessTime, inode->i_atime); udf_time_to_disk_stamp(&fe->modificationTime, inode->i_mtime); - udf_time_to_disk_stamp(&fe->attrTime, inode->i_ctime); + udf_time_to_disk_stamp(&fe->attrTime, inode_ctime_peek(inode)); memset(&(fe->impIdent), 0, sizeof(struct regid)); strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; @@ -1830,12 +1832,13 @@ static int udf_update_inode(struct inode *inode, int do_sync) udf_adjust_time(iinfo, inode->i_atime); udf_adjust_time(iinfo, inode->i_mtime); - udf_adjust_time(iinfo, inode->i_ctime); + udf_adjust_time(iinfo, inode_ctime_peek(inode)); udf_time_to_disk_stamp(&efe->accessTime, inode->i_atime); udf_time_to_disk_stamp(&efe->modificationTime, inode->i_mtime); udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); - udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime); + udf_time_to_disk_stamp(&efe->attrTime, + inode_ctime_peek(inode)); memset(&(efe->impIdent), 0, sizeof(efe->impIdent)); strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); diff --git a/fs/udf/namei.c b/fs/udf/namei.c index a95579b043ab..50ee82a7d910 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -365,7 +365,7 @@ static int udf_add_nondir(struct dentry *dentry, struct inode *inode) *(__le32 *)((struct allocDescImpUse *)iter.fi.icb.impUse)->impUse = cpu_to_le32(iinfo->i_unique & 0x00000000FFFFFFFFUL); udf_fiiter_write_fi(&iter, NULL); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); udf_fiiter_release(&iter); udf_add_fid_counter(dir->i_sb, false, 1); @@ -471,7 +471,7 @@ static int udf_mkdir(struct mnt_idmap *idmap, struct inode *dir, udf_fiiter_release(&iter); udf_add_fid_counter(dir->i_sb, true, 1); inc_nlink(dir); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); d_instantiate_new(dentry, inode); @@ -523,8 +523,8 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) inode->i_size = 0; inode_dec_link_count(dir); udf_add_fid_counter(dir->i_sb, true, -1); - inode->i_ctime = dir->i_ctime = dir->i_mtime = - current_time(inode); + inode_ctime_set_current(inode); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); ret = 0; end_rmdir: @@ -555,11 +555,11 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) set_nlink(inode, 1); } udf_fiiter_delete_entry(&iter); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); inode_dec_link_count(inode); udf_add_fid_counter(dir->i_sb, false, -1); - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); ret = 0; end_unlink: udf_fiiter_release(&iter); @@ -746,9 +746,9 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, inc_nlink(inode); udf_add_fid_counter(dir->i_sb, false, 1); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); ihold(inode); d_instantiate(dentry, inode); @@ -833,7 +833,7 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); mark_inode_dirty(old_inode); /* @@ -861,13 +861,13 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, } if (new_inode) { - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); inode_dec_link_count(new_inode); udf_add_fid_counter(old_dir->i_sb, S_ISDIR(new_inode->i_mode), -1); } - old_dir->i_ctime = old_dir->i_mtime = current_time(old_dir); - new_dir->i_ctime = new_dir->i_mtime = current_time(new_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); mark_inode_dirty(old_dir); mark_inode_dirty(new_dir); From patchwork Wed Jun 21 14:46:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111111 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4442732vqr; Wed, 21 Jun 2023 08:19:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4AKZfZg/CXlt6wsdwHWvx5lWPYdlGUgbp8iJ4puuO/XSv9rqKilXKyfv9okROEtUCePkUM X-Received: by 2002:a05:6830:10c3:b0:6b4:695b:1930 with SMTP id z3-20020a05683010c300b006b4695b1930mr9246719oto.18.1687360788640; Wed, 21 Jun 2023 08:19:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360788; cv=none; d=google.com; s=arc-20160816; b=EOBlA22+y3lzq8W2auImtYQL+PF6ciB9T4JofLLU10wCixfF9HLbqaqKen5TXkbBOO T+5Ig9/SICk5KDF+GJ/iWqTwy8bMrVaKqhL3r5QOP2eFEVyiSNuVyNA0MXbeeTvWSvfJ CqdsriWV3MdjmBgmXU9hutLNZfv4FsRBHMB2oiYp4PKstkqmVHAlKNONZVPo056rigYw gVi53e/7WjNA/ice7dSW25mLMCYwVJod0gui/UGeDbYq5lNBipMhEutlkDkVc9bnd3gy a/L9skySezE36s+3+sHMWLI5EFUE+bsvCX9kvjWkZRBWFzXSYCjxOlSYLl9sI+0oncj9 vmCw== 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=9xUO5x4IZwFuLaqWpKlkNL51fQEptawi+NTMxsLGZKA=; b=yIQ8Io+LakZF5ryc224CN6LPwlbKbMaYecQsUSMJ9mgI9afrsbOBtw7idqcCTeqnqf ET4crqjdO0sWo/OENmgeM95F6hmXn3eo+u46X/22bQib+S5hcaQhktfdBzkXJEEXjrE7 p0fjDaFDaKzWfizOvOSjY8cbfniVKfVLAF5voOFz51vr4DtOsPbALX4wH/9uTJ4lY/Jo wPh1NeXTLVHZDIGzXomrQ7GoKDF1dZCYqtGp/T2dvkGO/p2DE0bEd9SBaLR+pZuIIFa0 AyhsQUdOygHqpRHveznfXTmwWbwlFZbIA4q2xpgBh8H9vBs4SiCUaSiBL0JxO4Q/kCTB iEKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=blC+PfP4; 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 m22-20020a637116000000b00553d42aec6fsi3978908pgc.430.2023.06.21.08.19.32; Wed, 21 Jun 2023 08:19:48 -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=blC+PfP4; 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 S233017AbjFUOyE (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232941AbjFUOxH (ORCPT ); Wed, 21 Jun 2023 10:53:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11EAB30E4 for ; Wed, 21 Jun 2023 07:49:36 -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 BC7B3612B7 for ; Wed, 21 Jun 2023 14:49:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3A32C433C8; Wed, 21 Jun 2023 14:49:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358974; bh=+guKJI0dr1zSxzHN9bTzMEKvLYnDM+NtgQTgRIMc65c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=blC+PfP4jXg6TdvGJNSV5geEw+cWTNg1vwgxJIcw0aoPhH+EjOEulIMpCQtnTbJyv pyxhdmraM2/owfebuO9zuEJ38n1BHD4FUB/d2ksLu6tDD7XRPB8fHd8o5WJ/oTXqVZ FfV+OpBHE06F+jB4zaz0H6BavKE2TbhitkArN65vp1GxKA/9Thv+z7/YrnIkyaYIFQ TDIlwKs6/BY5kQSDOXjFQB7/3yD4Vuwtug2uVKXDJSAG8Q6CoAs4dD1+u5bCf7qjxa k0X4Mu0D70o9S7G1syqZ+DE5wQTMOAvORnZtac01XNFkOlRtEH0o9+n+QdvuJgEDlc w8wKqSAtKb3Tg== From: Jeff Layton To: Christian Brauner , Evgeniy Dushistov Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 68/79] ufs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:21 -0400 Message-ID: <20230621144735.55953-67-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326026194951880?= X-GMAIL-MSGID: =?utf-8?q?1769326026194951880?= 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 --- fs/ufs/dir.c | 6 +++--- fs/ufs/ialloc.c | 2 +- fs/ufs/inode.c | 23 +++++++++++++---------- fs/ufs/namei.c | 8 ++++---- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index 379d75796a5c..0ccd32ab7ffc 100644 --- a/fs/ufs/dir.c +++ b/fs/ufs/dir.c @@ -107,7 +107,7 @@ void ufs_set_link(struct inode *dir, struct ufs_dir_entry *de, ufs_commit_chunk(page, pos, len); ufs_put_page(page); if (update_times) - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); ufs_handle_dirsync(dir); } @@ -397,7 +397,7 @@ int ufs_add_link(struct dentry *dentry, struct inode *inode) ufs_set_de_type(sb, de, inode->i_mode); ufs_commit_chunk(page, pos, rec_len); - dir->i_mtime = dir->i_ctime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); mark_inode_dirty(dir); err = ufs_handle_dirsync(dir); @@ -539,7 +539,7 @@ int ufs_delete_entry(struct inode *inode, struct ufs_dir_entry *dir, pde->d_reclen = cpu_to_fs16(sb, to - from); dir->d_ino = 0; ufs_commit_chunk(page, pos, to - from); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); err = ufs_handle_dirsync(inode); out: diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index 06bd84d555bd..3d64f7b3aba1 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c @@ -292,7 +292,7 @@ struct inode *ufs_new_inode(struct inode *dir, umode_t mode) inode_init_owner(&nop_mnt_idmap, inode, dir, mode); inode->i_blocks = 0; inode->i_generation = 0; - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode->i_atime = inode_ctime_set_current(inode); ufsi->i_flags = UFS_I(dir)->i_flags; ufsi->i_lastfrag = 0; ufsi->i_shadow = 0; diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index a4246c83a8cd..64242e1378d6 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -296,7 +296,7 @@ ufs_inode_getfrag(struct inode *inode, unsigned index, if (new) *new = 1; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (IS_SYNC(inode)) ufs_sync_inode (inode); mark_inode_dirty(inode); @@ -378,7 +378,7 @@ ufs_inode_getblock(struct inode *inode, u64 ind_block, mark_buffer_dirty(bh); if (IS_SYNC(inode)) sync_dirty_buffer(bh); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); mark_inode_dirty(inode); out: brelse (bh); @@ -580,11 +580,12 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode) inode->i_size = fs64_to_cpu(sb, ufs_inode->ui_size); inode->i_atime.tv_sec = (signed)fs32_to_cpu(sb, ufs_inode->ui_atime.tv_sec); - inode->i_ctime.tv_sec = (signed)fs32_to_cpu(sb, ufs_inode->ui_ctime.tv_sec); + inode_ctime_set_sec(inode, + (signed)fs32_to_cpu(sb, ufs_inode->ui_ctime.tv_sec)); inode->i_mtime.tv_sec = (signed)fs32_to_cpu(sb, ufs_inode->ui_mtime.tv_sec); inode->i_mtime.tv_nsec = 0; inode->i_atime.tv_nsec = 0; - inode->i_ctime.tv_nsec = 0; + inode_ctime_set_nsec(inode, 0); inode->i_blocks = fs32_to_cpu(sb, ufs_inode->ui_blocks); inode->i_generation = fs32_to_cpu(sb, ufs_inode->ui_gen); ufsi->i_flags = fs32_to_cpu(sb, ufs_inode->ui_flags); @@ -626,10 +627,10 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode) inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size); inode->i_atime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_atime); - inode->i_ctime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_ctime); + inode_ctime_set_sec(inode, fs64_to_cpu(sb, ufs2_inode->ui_ctime)); inode->i_mtime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_mtime); inode->i_atime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_atimensec); - inode->i_ctime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_ctimensec); + inode_ctime_set_nsec(inode, fs32_to_cpu(sb, ufs2_inode->ui_ctimensec)); inode->i_mtime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_mtimensec); inode->i_blocks = fs64_to_cpu(sb, ufs2_inode->ui_blocks); inode->i_generation = fs32_to_cpu(sb, ufs2_inode->ui_gen); @@ -726,7 +727,8 @@ static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode) ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); ufs_inode->ui_atime.tv_sec = cpu_to_fs32(sb, inode->i_atime.tv_sec); ufs_inode->ui_atime.tv_usec = 0; - ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, inode->i_ctime.tv_sec); + ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, + inode_ctime_peek(inode).tv_sec); ufs_inode->ui_ctime.tv_usec = 0; ufs_inode->ui_mtime.tv_sec = cpu_to_fs32(sb, inode->i_mtime.tv_sec); ufs_inode->ui_mtime.tv_usec = 0; @@ -770,8 +772,9 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode) ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); ufs_inode->ui_atime = cpu_to_fs64(sb, inode->i_atime.tv_sec); ufs_inode->ui_atimensec = cpu_to_fs32(sb, inode->i_atime.tv_nsec); - ufs_inode->ui_ctime = cpu_to_fs64(sb, inode->i_ctime.tv_sec); - ufs_inode->ui_ctimensec = cpu_to_fs32(sb, inode->i_ctime.tv_nsec); + ufs_inode->ui_ctime = cpu_to_fs64(sb, inode_ctime_peek(inode).tv_sec); + ufs_inode->ui_ctimensec = cpu_to_fs32(sb, + inode_ctime_peek(inode).tv_nsec); ufs_inode->ui_mtime = cpu_to_fs64(sb, inode->i_mtime.tv_sec); ufs_inode->ui_mtimensec = cpu_to_fs32(sb, inode->i_mtime.tv_nsec); @@ -1205,7 +1208,7 @@ static int ufs_truncate(struct inode *inode, loff_t size) truncate_setsize(inode, size); ufs_truncate_blocks(inode); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); mark_inode_dirty(inode); out: UFSD("EXIT: err %d\n", err); diff --git a/fs/ufs/namei.c b/fs/ufs/namei.c index 36154b5aca6d..d3f69e3c6965 100644 --- a/fs/ufs/namei.c +++ b/fs/ufs/namei.c @@ -153,7 +153,7 @@ static int ufs_link (struct dentry * old_dentry, struct inode * dir, struct inode *inode = d_inode(old_dentry); int error; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_link_count(inode); ihold(inode); @@ -220,7 +220,7 @@ static int ufs_unlink(struct inode *dir, struct dentry *dentry) if (err) goto out; - inode->i_ctime = dir->i_ctime; + inode_ctime_set(inode, inode_ctime_peek(dir)); inode_dec_link_count(inode); err = 0; out: @@ -282,7 +282,7 @@ static int ufs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (!new_de) goto out_dir; ufs_set_link(new_dir, new_de, new_page, old_inode, 1); - new_inode->i_ctime = current_time(new_inode); + inode_ctime_set_current(new_inode); if (dir_de) drop_nlink(new_inode); inode_dec_link_count(new_inode); @@ -298,7 +298,7 @@ static int ufs_rename(struct mnt_idmap *idmap, struct inode *old_dir, * Like most other Unix systems, set the ctime for inodes on a * rename. */ - old_inode->i_ctime = current_time(old_inode); + inode_ctime_set_current(old_inode); ufs_delete_entry(old_dir, old_de, old_page); mark_inode_dirty(old_inode); From patchwork Wed Jun 21 14:46:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111119 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4444791vqr; Wed, 21 Jun 2023 08:22:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4RuTe7tjXN7u7r6ji5VYNu2KE2hBTwDkGejx45Cd2iVc5s4eEU6WE55v8IpZ120hdoQuZ7 X-Received: by 2002:a05:6a00:15c5:b0:66a:458b:7d43 with SMTP id o5-20020a056a0015c500b0066a458b7d43mr1610748pfu.31.1687360973863; Wed, 21 Jun 2023 08:22:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360973; cv=none; d=google.com; s=arc-20160816; b=KKe19HNGZDIVdcSnPcNkn72Aq3t7/+ppe/puqhFnBEp0QmAXC1nCpFM9holFX6EXPx USMsu6+Mts8m3uBRZH435sOvzuxHfbJlaTlWCVkzs/i5oHY85SOTLFgzA2Z7sMYGtoTl PXT9pd172UJDHJeCoUaCSKW0DOvvsfAtPUU+qwzr00vh89d9nt9r3FxySXTA+rWJg9kr hQ88aI1sMg7iBSgbom2X/siNpdFyAoC2/iK+YxcRFxNOjNul6VLUngKZFSO1TAvzHX2r E96ZVP1DXhwaIi7Dv20fEY9AL/Ys5AbLSEPl4lawBGsJd8G/6pbpwFR4zuQrbgqFoxS8 OmCQ== 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=BFTo+rUxUDE0zK/8Q+tDed3oPAS2BQmiJljczLSRXxY=; b=TxUgb8MJ6yieZfStSj6yThxzAsOi19gFCK57cGOmoRs889iyVM57LZ5O/4RNacYiGk uxkzrn4IpH+idWEHXmDwOGTFvBlrL6ytivqtHol1J6UtMyzr5eLSLzMDUdkkHRd7qmUi A+jFGo1ZpKLbXuwgzDZxcZaa5/pt8forWsCZzg9sQc0rQWhkj9MvyNYrcydBu8iUiNNB ib57TwsB28n2H7pHit1O0Q0IjSz+/9CXlyLy0Qx6u4aCSn1fUXexUS+l/j64f1LOmGl2 Bwgt0hizQI8gQsnhG3AevDFqTziLQnMQguOAobq6D2zZqWYUrJRVDcR1I7WafwolJo/v EL2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q118R/CD"; 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 c192-20020a621cc9000000b006683174a49csi4363610pfc.198.2023.06.21.08.22.40; Wed, 21 Jun 2023 08:22:53 -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="q118R/CD"; 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 S233028AbjFUOyJ (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbjFUOxJ (ORCPT ); Wed, 21 Jun 2023 10:53:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 712811FFD; Wed, 21 Jun 2023 07:49:40 -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 225B8615A1; Wed, 21 Jun 2023 14:49:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E31FEC433C0; Wed, 21 Jun 2023 14:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358975; bh=E/Jd9jiPwA48oKoLtHMJRqaHIzPdYPGdOmDdE++Vw8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q118R/CDXJw4LjNWDJjOrkJnSqXZ3ePdF6AixmhQ+bB1hUGtfnT5XYT7popYsEg7b mDoPxY/jKYIPDA58H7qZP0p6oj6KoslICfyfoHpKhk0NXhMWpEAAKuLFJqy6FZbrl2 wyvD7nRU1cvZY/5CfHRjD9wrskAXtWtIJA8HWbCKcA5WU/2FbGQcQhudtvCe3YLyJ8 6dM3kRVscRPjPvMPuwtFynX+4DOmjULhZEfBM4alSLCZxa7oHn20xZNkzYOy/TFmaT 5dIVRHltMPv5YsmDXPkfqzTQGPz0qDdmP8MyiVHeCajCGUy5/IBDhPio83k+9A3jwe Zar9kgCjROxHQ== From: Jeff Layton To: Christian Brauner , Hans de Goede Cc: Al Viro , Jan Kara , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 69/79] vboxsf: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:22 -0400 Message-ID: <20230621144735.55953-68-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326220794333194?= X-GMAIL-MSGID: =?utf-8?q?1769326220794333194?= 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 --- fs/vboxsf/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c index dd0ae1188e87..a76dc1ec10f8 100644 --- a/fs/vboxsf/utils.c +++ b/fs/vboxsf/utils.c @@ -128,8 +128,8 @@ int vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode, inode->i_atime = ns_to_timespec64( info->access_time.ns_relative_to_unix_epoch); - inode->i_ctime = ns_to_timespec64( - info->change_time.ns_relative_to_unix_epoch); + inode_ctime_set(inode, + ns_to_timespec64(info->change_time.ns_relative_to_unix_epoch)); inode->i_mtime = ns_to_timespec64( info->modification_time.ns_relative_to_unix_epoch); return 0; From patchwork Wed Jun 21 14:46:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111148 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4475146vqr; Wed, 21 Jun 2023 09:07:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64tcDc36QZeYvptOtiZ5ZsFzMF080r0GMmphfgP+iHX7wIy4bJSTs49xMvelFpa7qF3NxM X-Received: by 2002:a17:902:c113:b0:1b1:d0b2:b9b3 with SMTP id 19-20020a170902c11300b001b1d0b2b9b3mr16498525pli.23.1687363642179; Wed, 21 Jun 2023 09:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363642; cv=none; d=google.com; s=arc-20160816; b=R9xkpLNY8ZEm52x9etzZ80QXKD/sSHe3EuMzz+oSwCkiWIl9QRebjm6TblI92693Gj YFipaXTh+X8MXQedp78IDolXiWcVQ3i0GjSvji07v/d7jpXyfM4Ni4HDeodAEuBRq0XJ dajOHPtnaipqqi4NbGEApUPlGfaO27QzCbBSsfrKUIIHfI+1plo/Kf7C89OCPWzD3Q3s rzS2WtjRizYU07g9zkmeyj/1ijD5SaagqdcciX2AouE2x+mii6+3A4ydKGrnQXZhTI0i R9dh+OOP8hoXmiO2sQ6mIYnSR2mfHUuB9e7Qltv66cb5buT67VTWv+FbNLWODCAgGKvO 3c6Q== 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=E1s8B9v3YvX+dHxi1AulzKJHWQcG7lFzGcM7DVDfomY=; b=dvyWQ7Y1K1M16ThWB/kL9DOIvk4598fSvDgsj5QTfTz6BXbZBKHByyP6gjvOxZmudQ GOg2eLaW6vPTBBkp+AX+XavluJIMNCKF3oyhQ36QKSMV6OX3o2JCFtpr9BAflOb3MGA2 QZzSH1m2rTAZbx7t/vxX0cg2AizyuLGkr9carxtlYDbxbAYHIEY0Z0EoAVBztAPz3Vpy bqwWXw7+O8CIYmuGaP2plBSEW9L+M2s25v1TvjGTSv/tfmOa61pyEZ370fS0C17TgMpb Bxa2JxxfqGtfxdXjwQUs+MwpPeQF0NCPnvjzvZ5+DshVSJsvm9eBbw349HZeX6uIlII0 1rgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Om1zaprH; 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 m14-20020a170902db0e00b001b3f6d89579si4568620plx.513.2023.06.21.09.07.08; Wed, 21 Jun 2023 09:07:22 -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=Om1zaprH; 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 S233041AbjFUOyQ (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232966AbjFUOxP (ORCPT ); Wed, 21 Jun 2023 10:53:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36C8530EA; Wed, 21 Jun 2023 07:49:43 -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 89CD6615A8; Wed, 21 Jun 2023 14:49:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AC8DC433C0; Wed, 21 Jun 2023 14:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358978; bh=kW7QejN6cAdGFdYK6FmuoXUQCFABRtiU/bPOzqJ3sQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Om1zaprHKqahWUV9/Gb4pL1uWao/LoM18XQ2soYV0p9NkjgIzsSq7CfX8a1ZMAqYv xe7Vcu5fyXW8Y9LONV/Cv5fVd7ofyPQvktf428PNCF2a3qE/jn603o3s2EbDZlSwI8 LaDgkwQ+XQeT5mV3zebQF5XE/3ry5+qgLF603YIx5Mi1YyELbbRLUZ4i5zdyOm8OYH wVkKKsC/4v85K2CJ1z6bWfdS02qTFkrUkB2EMfmS5mGiEke8ru92/xonjM3Vv+Xxn4 1sIwQiQfV22hJODRuL1stvtmeLBTlcdLn1XHGxsuB1SwyEcswXLMYWp5LQ7uhTW3pK 6+zalzUCFnwyQ== From: Jeff Layton To: Christian Brauner , "Darrick J. Wong" Cc: Al Viro , Jan Kara , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 70/79] xfs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:23 -0400 Message-ID: <20230621144735.55953-69-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769329018586811043?= X-GMAIL-MSGID: =?utf-8?q?1769329018586811043?= 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 --- fs/xfs/libxfs/xfs_inode_buf.c | 4 ++-- fs/xfs/libxfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_acl.c | 2 +- fs/xfs/xfs_bmap_util.c | 6 ++++-- fs/xfs/xfs_inode.c | 2 +- fs/xfs/xfs_inode_item.c | 2 +- fs/xfs/xfs_iops.c | 4 ++-- fs/xfs/xfs_itable.c | 4 ++-- 8 files changed, 14 insertions(+), 12 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index 758aacd8166b..d5c1d3c86257 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -222,7 +222,7 @@ xfs_inode_from_disk( */ inode->i_atime = xfs_inode_from_disk_ts(from, from->di_atime); inode->i_mtime = xfs_inode_from_disk_ts(from, from->di_mtime); - inode->i_ctime = xfs_inode_from_disk_ts(from, from->di_ctime); + inode_ctime_set(inode, xfs_inode_from_disk_ts(from, from->di_ctime)); ip->i_disk_size = be64_to_cpu(from->di_size); ip->i_nblocks = be64_to_cpu(from->di_nblocks); @@ -316,7 +316,7 @@ xfs_inode_to_disk( to->di_atime = xfs_inode_to_disk_ts(ip, inode->i_atime); to->di_mtime = xfs_inode_to_disk_ts(ip, inode->i_mtime); - to->di_ctime = xfs_inode_to_disk_ts(ip, inode->i_ctime); + to->di_ctime = xfs_inode_to_disk_ts(ip, inode_ctime_peek(inode)); to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_gen = cpu_to_be32(inode->i_generation); to->di_mode = cpu_to_be16(inode->i_mode); diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c index cb4796b6e693..f924e81530be 100644 --- a/fs/xfs/libxfs/xfs_trans_inode.c +++ b/fs/xfs/libxfs/xfs_trans_inode.c @@ -67,7 +67,7 @@ xfs_trans_ichgtime( if (flags & XFS_ICHGTIME_MOD) inode->i_mtime = tv; if (flags & XFS_ICHGTIME_CHG) - inode->i_ctime = tv; + inode_ctime_set(inode, tv); if (flags & XFS_ICHGTIME_CREATE) ip->i_crtime = tv; } diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index 791db7d9c849..75f17d2bb97c 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -233,7 +233,7 @@ xfs_acl_set_mode( xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); inode->i_mode = mode; - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); if (xfs_has_wsync(mp)) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index fbb675563208..0d4c141c4413 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1644,6 +1644,7 @@ xfs_swap_extents( uint64_t f; int resblks = 0; unsigned int flags = 0; + struct timespec64 ctime; /* * Lock the inodes against other IO, page faults and truncate to @@ -1756,8 +1757,9 @@ xfs_swap_extents( * process that the file was not changed out from * under it. */ - if ((sbp->bs_ctime.tv_sec != VFS_I(ip)->i_ctime.tv_sec) || - (sbp->bs_ctime.tv_nsec != VFS_I(ip)->i_ctime.tv_nsec) || + ctime = inode_ctime_peek(VFS_I(ip)); + if ((sbp->bs_ctime.tv_sec != ctime.tv_sec) || + (sbp->bs_ctime.tv_nsec != ctime.tv_nsec) || (sbp->bs_mtime.tv_sec != VFS_I(ip)->i_mtime.tv_sec) || (sbp->bs_mtime.tv_nsec != VFS_I(ip)->i_mtime.tv_nsec)) { error = -EBUSY; diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 9e62cc500140..763d6c95c56d 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -846,7 +846,7 @@ xfs_init_new_inode( tv = current_time(inode); inode->i_mtime = tv; inode->i_atime = tv; - inode->i_ctime = tv; + inode_ctime_set(inode, tv); ip->i_extsize = 0; ip->i_diflags = 0; diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 91c847a84e10..116038163098 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -528,7 +528,7 @@ xfs_inode_to_log_dinode( memset(to->di_pad3, 0, sizeof(to->di_pad3)); to->di_atime = xfs_inode_to_log_dinode_ts(ip, inode->i_atime); to->di_mtime = xfs_inode_to_log_dinode_ts(ip, inode->i_mtime); - to->di_ctime = xfs_inode_to_log_dinode_ts(ip, inode->i_ctime); + to->di_ctime = xfs_inode_to_log_dinode_ts(ip, inode_ctime_peek(inode)); to->di_nlink = inode->i_nlink; to->di_gen = inode->i_generation; to->di_mode = inode->i_mode; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 24718adb3c16..4096c4f86ef7 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -574,7 +574,7 @@ xfs_vn_getattr( stat->ino = ip->i_ino; stat->atime = inode->i_atime; stat->mtime = inode->i_mtime; - stat->ctime = inode->i_ctime; + stat->ctime = inode_ctime_peek(inode); stat->blocks = XFS_FSB_TO_BB(mp, ip->i_nblocks + ip->i_delayed_blks); if (xfs_has_v3inodes(mp)) { @@ -1055,7 +1055,7 @@ xfs_vn_update_time( xfs_ilock(ip, XFS_ILOCK_EXCL); if (flags & S_CTIME) - inode->i_ctime = *now; + inode_ctime_set(inode, *now); if (flags & S_MTIME) inode->i_mtime = *now; if (flags & S_ATIME) diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index f225413a993c..75b07eed0602 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -100,8 +100,8 @@ xfs_bulkstat_one_int( buf->bs_atime_nsec = inode->i_atime.tv_nsec; buf->bs_mtime = inode->i_mtime.tv_sec; buf->bs_mtime_nsec = inode->i_mtime.tv_nsec; - buf->bs_ctime = inode->i_ctime.tv_sec; - buf->bs_ctime_nsec = inode->i_ctime.tv_nsec; + buf->bs_ctime = inode_ctime_peek(inode).tv_sec; + buf->bs_ctime_nsec = inode_ctime_peek(inode).tv_nsec; buf->bs_gen = inode->i_generation; buf->bs_mode = inode->i_mode; From patchwork Wed Jun 21 14:46:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111155 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4479412vqr; Wed, 21 Jun 2023 09:12:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5MLBqIC/YUVa7NSFewDPSGfjXfB3wu3tdU0nJsiOS8kjWEaa/L8CkSc4IDHdzQORRge/5m X-Received: by 2002:a05:6a20:12c7:b0:118:384f:89bc with SMTP id v7-20020a056a2012c700b00118384f89bcmr19719006pzg.27.1687363950248; Wed, 21 Jun 2023 09:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363950; cv=none; d=google.com; s=arc-20160816; b=fl4Uj2SM3E4OvMvX2Iu8/AaDygX1CG2go3OkizC2kSx2sGOGZVAB/mVPja1mpv7ZqM i2Hj0/JqPzaBr8qEe7cEnujAqbPvonYLxZtJEK84jqbhLHHa9pBs37lcGvW2d3vTV++C KOCwSGr5jGEs+5PTbtb4GUKdh+yopuAuSas0fEHUPxTy8mUisNPbPFs8XvigggKxone2 pPpHJqkSee6qaThOepp27ki3yKC2ZcaAxGtDSBf/+PyTah7fSn/fabp77ACPgER140T4 A1zikveWAOgumc+SM6i26zCrpK8pRiYeDZxvEFo+eGWyUqM0rjX030MXB9AuakLw4uhP VLMA== 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=rjyv/ZfLH/+j9nbO1xqaYK0MxAV8TyMP3hIYgtwqIb0=; b=PY4hjDG8eOgxZLhiEha6ITfJSoRuZwRfGHC3HfF5CPfC7Fb/AnhRWkf3ZJxDHLrDuU /91MFcg97pGLxvLy6lHdMZSzAaBKO1XhKyflznlAF+Fsz1NiWbZ2eluofA7nUDLkfpeH bPRh2v3eiAacNWw2aKwDce9oensIGn+o3a4i05MWq2sn9BVAa1Ll57pF0vInuw4wW5qL 6jXhGLvaZX4XAKv0nu12C3e5XMSeglNlRq133Ss6HbiwskSOcnFVAwIS4CQDXhbi+Urf pvj1f91NLtuXWxjTyLvM3P9+RYh2Uqq9NonOSmBILnnG56T4SVdLgaH5PY1RIir5Xph5 K6tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="c/Kn/Xvv"; 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 bk13-20020a056a02028d00b005539d3ab914si1317089pgb.694.2023.06.21.09.12.17; Wed, 21 Jun 2023 09:12:30 -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="c/Kn/Xvv"; 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 S233052AbjFUOyV (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232713AbjFUOxY (ORCPT ); Wed, 21 Jun 2023 10:53:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 002B930F5; Wed, 21 Jun 2023 07:49:44 -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 1502B615B9; Wed, 21 Jun 2023 14:49:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B365BC433C8; Wed, 21 Jun 2023 14:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358979; bh=DSeTksfqnRw4FPVrRQ9ashItXalQw8m2rHVJuaKZBs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c/Kn/XvvVsITo8FQUfTG+bY74x6zwNwFkqyhsvhEA1OTNe00SnnVIep87P4pGse12 fhelK49W869TtAV6JGbsapApb8i2ZcNUZ7goPFtvhOEej5uUpRxCe+LVI6tQER46g9 NbihuwRsHvso4Qas5urVBeYh/aOWEBWzsl+EnbJuGot8oolfmboWUwM+zGAVFwx2Py Ss711xinjZrvbBC1s2qJ6PNWq1WX3jzlsg1Z9Te0Kx2iYn+ry/pGXN7gZMgsMdQ5Hz YpFDwc6ycBJxSsp5zocIXQyw8Ec8Ssk1TFWtmUUK7MNvbZ1yqcQtCBkVG/eKdEyMxt BBnxPy+p12uQg== 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 71/79] zonefs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:24 -0400 Message-ID: <20230621144735.55953-70-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769329341587004813?= X-GMAIL-MSGID: =?utf-8?q?1769329341587004813?= 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: Damien Le Moal --- 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..75be0e039ccf 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_ctime_peek(dir); + inode_ctime_set(inode, inode->i_mtime); 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_ctime_peek(root); + inode_ctime_set(inode, inode->i_mtime); 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_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_op = &zonefs_dir_inode_operations; inode->i_fop = &zonefs_dir_operations; inode->i_size = 2; From patchwork Wed Jun 21 14:46:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111100 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4438679vqr; Wed, 21 Jun 2023 08:14:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6qrqT9XhnDvV0mrVjViJMRVS641JoYDKReqUw5ADFLG5r/86jZbpZ665zj/0Y5X7Qsv25y X-Received: by 2002:a05:6830:13c4:b0:6b2:9462:570e with SMTP id e4-20020a05683013c400b006b29462570emr9673504otq.22.1687360458386; Wed, 21 Jun 2023 08:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360458; cv=none; d=google.com; s=arc-20160816; b=KwullabUpwwkp8RrZSpFC8/cbhB0amwDkjM8S0hLBycze4J05GFnRJ0O8g5hVmrRVC 21z3A3MutUbaoNswmyTtU4VATAhF00fLDN2zabwnMLt49R1/5g3a9ajcrO80Agq/pzFj xTSfSiyxjl8qTH72apDLSgkSaiksL9zXGf4asdWJvomhAnif1IcghuoXApVhVymbTp0+ UUEtgwfKcffKM4Vt8VhsZvbqRjowoO6csN6ZK3tyJDFhXqRqyt9hpq4KAwA8eRCjSwKl b7VhONCAoXRt6WWaIslTdawtdpj7vT+TSyozc7/YqBknces7/gsffAkPjrz+slQvwSzs o4jQ== 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=kDqIlGoEiPUqA66Bt4DEF3Ia6JIPoNE1/ou6TX6Tqeo=; b=XfvuBFqPlaicZLgpQ7ndcX7KZ13AayPoJllAoMCvnq9qpgztadwAf9vSGa8ywt8IqA dlZ5dyClvcwiw/P9I9zD2o2tBZu+TzuHIey3ydb2C3ibkw1fUFSurhS/PxNEQ9eJwdjy miYbJnvX1ktS4WlL3ti3AQmBuT0O+UZJQXguETfN2QV3u4q9AoUDjQhCsgIvrKcJYU27 MzoK0UzV4y/4M56QDKOnIeUUossf6eIuM8amKuNbDXTwdDGRT2CKn/uPnEsn5DuzXDuF iKjKJI/cmxXnTkf7J95cxrXnZ9MTGaCkd6Pmhc8B6sLKXkFH4wb4zKBQ0/o0xXay2GQq MBjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q7PEBlpa; 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 s23-20020a63af57000000b0053f25f2d32csi2194137pgo.840.2023.06.21.08.14.05; Wed, 21 Jun 2023 08:14:18 -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=q7PEBlpa; 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 S232286AbjFUOyi (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232905AbjFUOxo (ORCPT ); Wed, 21 Jun 2023 10:53:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C8162D7D for ; Wed, 21 Jun 2023 07:49:51 -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 4C7CB615BB for ; Wed, 21 Jun 2023 14:49:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46D73C433C8; Wed, 21 Jun 2023 14:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358980; bh=Cj2Q7NnXKWgbtOgOZOjzN49NX82O0+W8R1sITnlopBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q7PEBlpa2v4zDswyQTlXr4xmiS28PYWdfKb4kSXcqGAUyqdnjRrig/yGLvR4ZnBvb mRBUyf4Weoyqg/CifbdFZqp227MKHPxfiMMipRIOaKTSgB1cQLTdqvCELQgTTL2vZw C5hk0vmCfifRwye4Dq+A69Ydd2XNGOez7vopcPrnKeVXwfbZsb0/0kZuF8vSFhfJZM Dq6bh5jf7gtKb9zccuou+SfbHixHopfz6BZEizUZhIM91rsKai/xtMOas+rgbsZAUs xhjPHvRirKiE7g/VPvk2Vd3F5PK83y30jymjcA4bpLwyJ0Dal9Zc40eLtHCCzCQgmp vdV3zNweTpsNA== From: Jeff Layton To: Christian Brauner Cc: Al Viro , Jan Kara , linux-kernel@vger.kernel.org Subject: [PATCH 72/79] mqueue: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:25 -0400 Message-ID: <20230621144735.55953-71-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769325680039610794?= X-GMAIL-MSGID: =?utf-8?q?1769325680039610794?= 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 --- ipc/mqueue.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 71881bddad25..dd8564be3894 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c @@ -302,7 +302,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb, inode->i_mode = mode; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_mtime = inode->i_ctime = inode->i_atime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); if (S_ISREG(mode)) { struct mqueue_inode_info *info; @@ -596,7 +596,7 @@ static int mqueue_create_attr(struct dentry *dentry, umode_t mode, void *arg) put_ipc_ns(ipc_ns); dir->i_size += DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); + inode_ctime_set(dir, dir->i_mtime = dir->i_atime = current_time(dir)); d_instantiate(dentry, inode); dget(dentry); @@ -618,7 +618,7 @@ static int mqueue_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); + inode_ctime_set(dir, dir->i_mtime = dir->i_atime = current_time(dir)); dir->i_size -= DIRENT_SIZE; drop_nlink(inode); dput(dentry); @@ -656,7 +656,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, if (ret <= 0) return ret; - file_inode(filp)->i_atime = file_inode(filp)->i_ctime = current_time(file_inode(filp)); + file_inode(filp)->i_atime = inode_ctime_set_current(file_inode(filp)); return ret; } @@ -1162,8 +1162,7 @@ static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, goto out_unlock; __do_notify(info); } - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); } out_unlock: spin_unlock(&info->lock); @@ -1257,8 +1256,7 @@ static int do_mq_timedreceive(mqd_t mqdes, char __user *u_msg_ptr, msg_ptr = msg_get(info); - inode->i_atime = inode->i_mtime = inode->i_ctime = - current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); /* There is now free space in queue. */ pipelined_receive(&wake_q, info); @@ -1396,7 +1394,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) if (notification == NULL) { if (info->notify_owner == task_tgid(current)) { remove_notification(info); - inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_atime = inode_ctime_set_current(inode); } } else if (info->notify_owner != NULL) { ret = -EBUSY; @@ -1422,7 +1420,7 @@ static int do_mq_notify(mqd_t mqdes, const struct sigevent *notification) info->notify_owner = get_pid(task_tgid(current)); info->notify_user_ns = get_user_ns(current_user_ns()); - inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_atime = inode_ctime_set_current(inode); } spin_unlock(&info->lock); out_fput: @@ -1485,7 +1483,7 @@ static int do_mq_getsetattr(int mqdes, struct mq_attr *new, struct mq_attr *old) f.file->f_flags &= ~O_NONBLOCK; spin_unlock(&f.file->f_lock); - inode->i_atime = inode->i_ctime = current_time(inode); + inode->i_atime = inode_ctime_set_current(inode); } spin_unlock(&info->lock); From patchwork Wed Jun 21 14:46:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111132 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4463164vqr; Wed, 21 Jun 2023 08:51:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Y1yIUMkDiPVIpQCnep3oahiTrKI3mJIe3CDP+q9klTBnEMfkc+haEgQcK701jUVwQQ54D X-Received: by 2002:a17:90b:19d0:b0:25b:bd4d:bd18 with SMTP id nm16-20020a17090b19d000b0025bbd4dbd18mr12580163pjb.16.1687362667325; Wed, 21 Jun 2023 08:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687362667; cv=none; d=google.com; s=arc-20160816; b=gze7MO9RsEYLvoA7qYN6uEtJQDNpwNpw1VVJCzamJQ1Ue/JwLRjvAhkPUIQXJ7WtHu OJdjXuYswmCDAx08x9iHh1FRWh3SctSUHL13KA4Iei2FzgTdi8Sh4hQWI8WlZpoCRa9I 9/eQ1tIgUhxO+9xtmkybgrl/opPTxLNFCLlgwXvd9iRtgjvgTfX7AXaew9KshWaxd6yP zknU+imGzQOU+R7m41eY9dthwqXelwADuoBq5gmys3opmT3Gg840anBK9Wie0bcOzYS6 a8+mxq0nyr1tc/lmLgBXdeqwxIv/g9gN4tF9JnT9MPeWFSNj9NipfVfPv0x+Bln6gpsG 8S9Q== 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=T5QM2ZBDn1R5Dx0puDZylQs26n4su1yN3pZX2g9O4wY=; b=gompP8RZcIcd1dFZaJcJolFXg8OSERFzQM4cxOxyP5TsVXCjXzdpuaGTo+7TapC4rg a+o1cKV96qtBfTS41c1+wmih97gdtudKNwwl2JcrUi2kqhrOeg6YCcRqQTKAjQ7KnHnu mPUn3fNC26yg1IF8Ae7a5fPrWg6hDWKZZw299og52MaWtObrVvQIVDjZf6mmdAlwBpGn GOvA0+C6xaF5KU/qh3aAgDnwNuI9BjpVkpMbmpqMnTkceJGm7NncP36Ka2k6E84e1N1E hykhs0Hzpqj1/pLWjBN/gHUVE54GFT0eDytiDL2SELMxwDX4wr5Cr3Jq/2tz50MY0cRI ycOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="m+y2qDE/"; 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 nu18-20020a17090b1b1200b002569b9b4397si11185417pjb.47.2023.06.21.08.50.52; Wed, 21 Jun 2023 08:51: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="m+y2qDE/"; 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 S231578AbjFUOyl (ORCPT + 99 others); Wed, 21 Jun 2023 10:54:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbjFUOxr (ORCPT ); Wed, 21 Jun 2023 10:53:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71FDC2117 for ; Wed, 21 Jun 2023 07:49:55 -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 7094A61596 for ; Wed, 21 Jun 2023 14:49:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72641C433C0; Wed, 21 Jun 2023 14:49:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358982; bh=lRNOsnrBPUjv4L/g1gjVfCiRbZ+F6XeUXgjCMmQXIRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m+y2qDE/qDDLMWOZuIBh7Nvb9leyinmxQqHYG2BeojfL+wM+4CnM1cf0enDuIZlOM /Fi7rgJ2bO5MIABG0w2mXexG7aF80adZorF/IVP1jM1T3evqwveCtmEmQi4tin1Ec7 0z29faQTyUrBE9U/i5qcfE+xzp+o+JQbgu0vAnDbJ4tYGVJoJyqaSZeo/IT++hlbC+ kY9WWoiptHDbz4jG3pwHQt6fM/0AvWjBExdyIsOZD4Ay3VWwhVc9KeKHY6QGnvp+kM 9wcB9h/KEpgJymelKoVRiEirPZsLMweswuaSADmoWBH60OhjSgoQlSfIL+2xVfdeHV 33c+N8iUIT+vg== From: Jeff Layton To: Christian Brauner , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa Cc: Al Viro , Jan Kara , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 73/79] bpf: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:26 -0400 Message-ID: <20230621144735.55953-72-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 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?1769327995991506968?= X-GMAIL-MSGID: =?utf-8?q?1769327995991506968?= 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 --- kernel/bpf/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 4174f76133df..d4489bb761df 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -120,7 +120,7 @@ static struct inode *bpf_get_inode(struct super_block *sb, inode->i_ino = get_next_ino(); inode->i_atime = current_time(inode); inode->i_mtime = inode->i_atime; - inode->i_ctime = inode->i_atime; + inode_ctime_set(inode, inode->i_atime); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); @@ -149,7 +149,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode, dget(dentry); dir->i_mtime = current_time(dir); - dir->i_ctime = dir->i_mtime; + inode_ctime_set(dir, dir->i_mtime); } static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir, From patchwork Wed Jun 21 14:46:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4435635vqr; Wed, 21 Jun 2023 08:10:13 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6m/BDuzM0Z9ovXjiUJh/2UIH1rcfbpp9+9v+xfvjBq1UnX8XkGlRhRXX/dW5wbf2QBoJXC X-Received: by 2002:a05:6a21:3803:b0:123:9582:ea06 with SMTP id yi3-20020a056a21380300b001239582ea06mr286627pzb.10.1687360213616; Wed, 21 Jun 2023 08:10:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360213; cv=none; d=google.com; s=arc-20160816; b=dT9uDsuWZHXSlE46doW8RLe4erugcFxxbeCU9TJRWRO985oak5wC0bnqbu9yXYi0PC HTssMDDwwvr8fkZ4VR/L1My8LbDy5f6X6fb0zaGJ7RfwvYE9/07vajwTCVrFnWJAUX9s PNXzWUV3cSqcaH23e9avu8iPvM0VSnBtGEK26IukHlMTcOd7Fxa5mVluVFaAp/fLxKSD iE9bMKMPltgDAgaQuwO95xZ8MVA/4MOaYJJayzFdSjKkj3PkoviZ0RwGB70hAAOryEFy LMgPEM193xgNIwHs3Ut1zFlxc2T5+5b8DRjfbXEEg6Kag0UG+bUZm6hqi8LqEHKYlvMA BgYg== 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=3wI1FotU3VTqXLiliGTvn7irpD4LlKRhlI8DOB7eB8s=; b=sVuhsgYEsDcQ3+hbAMbs+fSMS+r6peev89wulQRR+A8z6Wh2KplxI7wT10JwQykmlT r9hSQ+RjDZJtvsnCR5YNE9tyMIZX10uvfnq8NsiZk+anA2WHkXBo3nUKatITo5d9uPSV Tq4moM+L10fbxgPwgRYkqo+IqZGKGqecu4KeqdMjuZYHbeE/OvsgVlbo9eC4oYcCRsH/ FkiiSm3KViBeTdRIIqnF5h0wgc6KyIse36FpRYw9mW2ycMMXqAZHkzENUGGButKIySqS 8RxlkBjm74T5gBkZlLPMAeSKTldu6tEt3mr/wayK4HHKuzqZ8HK1kYlTjfYSqHPkZBVn tpnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vFGsyrgq; 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 z128-20020a633386000000b0054ff8cce912si4307570pgz.281.2023.06.21.08.09.54; Wed, 21 Jun 2023 08:10:13 -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=vFGsyrgq; 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 S232376AbjFUO4D (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233000AbjFUOxz (ORCPT ); Wed, 21 Jun 2023 10:53:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA9292134 for ; Wed, 21 Jun 2023 07:50:02 -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 E8045615BE for ; Wed, 21 Jun 2023 14:49:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A48FEC433C8; Wed, 21 Jun 2023 14:49:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358984; bh=rf2ZGKofEWdIrdzCw9fnlqHLrcKo5aaZCkZqt6T8HY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFGsyrgqrZj9JG6n3lwXYoh17JzM5aGaXfMaXhu8JYQJbeWxMESNSVX+/Cy+0mIEb xrfuJbHf2/jnTyanOxmsNb+PW2TJ30MJEC0p4pb9QhJU+4THKGpleOax60RFFGyFPv gXpPqI6dtzGaGDQc/FjNC/nbT7F8IFwo4QT6uiADNbBG0gWtNm6k0eeMAbL7OrZa+o R7WJt7wWt/ylML88EArNa50Nm1t6aFjCxmjad+Dt6VkPqsEssRWfKj6X2i+1JHaNoO 0HSt7UeZhqnkvwXFmr/UrKldM1Ro0pFRnhO0s3L9gCxOVgpmOvB0Hq/L1O0eHfw5Ls sUhw8iaL9Izww== From: Jeff Layton To: Christian Brauner , Hugh Dickins , Andrew Morton Cc: Al Viro , Jan Kara , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 74/79] shmem: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:27 -0400 Message-ID: <20230621144735.55953-73-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 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?1769325423407854164?= X-GMAIL-MSGID: =?utf-8?q?1769325423407854164?= 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 --- mm/shmem.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 4752084720b2..4979cb3e37e5 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1064,7 +1064,7 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend, void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) { shmem_undo_range(inode, lstart, lend, false); - inode->i_ctime = inode->i_mtime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); inode_inc_iversion(inode); } EXPORT_SYMBOL_GPL(shmem_truncate_range); @@ -1161,9 +1161,9 @@ static int shmem_setattr(struct mnt_idmap *idmap, if (attr->ia_valid & ATTR_MODE) error = posix_acl_chmod(idmap, dentry, inode->i_mode); if (!error && update_ctime) { - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); if (update_mtime) - inode->i_mtime = inode->i_ctime; + inode->i_mtime = inode_ctime_peek(inode); inode_inc_iversion(inode); } return error; @@ -2389,7 +2389,7 @@ static struct inode *shmem_get_inode(struct mnt_idmap *idmap, struct super_block inode->i_ino = ino; inode_init_owner(idmap, inode, dir, mode); inode->i_blocks = 0; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); inode->i_generation = get_random_u32(); info = SHMEM_I(inode); memset(info, 0, (char *)inode - (char *)info); @@ -3101,7 +3101,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, error = 0; dir->i_size += BOGO_DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ @@ -3177,7 +3177,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr } dir->i_size += BOGO_DIRENT_SIZE; - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = inode_ctime_set_current(inode); + inode_ctime_set(dir, dir->i_mtime); inode_inc_iversion(dir); inc_nlink(inode); ihold(inode); /* New dentry reference */ @@ -3195,7 +3196,8 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry) shmem_free_inode(inode->i_sb); dir->i_size -= BOGO_DIRENT_SIZE; - inode->i_ctime = dir->i_ctime = dir->i_mtime = current_time(inode); + dir->i_mtime = inode_ctime_set_current(inode); + inode_ctime_set(dir, dir->i_mtime); inode_inc_iversion(dir); drop_nlink(inode); dput(dentry); /* Undo the count from "create" - this does all the work */ @@ -3283,9 +3285,9 @@ static int shmem_rename2(struct mnt_idmap *idmap, old_dir->i_size -= BOGO_DIRENT_SIZE; new_dir->i_size += BOGO_DIRENT_SIZE; - old_dir->i_ctime = old_dir->i_mtime = - new_dir->i_ctime = new_dir->i_mtime = - inode->i_ctime = current_time(old_dir); + old_dir->i_mtime = inode_ctime_set_current(old_dir); + new_dir->i_mtime = inode_ctime_set_current(new_dir); + inode_ctime_set_current(inode); inode_inc_iversion(old_dir); inode_inc_iversion(new_dir); return 0; @@ -3339,7 +3341,7 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, folio_put(folio); } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_ctime = dir->i_mtime = current_time(dir); + dir->i_mtime = inode_ctime_set_current(dir); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); @@ -3411,7 +3413,7 @@ static int shmem_fileattr_set(struct mnt_idmap *idmap, (fa->flags & SHMEM_FL_USER_MODIFIABLE); shmem_set_inode_flags(inode, info->fsflags); - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_iversion(inode); return 0; } @@ -3481,7 +3483,7 @@ static int shmem_xattr_handler_set(const struct xattr_handler *handler, name = xattr_full_name(handler, name); err = simple_xattr_set(&info->xattrs, name, value, size, flags, NULL); if (!err) { - inode->i_ctime = current_time(inode); + inode_ctime_set_current(inode); inode_inc_iversion(inode); } return err; From patchwork Wed Jun 21 14:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4464638vqr; Wed, 21 Jun 2023 08:53:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ozb5/HygpS8ToKSoWYk5PLLIGHlRDmE/6LyTfONwFYo+cOHAdy83/mVkJIx3DHMwzRl8j X-Received: by 2002:a05:6a00:1790:b0:66a:2ff1:def4 with SMTP id s16-20020a056a00179000b0066a2ff1def4mr4200247pfg.6.1687362811159; Wed, 21 Jun 2023 08:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687362811; cv=none; d=google.com; s=arc-20160816; b=aWDq/5c28nPygVyF9tlCUkaewjm/XOMmaS4UpQFkaJh9y4S9HAsZXMgFXMHKh/MgN3 H3EkyLNnsnTiSSqhBLwUwn0ywv8HIDx25nnugrPnx8tDjP4az1rWTDo/4c/+AHuCFol4 QAtbb4rJSuBM5/gPZCAkZbNjl5b4+KAhGSPRsi09KhDBVE8ezDcyR0x1e4rpb39aePp7 BR/bcjeYslv7K/u5BXF4Sn7TC8NbPMrEiOwQvF10pMolitJf5sFBJDOGQK19fXNbigR9 cvIsiLWWVXVbe6ACfM9e/hTE168HDH7fDbWhi2Wx2KJb+JKLKv4Ysd9AjANuct2F/bi4 Y02Q== 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=iL3It0vohEfdOFzywFQSP7VG9fgUzo7HsrxIUEjulXg=; b=JvinLnT/+4UrY/bxLHuxME+iWyDU5FS3ADm69DDOJKpjTmhvw1hUgjiAXCZfI1WDA3 D29Y15OHe53YPa4jwvfIk6FB5zy7FU2MZbJAqwkbZFJbFg5lJJx/bNQMWxm+LEZe9Jp1 coL6ROY3a8votfVVnz0SYaRrYwtDfVlMHKG/UVIQEQbQAUXxQkMPZFBTS/4Bq505Z3n7 TR5SZGuLuqrzNknQ3/79aYykW6TE09ioF7IZFhQ/ilr4ppdeJUGlomAuu/ooNqv07jFT Rg4DG1DTB9BxUf3jGqyeVaELnJ5Y9dxKzNUP8qK30J5WtZwFxItcwI+ipzUj0ARL/AvP 4Fig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FB1sp0Nf; 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 y79-20020a626452000000b00666e1259fa4si3370259pfb.141.2023.06.21.08.53.17; Wed, 21 Jun 2023 08:53:31 -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=FB1sp0Nf; 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 S232906AbjFUO4L (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232924AbjFUOx5 (ORCPT ); Wed, 21 Jun 2023 10:53:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D292C213B; Wed, 21 Jun 2023 07:50:03 -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 30BCA6159A; Wed, 21 Jun 2023 14:49:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16B17C433CB; Wed, 21 Jun 2023 14:49:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358986; bh=JWwO7OkTyfMAIqtGyDqlNs9vuPyKQiBHWzkORRbijSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FB1sp0NfdT/B9tJvd6nGwqdwNbxS/X98uvKraj0xUIQbNd4eKX7MimzafkP8GllFY /xdxmP9ablfypq7dNXDLF/nSx+w3X4UB1jbilkmzJne64MOd+t863D2YwksVf/tEvC +Me7UzIgjYJvy7JkOK/mbcD23U2D5+PYVnAshJHpDSgDiKlxYoy/91vhMeR+vz4pgz xKWACMDfdYSQUZRgJlsf8NI2rj4yozHi18lqw9H/Y39rBkl1msBZ5Qm/RVy4euhCVU QkrLmEl/Z/x3r2aFiUUqnQV2dmAe6P+qZaSafXC5Ve2QVeyVF0KuuCBqEGtmqYnbpT CVMXUXji6sUPQ== From: Jeff Layton To: Christian Brauner , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Al Viro , Jan Kara , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 75/79] rpc_pipefs: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:28 -0400 Message-ID: <20230621144735.55953-74-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769328146903476003?= X-GMAIL-MSGID: =?utf-8?q?1769328146903476003?= 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 --- net/sunrpc/rpc_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 0b6034fab9ab..aa382e7ae982 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -472,7 +472,7 @@ rpc_get_inode(struct super_block *sb, umode_t mode) return NULL; inode->i_ino = get_next_ino(); 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; From patchwork Wed Jun 21 14:46:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111140 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4468333vqr; Wed, 21 Jun 2023 09:00:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7MLefgjoOnf8s7qcVh9Re1mpXo82EsAZsCBOoQNah9/6OHZk4Zo0EQIsczMVnmTJtHj+pA X-Received: by 2002:aa7:8894:0:b0:665:bee0:4077 with SMTP id z20-20020aa78894000000b00665bee04077mr19712875pfe.32.1687363201184; Wed, 21 Jun 2023 09:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687363201; cv=none; d=google.com; s=arc-20160816; b=tUo8VE1nHJ2/yFyNeGS4GRLVNyIfCjegWKo9gzF7NIDuctFIbeUpiyW9rw/ep3rOAa Gv7T3/GVYYj0pNokTE/WbkH88+z5SgtmRLsZnCgxlhzhJy/atkF6x18mFexfGgrrVzMO 3UE3mwMVag5hMVfyJcyJuhhIYfME3vaL/AkWgQbK/9Sx0qJRpZCSmmKkCxQWLg5xHqFO XEnxm3hD10wcisYNQEnKy1t1nrfNMJw7mEsgMJ3K/l5J4m9OT8bSsHuO9SK8WONpBsHV rmFNyLGKODSeoWh+xLiz3RJj4IXpAMWwDmCxZepYOIV5hHVYx/cHjHh7DxuNvJTVg/Ax /nWQ== 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=eEPynznOBStowW1iZ2WdGSNpc1fSTULcdqtdqV1W2yw=; b=ql3OJgWamjKZzlDAu6R2MmcWPmoXk86Zbj0e6w4NkRaCtRIwItt5NIrdmia7Bj3fsF /1T2MGEn/soQj/oNFruLjPl55EQkYZUOhKoGnlU2AvnTQf/RpAT7zvUBn4AbsMkxjDka oVdHaUiewkdOYgv7YUg2ec+09oN54Nq6KCz+8afIZ6DgFNdyqBweumQD1LMyhGu0kDZj KgKa/h9HaPe0gEbmTjSWlM5+1lt93pDerhoW+Q0pt1/Ifdb9pzlnDt7zTEIO6PYln0v1 SIBamJaHJkBDrbGzPyFoqMKdMZjbM8CdfiX0dhCt87wl4zFV2jB2F/1sCoZ6gzsfGkii hYnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mb+pna0L; 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 z11-20020aa7958b000000b00666709f92d7si4215556pfj.225.2023.06.21.08.59.48; Wed, 21 Jun 2023 09:00:01 -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=Mb+pna0L; 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 S229704AbjFUO4I (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbjFUOx4 (ORCPT ); Wed, 21 Jun 2023 10:53:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29DA6213C; Wed, 21 Jun 2023 07:50:04 -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 1CFF1615C3; Wed, 21 Jun 2023 14:49:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86FB8C433C0; Wed, 21 Jun 2023 14:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358988; bh=9L7A8/A6LFjcabA1gjfSYeoHiy7VK9nCxB9xPTQPT0U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mb+pna0LDACr8Gs3OHfYiWOfyO9fFLyB+1ed0LtE3cjVeob0Z64b+z1tNq3zJkQXL 1EKb/gVprD6ec3dfcMjIYJae+Njg1eVQEWSl5Go1mVLO+v1M2+/QRs05KhFeVF6ztA yHu9xCiDpzJSRavYfm7uvpx4F/yxPiNGCjXRvrSg6lBgRYdmcoJOj93+EtUXFvUrqg gEeJXmg/eqMCx+26qe136b56eVBKAEucaBbW7Xf+9ZJ7CkVQ5u7Su+XdTjTyK6Cl0r SzDe1HIsCf68e2wHRAzrsFvmlwEN/f4tG+m+KDQq6eth67GIYWvFyA51t11YY4tpxa 3716NO77xi/Zw== From: Jeff Layton To: Christian Brauner , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 76/79] apparmor: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:29 -0400 Message-ID: <20230621144735.55953-75-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769328556019520757?= X-GMAIL-MSGID: =?utf-8?q?1769328556019520757?= 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: John Johansen --- security/apparmor/apparmorfs.c | 6 +++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index 3d0d370d6ffd..8c72a94dd9e3 100644 --- a/security/apparmor/apparmorfs.c +++ b/security/apparmor/apparmorfs.c @@ -226,7 +226,7 @@ static int __aafs_setup_d_inode(struct inode *dir, struct dentry *dentry, inode->i_ino = get_next_ino(); 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); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,7 @@ void __aafs_profile_migrate_dents(struct aa_profile *old, if (new->dents[i]) { struct inode *inode = d_inode(new->dents[i]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); } old->dents[i] = NULL; } @@ -2546,7 +2546,7 @@ static int aa_mk_null_file(struct dentry *parent) inode->i_ino = get_next_ino(); inode->i_mode = S_IFCHR | S_IRUGO | S_IWUGO; - inode->i_atime = inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_atime = inode->i_mtime = inode_ctime_set_current(inode); init_special_inode(inode, S_IFCHR | S_IRUGO | S_IWUGO, MKDEV(MEM_MAJOR, 3)); d_instantiate(dentry, inode); diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index 4c188a44d65c..334d69b118a9 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -89,10 +89,10 @@ void __aa_loaddata_update(struct aa_loaddata *data, long revision) struct inode *inode; inode = d_inode(data->dents[AAFS_LOADDATA_DIR]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode->i_ctime = current_time(inode); + inode->i_mtime = inode_ctime_set_current(inode); } } From patchwork Wed Jun 21 14:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111157 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4480350vqr; Wed, 21 Jun 2023 09:13:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Mhwih4nD61HkfEtJSctWnGEBKpqTWwalgQ7pZiLlKScPeSsL+L2ERSpIZurgIMzklEhvJ X-Received: by 2002:a05:6808:19a4:b0:39e:e07b:6749 with SMTP id bj36-20020a05680819a400b0039ee07b6749mr9125302oib.14.1687364028299; Wed, 21 Jun 2023 09:13:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687364028; cv=none; d=google.com; s=arc-20160816; b=xFjeJldTa9tJHQLfc9/X2uztS6rzFmTRdSZqvWluRDKDU4vesehh/Kgz+rJxBUA5f5 WvszylXl8Ed5HFYiHupcu0Cssetcwl3tiKnmAex+MJxwyBn6Na9kGCAoafkYkUHfZUwt CLvTFChYFNb0C4YsNbsH54mIqKrfgW/PUVbgMUfVO8I8d1o4h7/Fo10WaF/S3Trdy+8x 6A+4+LBEmT3PBzjCAbf482Az+MNuoNp+ztLpnwEGvka9l50tlMQNIRCNkQHMapqi0Dtn usWXC3SjaC/vVEHQxw4wX5RI7WJdVOixq3XbwlIN74QfNR9fOEwxFN6N5+07nwJUZGqD RCXg== 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=SyTq3sboFz/DQP4/scHfUaQUvhuyt4d/ImWcvZd+seo=; b=j4wtdDR1w1mgpF58s7/39+/cJsgUra7xe/JrU8ttWq/or8LDP0dKENOfj77dQzjuzz Kb3KP1c/QRykTnVTw+GD8vlKmMBeBi76v6UHqEeZmCBfn2oTH3xsz1SajFd41EcvWHm7 aT7egczTv2W27kG4xwxCJEZL2EsZc4yvACur6ioOoQNm23NB5oE+Fycg/4yIBSv95h3g eB5VLpoHcG/iALihfLKzoKElpH3i9YDvE7RHgH6pZZq7wgFPzy0ERAbLWNyjEJPRA3xY sFhhWb2zL6EiwwYmQjmFEdgG42V7KpyjPTCag1nswfEts52Pvuz5Cv3FLRsHvUl1wYgA eZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I7N/JO0l"; 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 g3-20020a63b143000000b0053fbde21369si4106834pgp.503.2023.06.21.09.13.35; Wed, 21 Jun 2023 09:13:48 -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="I7N/JO0l"; 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 S232932AbjFUO4U (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233008AbjFUOx6 (ORCPT ); Wed, 21 Jun 2023 10:53:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B542213E; Wed, 21 Jun 2023 07:50:04 -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 9474F61539; Wed, 21 Jun 2023 14:49:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3759BC433C0; Wed, 21 Jun 2023 14:49:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358990; bh=ZvoZjIEuldwlKWZnI9Mxmed4hFt/g32HDEOmUzdJH4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7N/JO0lu4Yj4i43TUis4tlHzDByV5tzoMO+jPEQAs0ArK/U10XS5GR4B/2cC/D37 sXC+VKMTOE+reQNE3XyN0PvmKvQM8A3vXw3/+cUTv48p6R54DDcFelLqG1M9RFE70T gC1Gi3RPeD1HC7BYOLgMm1cAYg1HJJDjUgAQcuzzxvHe92tFHHZevOQzaBv8GLUzYQ ywwuaTl0ATJAX+XqUOmFg6FIbEStDaSFKEhHfZV3Z2kIHR8i+nBbI7H7gXkM2Hm5oK V0+WuTvjpxUFIEKIX0RzUT4x9i8F8V3AuZdVLdkB9V7nqHZHZes7O/EjNdZ/2LtleJ Xn37XaisI05gg== From: Jeff Layton To: Christian Brauner , Paul Moore , James Morris , "Serge E. Hallyn" Cc: Al Viro , Jan Kara , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 77/79] security: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:30 -0400 Message-ID: <20230621144735.55953-76-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769329423289400064?= X-GMAIL-MSGID: =?utf-8?q?1769329423289400064?= 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: Paul Moore --- security/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/inode.c b/security/inode.c index 6c326939750d..086280390793 100644 --- a/security/inode.c +++ b/security/inode.c @@ -145,7 +145,7 @@ static struct dentry *securityfs_create_dentry(const char *name, umode_t mode, inode->i_ino = get_next_ino(); 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); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations; From patchwork Wed Jun 21 14:46:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 111115 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp4443833vqr; Wed, 21 Jun 2023 08:21:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uuRZeuBJWgAKfU5arWCIWhAaUQKnK+CEMqMqffIFDMtX+X2gOxLTmq1YiHpzD1ZeFW5Vc X-Received: by 2002:a17:903:32d0:b0:1b1:9d43:ad4c with SMTP id i16-20020a17090332d000b001b19d43ad4cmr12674611plr.40.1687360879512; Wed, 21 Jun 2023 08:21:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687360879; cv=none; d=google.com; s=arc-20160816; b=0V/hI53PydseWi0Ak6dYEOpeHGdoyONLYyxx+24pfvbCqolvm39cN4ZWOuH9/YDdd7 Z1tp0BONIwzaJM/2vUuEIVCefIsrjIECswjpsztLHvXarph6EqZ7b+DGkOz4y7dqq6NV RzI9oik9EmFwo0tU6fer3WjYw2mdQ/Dq/OV8a1NswYl897WQHAWkCDxgtlzA7y+ctmVS 3gZqUYrdtz+meh+cgyH3m3oZSolbNoerzCmLWVVqu3Xlkdwm/JsaSwFervN+56Xun53R U0RHZjxD467ns4JEKZPRKUu62dEaFiv+Z8WjC0tZfHuY9yEINEYX0JmLa7DU7+UxdAqI m/KA== 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=Z+YZEv6FY4Jgo9TWlE2tyRRVgcjsn2iEiaKxjlzI4yE=; b=EoT/Q4gq0btgLE3pZXvb5yHbtPKGB+If6Mo/Qh0cJXBWww8s9ZqgxLs03ZDwv2Rply +PHNE5qocAuchcb+6x055TiXB5akGorR6GupKbhfwAcom5pFSXTK15+2TDjX7nU+/GIc 6uakpBDbvCSsf8SvsGwj2HZrLrdxySxhZSe/RVYymdIfFDOkYYKdHa/FYXmIbVBOknys AgBMOPL8+sBHF4Zwg2Vs/fv+hibhWENXJSFK6gTAbISZ7sqSnl87kIZccM3KYx7Fw0dy g+5+wSkE0KA7BSNqj/Xh7uKmty7QcASia5/ia9ywJNHkX/Bz6DfnQPEM+U7F5AsL5Ozq 7CnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=c4lhUOxj; 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 m7-20020a170902768700b001b11168bde3si4219998pll.521.2023.06.21.08.21.05; Wed, 21 Jun 2023 08:21:19 -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=c4lhUOxj; 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 S232922AbjFUO4O (ORCPT + 99 others); Wed, 21 Jun 2023 10:56:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233007AbjFUOx6 (ORCPT ); Wed, 21 Jun 2023 10:53:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C7192680; Wed, 21 Jun 2023 07:50:05 -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 2BCA7615C4; Wed, 21 Jun 2023 14:49:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB368C433C8; Wed, 21 Jun 2023 14:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687358991; bh=BiaJ5jpIOWljnOkZ7WeAt5Z0pozvTMv5IciOmpdTiC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c4lhUOxjgWZaORXhjiT0ymA4hLJhfJWZkvH4rxtLAEw7wqxOhE+e+W3lY1BYmWIyj 2jtRj5IXXQgdB9uKvZhTlnGTXeqntH/1XA90X3V2bMQpa039ZaimPFCprbd/mz194p YBA3uCEd/FPISjPRQe2UUSYuk0djBw0An5PbAZbzJXgRmMa3oaJw2xHR5E0+Wo6KJ3 LVuBck367fZw1ghK9JP2djxIM9pa8YsjoF8TB8PZCSpV1ORztGvWnk0v/FDAGm2nwJ PfpM9TYiqZxJo3oetNq4LH/DF07+/+eq6CTONLIHMwHuo20iJK5cU9lBzReGCRWhww rDpdl89Zqmj1w== From: Jeff Layton To: Christian Brauner , Paul Moore , Stephen Smalley , Eric Paris Cc: Al Viro , Jan Kara , selinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 78/79] selinux: switch to new ctime accessors Date: Wed, 21 Jun 2023 10:46:31 -0400 Message-ID: <20230621144735.55953-77-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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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?1769326121552910468?= X-GMAIL-MSGID: =?utf-8?q?1769326121552910468?= 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: Paul Moore --- security/selinux/selinuxfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index bad1f6b685fd..d3908baddb30 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -1197,7 +1197,7 @@ static struct inode *sel_make_inode(struct super_block *sb, int mode) if (ret) { ret->i_mode = mode; - ret->i_atime = ret->i_mtime = ret->i_ctime = current_time(ret); + ret->i_atime = ret->i_mtime = inode_ctime_set_current(ret); } return ret; }