From patchwork Mon Aug 7 19:38: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: 13344812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C65CC04FDF for ; Mon, 7 Aug 2023 19:39:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7A3816B0078; Mon, 7 Aug 2023 15:39:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7533F6B007B; Mon, 7 Aug 2023 15:39:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5CE0A8D0001; Mon, 7 Aug 2023 15:39:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4EF856B0078 for ; Mon, 7 Aug 2023 15:39:16 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1F94FA04B7 for ; Mon, 7 Aug 2023 19:39:16 +0000 (UTC) X-FDA: 81098322312.14.43D75B2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf16.hostedemail.com (Postfix) with ESMTP id 38815180010 for ; Mon, 7 Aug 2023 19:39:13 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Ho/bKlx1"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1691437154; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=R6vlvmLUvKOZulfJ+YX7AeQubON0sqkk/2/xliZw3ps=; b=OPd6DG5iQ4uP1Cc2Ig70LLdlhXh7GTxBXnS+WPa4e/QrpcL072P3C3KpJYU9ECdR0IM4Ed Ca5meE1xEEPD15r6HzEGKDrQSoXLYTktHZSXGwoMTGmEBjaWfe6BC+x/iovuDSowZPNrf8 9fXpNH13JY5W394hxw5MlJy2l/4f/fs= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="Ho/bKlx1"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf16.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1691437154; a=rsa-sha256; cv=none; b=2ftcHSw5tB0GeIdbR8Ym8Kxe0rJn7Pl3B53CiFbTC9u/S2w4Hc9+132ArxCZn0C8JWmh7l hUiwWpH5yvqzQxLQYJCAAK4DZEjA9JEEPf9llMbVD4w7e7Olcv/X9prCMR0KvDc998/QhM 2xkoIMKs9X+fafvIwXq+9yR0juyPMwU= 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 5E171621CB; Mon, 7 Aug 2023 19:39:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 190D6C433CB; Mon, 7 Aug 2023 19:39:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691437152; bh=FjK4CXRYiETGn7OzM9We0k7POLcZSDg/Zv0Z2hVxi0I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Ho/bKlx1W7NVzVpTF8gn0UewKv0nHppAuc8rdt0EpJYDtixyqx9Pm88/s99GjJrGi VyWirQXhlLAHTHZVHTzlGto3MlaV9AC0IS4d6ITtkzLyremJTCyhuBghtZLgXI+wFI BWGm+mORoGztRukCVECswMBc3DvEXZDbVqOKZXPaUiWJUmCkRudhYLBAFuaGRz0svy C36sqbKO7RSDcSDE/CGOWo0cEGgTtCDEY05Q94XhMpgiKRb5sItIEiDQCoyYVBZcIf Wa4V9O81hy5cBvQhbAwM4fAHf3aZVD4FS2Awad7m8GiNGAzXgq+KA8NdanYEf8qWKH 93tAXs2YealYw== From: Jeff Layton Date: Mon, 07 Aug 2023 15:38:35 -0400 Subject: [PATCH v7 04/13] btrfs: have it use inode_update_timestamps MIME-Version: 1.0 Message-Id: <20230807-mgctime-v7-4-d1dec143a704@kernel.org> References: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> In-Reply-To: <20230807-mgctime-v7-0-d1dec143a704@kernel.org> To: Alexander Viro , Christian Brauner , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Howells , Marc Dionne , Chris Mason , Josef Bacik , David Sterba , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Tyler Hicks , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Theodore Ts'o , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Greg Kroah-Hartman , Tejun Heo , Trond Myklebust , Anna Schumaker , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Kees Cook , Iurii Zaikin , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Sergey Senozhatsky , Richard Weinberger , Hans de Goede , Hugh Dickins , Andrew Morton , Amir Goldstein , "Darrick J. Wong" , Benjamin Coddington Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, linux-mm@kvack.org, linux-unionfs@vger.kernel.org, linux-xfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1015; i=jlayton@kernel.org; h=from:subject:message-id; bh=FjK4CXRYiETGn7OzM9We0k7POLcZSDg/Zv0Z2hVxi0I=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBk0Ug9ionAyEQ00FE2RysKd05kyYmr3Uo7M3P+S fZsake1O9WJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZNFIPQAKCRAADmhBGVaC FSb/D/46K68INm7LKy6yCb3jkxB2bvd3492M0QuN7zYTdZH4x4RyMrHVer1FcL+lgqeruzzWSEv f1jPsb2uT+va62GuDI/zejA857D6P77Pxxt62BL6PnF8w9wZfjNo2RBhUJFbcYvEl7WV0QxsBOz eVhLOFWlIfBl7qnRoQcQ1EXt/gqm3vncmzxpOhadSWSyAjf3Uyf3ySH1I8zBuzQ6i19jmqQ0RvT bb3mEN/W/iBYc3G76Eud3bo16w9EvoB9nxjRlcTuuZvFPC7ModhHKFVftanzKrqnN++LssBxJTt qCOGvNDD4XQsoYkNqWK/GeE2dbwuRgBPiPB4T/mRNQGXzoSkgEejZgIlG9UhkKivUvI8mAD1Fvf EsZs1aXtF60wPVfCdR9EzkWR98DlT7wHqFko2/J5x3ayqhk5/Hd7Dxd9+3KOUjobqgsNV6z/0hu iEa0QiZI9t2vkWtpHGQNGJWoW5i6lWMNl2ugTM4Ph4rAECf19PhJ6QMCL6sLB1t/Yg+5Y9QCkZa u6JThQBEJCg3b3v0vqUh9tAePT84Au/SSSO41CUtR4p6gYotqAK/13vCIRlgBGFlSFirEva3rSu O4r5y/T/dIV3T3tPLC2QfaJLzkymk/JC3a+VkmmiF/LAO2Y1vQ5KE1bfV2hX76K1OaxCpRxc3+Z GjdlHLhrXMsZpbw== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-Rspamd-Queue-Id: 38815180010 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 87ypiaef877y3z45ajyo1q19fnsjn14d X-HE-Tag: 1691437153-64705 X-HE-Meta: U2FsdGVkX18AGq7cA8z06Cd/vMBF4eIsM9dOciNpK4h2Ml972BYRpWVkudyVlb7MsQdODiSww61zs4d0hsk1BAiopUgZoJt6D3VAmwLDllHWBYKpuBXaYUEOVPA/mV86bTBSfuIzjF+RRxOyHOsPmA6qrqtt0m1Cqu2SKSj5jKxbe+q5h4JHjjMPJDsccNJS2hF9nrKJLYSjiBaLiZk6emgv75AOYNepszf81u6hAreM/WF+AAo8ZCkWZeIt3rnbSdA+pSvm8fwNvueD7eJ8GxRpME0J7E69tpPsBNncWYbI9CYzArNljnPpEn0efqbncn6yve+GaI5REDCIaFlXkj3SBuaAgW813bj7fDc/M3/uamoKGvFkYRDLdgt/AVyvOp3jyLaJQZTxzk3ZmDbaxyl+7gCpDlXn1z0gxg36p6x//3wM5lXLeNdO27oma2a6oxxS0ByXqOzKiqv1ek3PSK5fDFxsxaNWVPGM5btTpL/BOe5wtC8HcKV4ac8hENcbKN6UpiwVNz4YOHhoGBKFB+RAUJCoA41wxcWOa95YUpJKWXOUWag9UZDweXBTlBcdJHRxJpslv6uhoEyOYoACACm/4IQ1lUh9czcFjZfT0Mj1hsXa5Ed6sK7mTh8blG/FLqj8mSxwu7h7OkP26GsN1VQv8r2UodadIC0vFG6sToJFDU1Q95eSSNrf+XMLRW2AFSm+MASgOT4h7Aq/5Q0C8B7A21OuqnnOv3XXxYainMxNsqIccH2r60WqkZIbAC+N7LPAREjqWS/Pcde8nexwbn3y2luQ/q/V2nALbvTLabs8aRRWEIqq7chWOL8oSnuPgdkxspkrBDj0VmsrWPSKPgsLA5lvnuzwXJmUUeoFsxctbicMkq8ixOf2mfS2vVHTRKsfE+uLSF8WHLwetL06qCThM5Oy2B49lg2su8P02IGajqrGEe8HhKR600b5hiVKwJdxcce0sPrS+SKRpEA Z7kd+qgw 7pw0TZIvE+BFvRy/7H/EK8vs+BfjY4UPJsz9hWE7wyKtPd1M0nMAxfeqyo0DZ2hQ9s/N8cqco5kF4SheMVDT2Jhcd3yyjU6hohdOqdhjHm/uzGqzAoVgkjGg0CJWCzQGFRiV5r9B/N5KCRsuUELBzElMSetg3ou9neVsTm/F2kZEaJ2o4mPsHew1wTs0gOYJfDmW3aeEJwzDVX4jH8Tbtm9c6ANL05Zdh4ixwxMSJ2LKL9y4vf0iBgAgxoJhu/5nuWCZxNIWRCjfYvrXROVEwfERvXHbsz1avQrSQpwk4r871wsUntjdj1baquBTozNPFYPYdv7gLGMzxbkL4hCdm5vlAZg/bMp7VZCHTg5/g0ZccAtMVGqFR8YZ7ybm7fFAqC8xJ6pXJn78pq10= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: In later patches, we're going to drop the "now" argument from the update_time operation. Have btrfs_update_time use the new inode_update_timestamps helper to fetch a new timestamp and update it properly. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/btrfs/inode.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 29a20f828dda..d52e7d64570a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6068,14 +6068,7 @@ static int btrfs_update_time(struct inode *inode, struct timespec64 *now, if (btrfs_root_readonly(root)) return -EROFS; - if (flags & S_VERSION) - dirty |= inode_maybe_inc_iversion(inode, dirty); - if (flags & S_CTIME) - inode_set_ctime_to_ts(inode, *now); - if (flags & S_MTIME) - inode->i_mtime = *now; - if (flags & S_ATIME) - inode->i_atime = *now; + dirty = inode_update_timestamps(inode, flags); return dirty ? btrfs_dirty_inode(BTRFS_I(inode)) : 0; }