From patchwork Wed Oct 4 18:52: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: 13409176 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 562AFE7C4EC for ; Wed, 4 Oct 2023 18:53:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CC4BF8D008E; Wed, 4 Oct 2023 14:53:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C75908D0002; Wed, 4 Oct 2023 14:53:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A539E8D008E; Wed, 4 Oct 2023 14:53:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 939618D0002 for ; Wed, 4 Oct 2023 14:53:04 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 578C31203E8 for ; Wed, 4 Oct 2023 18:53:04 +0000 (UTC) X-FDA: 81308676288.07.97C18FC Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf19.hostedemail.com (Postfix) with ESMTP id E048F1A0012 for ; Wed, 4 Oct 2023 18:53:01 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BecAjuFh; spf=pass (imf19.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696445582; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QWhhZ2HY3q6y+CdS0jBj7wQXCOI69iF98oOeRBayFwM=; b=rIF303eGpv6PDMFueopWlZPARw5xOALl0ZMoyjq9w0aOXeTo4mXHeawXN/A2ojq31B6dzs AzhbodmIaDxDcQCb7h+XDEpFkB5dOoCZErHEhNKTQ5Is5IyTU95zs/6OOxM8XGwoYf5/sO YRGEExif5fODzArKFUMe9VBOybuqVyU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696445582; a=rsa-sha256; cv=none; b=NW8AkXUdl1Cwbm+NQ5+Pf+eQNLWByPqZL0kYHeArOveUC0hxnjDwkihfUAr6hbo3vt5n2F T3MpVIwnDvbVAMVj9AP/n1xVwxKLjQJMGyrHd9XxK6QJzRR5z7IR8OrWKtBvygycIr+4Ss Wb9xExBr9iMRmFb1YHSRvK7r6w33BEE= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BecAjuFh; spf=pass (imf19.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 8A2B8CE1DE0; Wed, 4 Oct 2023 18:52:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 408DBC433D9; Wed, 4 Oct 2023 18:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445575; bh=P50VBvZT3ngOZd5GDZltcCl374+Fh0mYUNMVsQK9mlI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BecAjuFhPIlkVHiFVOjjY3Xkns4no3JWbmomh9+1c0Fh7B56ALsgl1Wvk3D7TsLmq wvswlVAyW4HhBMnSsy2sgrhtBP8+Arsg01ketJyqIgO8KYPb9sHEibNppcVG3X3fn7 G2xWJuGgd+plODbbmIc/mVkBuNva0I/5VJG87hKdjtIIl0nCtU2eQS3zZYeVPKsdso iomUCy6ivXxV8b4V6veU8FcVKKviBhA3bGX5csMk1MhzcgNqCwCPxd4fIqJXYXFXwV Q0/ezJ/cGZu2/nHKsnqxHueOsyhRZB2oKflbg6PxD7hnRagtvUTcydQsxoqaGOzpop FmiFQ7UWuU5KA== From: Jeff Layton To: Alexander Viro , Christian Brauner , Linus Torvalds , David Sterba , Amir Goldstein , Theodore Ts'o , Eric Biederman , Kees Cook , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , 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 , Mattia Dongili , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Brad Warrum , Ritu Agarwal , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Jiri Slaby , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Ian Kent , Luis de Bethencourt , Salah Triki , "Tigran A. Aivazian" , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Joel Becker , Christoph Hellwig , Nicolas Pitre , "Rafael J. Wysocki" , Ard Biesheuvel , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Christoph Hellwig , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , Mike Kravetz , Muchun Song , Jan Kara , David Woodhouse , Dave Kleikamp , Tejun Heo , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Mark Fasheh , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Iurii Zaikin , Tony Luck , "Guilherme G. Piccoli" , Anders Larsen , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Sergey Senozhatsky , Phillip Lougher , Steven Rostedt , Masami Hiramatsu , Evgeniy Dushistov , Chandan Babu R , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hugh Dickins , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , Kent Overstreet , Brian Foster Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rdma@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, gfs2@lists.linux.dev, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-hardening@vger.kernel.org, reiserfs-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-trace-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-bcachefs@vger.kernel.org Subject: [PATCH v2 01/89] fs: new accessor methods for atime and mtime Date: Wed, 4 Oct 2023 14:52:37 -0400 Message-ID: <20231004185239.80830-1-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185221.80802-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> MIME-Version: 1.0 X-Stat-Signature: 4cwsy8ywtrkt3khigctj6zibd7xxw978 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E048F1A0012 X-Rspam-User: X-HE-Tag: 1696445581-575949 X-HE-Meta: U2FsdGVkX18u07DpA+OTJytyFN2Fw4ISjeehTOYP3vEdVXpx9GWygRBlUse0/nw5dsIdmp9zvbpeuG/H6VHIBSVPtu+GdJegv7OukddWJwt4tX4xAoqT65Gwz7tN7y/W3Y1sIMu6UY2MHEbwY/aHl+iQW/3/rQxWYi9y2pE6Iq2LZ4q2IQVylF4y7vJIYBBF3xZcuKTbs+nFqp4iw6U/4K2wIDiyPWn+ySPSQSVGX8Fpam8nmZp0JyOkcynsiZUKR4pvApKW5/FVzuD/YwQMT4U+a+StFXx5DIP5ABcMUWedkJRcz8D4GtaWSDWj7V49+P1XJ3QQYm6NxGZOIvr5BF2RdXwh8yHM3Fm9+DJ3NubrlFPh4vKK1+VOYaAkR3XphTr0KTN2bITsdO/dV9ob8dJunengAPq2kdfLSdkuFqsQwRujxrzGVvZX2kw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rF045c8sIAc1+UOmz65hEZPNL3AEKebs038chpLpifberHoKrwoNs3V/i6yK6yQqXHkUDGlww96dw/Hq1u6zRPx9ulr4lOk2v8ZHS1a3/pCqgKLthv83ha52Sze1GNEt6tPcL1UOJWWq8ESw0Ai5cN1Im44yQkNb6FNYa/2z7BzSjdXYthrwR1ej7ZbNEXbmr51PZo/oxH71SRVJehKs+y8lt2OhpxMjU/QuT/TyJkNsPwmHyrMJOcVKriAOwK93aO9hb0vRFgZumRsTqmw0KuHX56 QSf6acjn 7Un0oFnP6OCGmIwAWVxKNGrLZnMSvRij1M2JDNDghv78ojPKgQqYbNy5PNjn9oN2L31L78EtEZjDKv+wnJTZRjHz9BMk4heS2qxTwHoVdESfPyrieM0JRDUNpSDeDIMeg70G5cge6eXGjXCM4caP2P9kGw432QL0CwZtXdoCZgYP1s8YxV1NyKEqRNI+uEgbmcx7W0IAarPWRB7LNk2WYe4O9azzKiqOCJxRSiNYuwTvqpM8aRPzSA39Xw1qiFvZS4Ff0yI6qj6eDqED8N/Hls84r94vwfKmHFzBr1WVW7FME+zzDsINSKdpdPvJxiwlxRBpSfWMkoh/tZUc29wB+HuM1Dl8p/Mba87ydgp1iKEg== 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: Recently, we converted the ctime accesses in the kernel to use new accessor functions. Linus recently pointed out though that if we add accessors for the atime and mtime, then that would allow us to seamlessly change how these timestamps are stored in the inode. Add new accessor functions for the atime and mtime that mirror the accessors for the ctime. Signed-off-by: Jeff Layton --- fs/libfs.c | 41 ++++++++++++++++------ include/linux/fs.h | 85 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 102 insertions(+), 24 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index 37f2d34ee090..abe2b5a40ba1 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -541,7 +541,8 @@ void simple_recursive_removal(struct dentry *dentry, dput(victim); // unpin it } if (victim == dentry) { - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); if (d_is_dir(dentry)) drop_nlink(inode); inode_unlock(inode); @@ -582,7 +583,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 = inode_set_ctime_current(root); + simple_inode_init_ts(root); s->s_root = d_make_root(root); if (!s->s_root) return -ENOMEM; @@ -638,8 +639,8 @@ int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *den { struct inode *inode = d_inode(old_dentry); - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); inc_nlink(inode); ihold(inode); dget(dentry); @@ -673,8 +674,8 @@ int simple_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = d_inode(dentry); - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); drop_nlink(inode); dput(dentry); return 0; @@ -709,9 +710,10 @@ void simple_rename_timestamp(struct inode *old_dir, struct dentry *old_dentry, { struct inode *newino = d_inode(new_dentry); - old_dir->i_mtime = inode_set_ctime_current(old_dir); + inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir)); if (new_dir != old_dir) - new_dir->i_mtime = inode_set_ctime_current(new_dir); + inode_set_mtime_to_ts(new_dir, + inode_set_ctime_current(new_dir)); inode_set_ctime_current(d_inode(old_dentry)); if (newino) inode_set_ctime_current(newino); @@ -926,7 +928,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_op = &simple_dir_inode_operations; inode->i_fop = &simple_dir_operations; set_nlink(inode, 2); @@ -952,7 +954,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_fop = files->ops; inode->i_ino = i; d_add(dentry, inode); @@ -1520,7 +1522,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_set_ctime_current(inode); + simple_inode_init_ts(inode); return inode; } EXPORT_SYMBOL(alloc_anon_inode); @@ -1912,3 +1914,20 @@ ssize_t direct_write_fallback(struct kiocb *iocb, struct iov_iter *iter, return direct_written + buffered_written; } EXPORT_SYMBOL_GPL(direct_write_fallback); + +/** + * simple_inode_init_ts - initialize the timestamps for a new inode + * @inode: inode to be initialized + * + * When a new inode is created, most filesystems set the timestamps to the + * current time. Add a helper to do this. + */ +struct timespec64 simple_inode_init_ts(struct inode *inode) +{ + struct timespec64 ts = inode_set_ctime_current(inode); + + inode_set_atime_to_ts(inode, ts); + inode_set_mtime_to_ts(inode, ts); + return ts; +} +EXPORT_SYMBOL(simple_inode_init_ts); diff --git a/include/linux/fs.h b/include/linux/fs.h index 7b8c6a9d52ec..3ca610d42176 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1515,24 +1515,81 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb, struct timespec64 current_time(struct inode *inode); struct timespec64 inode_set_ctime_current(struct inode *inode); -/** - * inode_get_ctime - fetch the current ctime from the inode - * @inode: inode from which to fetch ctime - * - * Grab the current ctime from the inode and return it. - */ +static inline time64_t inode_get_atime_sec(const struct inode *inode) +{ + return inode->i_atime.tv_sec; +} + +static inline long inode_get_atime_nsec(const struct inode *inode) +{ + return inode->i_atime.tv_nsec; +} + +static inline struct timespec64 inode_get_atime(const struct inode *inode) +{ + return inode->i_atime; +} + +static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, + struct timespec64 ts) +{ + inode->i_atime = ts; + return ts; +} + +static inline struct timespec64 inode_set_atime(struct inode *inode, + time64_t sec, long nsec) +{ + struct timespec64 ts = { .tv_sec = sec, + .tv_nsec = nsec }; + return inode_set_atime_to_ts(inode, ts); +} + +static inline time64_t inode_get_mtime_sec(const struct inode *inode) +{ + return inode->i_mtime.tv_sec; +} + +static inline long inode_get_mtime_nsec(const struct inode *inode) +{ + return inode->i_mtime.tv_nsec; +} + +static inline struct timespec64 inode_get_mtime(const struct inode *inode) +{ + return inode->i_mtime; +} + +static inline struct timespec64 inode_set_mtime_to_ts(struct inode *inode, + struct timespec64 ts) +{ + inode->i_mtime = ts; + return ts; +} + +static inline struct timespec64 inode_set_mtime(struct inode *inode, + time64_t sec, long nsec) +{ + struct timespec64 ts = { .tv_sec = sec, + .tv_nsec = nsec }; + return inode_set_mtime_to_ts(inode, ts); +} + +static inline time64_t inode_get_ctime_sec(const struct inode *inode) +{ + return inode->__i_ctime.tv_sec; +} + +static inline long inode_get_ctime_nsec(const struct inode *inode) +{ + return inode->__i_ctime.tv_nsec; +} + static inline struct timespec64 inode_get_ctime(const struct inode *inode) { return inode->__i_ctime; } -/** - * inode_set_ctime_to_ts - set the ctime in the inode - * @inode: inode in which to set the ctime - * @ts: value to set in the ctime field - * - * Set the ctime in @inode to @ts - */ static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, struct timespec64 ts) { @@ -1557,6 +1614,8 @@ static inline struct timespec64 inode_set_ctime(struct inode *inode, return inode_set_ctime_to_ts(inode, ts); } +struct timespec64 simple_inode_init_ts(struct inode *inode); + /* * Snapshotting support. */ From patchwork Wed Oct 4 18:52: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: 13409177 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 E24BBE7C4EE for ; Wed, 4 Oct 2023 18:53:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E3FE8D0093; Wed, 4 Oct 2023 14:53:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 793C38D0002; Wed, 4 Oct 2023 14:53:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 571648D0093; Wed, 4 Oct 2023 14:53:17 -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 45D148D0002 for ; Wed, 4 Oct 2023 14:53:17 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0210214040E for ; Wed, 4 Oct 2023 18:53:16 +0000 (UTC) X-FDA: 81308676834.18.DBD0A43 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 8F99E14001E for ; Wed, 4 Oct 2023 18:53:14 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=itt8PzKJ; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 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=1696445595; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=unNUcEec+SGV+uDsnLtxSVad26ekVVI8AperL64RTOA=; b=E9IAHzE6r8KsZjlDKJL8fFN+jQI/TU2n8bGtT9Ha7HkC/fKpn8Pew47fijC3jwp8oQ5Z7w Mwi0NjrmTN7ZvykiBISiChu+XfjFVh4w5bwUAkbE/5P3KsS6n4GLKmo+3bsSGYs27VUbTj 426Dpq4z4cncvBQW2MWtsZ3KfVa1k34= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=itt8PzKJ; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696445595; a=rsa-sha256; cv=none; b=hEihymA93hsCKQwOPw6iEx07SouAEoG8m5/QEHdvpd/SYmTr2MbFBKhrKQyWqTO4bkfUQF KdT7oLAM8HNJu10EwthCbtc+9aPQktrDiNui2h6El2DMXRxr9kvPf7uZTcHMAyEqa87bZt EzTx/qyroD+I3qmSliCi13A0UtpMgZ0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 24AE1CE1E70; Wed, 4 Oct 2023 18:53:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 991D0C4AF5D; Wed, 4 Oct 2023 18:52:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445590; bh=D6ZmjuGzwm6T+vyily+kDIFcQOdKBE4hFTbZ/ePB+AU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=itt8PzKJ3oWcrWlkMnCNvO4V6JTvOPUcLklZdoWmgvE5EApLHzHWrmToC24YZNaD5 IXhfNXxqslFjk2IDoML0tgHmxZeVSse9inCpsSBFQSfTlM1ZaWIaW/14Rx1EGjZsGv ntPIZbb8JIR5CnQGLAz3U+Yl+EqlRJ7alNTo2vhAqP1qPDfCkGnYm9uO4hbjfLGGYe YEvpoo+MWSAaL6IHDgaS7acBet/4WUTpUf2h/c5f8fTK/EJTvBZGCYjPEshuHePoR6 5qJESbj+fdqCM8yjNUYu0BZ+4eFYl4Bgrydaw45QVSAj3T6mpEPEYoifAe1zFkZy7d wEjqNw+7VtILg== From: Jeff Layton To: Alexander Viro , Christian Brauner , Linus Torvalds , David Sterba , Amir Goldstein , Theodore Ts'o , Eric Biederman , Kees Cook , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , 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 , Mattia Dongili , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Brad Warrum , Ritu Agarwal , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Jiri Slaby , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Ian Kent , Luis de Bethencourt , Salah Triki , "Tigran A. Aivazian" , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Joel Becker , Christoph Hellwig , Nicolas Pitre , "Rafael J. Wysocki" , Ard Biesheuvel , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Christoph Hellwig , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , Mike Kravetz , Muchun Song , Jan Kara , David Woodhouse , Dave Kleikamp , Tejun Heo , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Mark Fasheh , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Iurii Zaikin , Tony Luck , "Guilherme G. Piccoli" , Anders Larsen , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Sergey Senozhatsky , Phillip Lougher , Steven Rostedt , Masami Hiramatsu , Evgeniy Dushistov , Chandan Babu R , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hugh Dickins , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , Kent Overstreet , Brian Foster Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rdma@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, gfs2@lists.linux.dev, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-hardening@vger.kernel.org, reiserfs-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-trace-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-bcachefs@vger.kernel.org Subject: [PATCH v2 02/89] fs: convert core infrastructure to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:38 -0400 Message-ID: <20231004185239.80830-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185239.80830-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> <20231004185239.80830-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8F99E14001E X-Stat-Signature: hk6xcr755bbrroiiugzpd9ypt64tdi5e X-Rspam-User: X-HE-Tag: 1696445594-183287 X-HE-Meta: U2FsdGVkX1+bvm6gymuWPVcWw6RxDYwj/ejWvrKsou49uaevaC4hIBvynvjVKPDAkWz2mc1AAoiOSGjqKjYn8MHfszu4CTSo5z6alzHvq7z+8kHybh5TsPfVDMSaScvVvptmVo4crXEymP2Yvl0dREfFflX+LEooSWSb8p8d9fGbJUByijOWDeBFiJ0Kbm6cLoxAmMAitCf5aGlW4orIHejWN8fgq5n7NFuObApM8kVUeB3FfaX7Toen/mpdKsxJ+hvro04s8mSmF1cQFYY7nMz0TrXQF4AXhCyFI85eslHbwy2xhHCB5x5XwWduKPvgDwA8qEFJPhTvNKDzA4lyLn5Vnpv0aQmQ2ki36xUBGNfQbqBt7EgaeevIZI4yv6IUwlenpXITUQyCnxKhaqfqC5bGSrN+yKRpER8+3KNGq4Ciw9IN1H9OV7YLg+CJUmopr367EcxYb1hK1wEAT1zHVIf9Og/jB9fhbv62lY6DEq+sJWIwJXj/TvCbwnWZ/QGmDXhgsBLGoN2N5vvGq81IVDQvq/RM5krcLtjQGyDITh8qeQq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m4pEclZVFv9ltAQht425SNQgN9NHTD5JsKJVPXxLGHcHDvh5ekIeeO5hnMYLl4jDduGHgGD1fpgkGlBSihhR6z5ezlIiYLyvZ1TOLGutLyGn9TKKCtvR4p4s9gp1wnRD8mGQc6ZPILB9XmTzcNjs/GTYDC0rKL CI4sLEZq /rlZ8jqlAREpn/6bmvkKEwemPhUOt506fxI6hYnWg4hO95tHCEXda64+l9zPo6bR6mHb9JsKKll3OqDDI15TyL6lZ5HltPsTtEjRCpOTvma1QlpAj6WB/Uy7RuymVOhIeOkqs5W4Xl+zrD+te9EX8N3uQqHWd5xi5waNrjlGhVQky4qqWeP85lS5FPm9ZamVdReN+yQ+0fJbaq4m1C066m+ZHD18wD8lZPpbDdI8hBu8DERQHYKXsQivXEDLOf8Vv0RokDMGpJYuT4ols/4nnEudSn9pPrMcVb8opR816qJQnFiGnaK3b357IuzG1BWUGldSltTcTvTSD38Fa8/FveWUSe2rehMHJgm6bSFam33A== 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: Convert the core vfs code to use the new timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/attr.c | 4 ++-- fs/bad_inode.c | 2 +- fs/binfmt_misc.c | 2 +- fs/inode.c | 35 +++++++++++++++++++++-------------- fs/nsfs.c | 2 +- fs/pipe.c | 2 +- fs/stack.c | 4 ++-- fs/stat.c | 4 ++-- 8 files changed, 31 insertions(+), 24 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index a8ae5f6d9b16..bdf5deb06ea9 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -308,9 +308,9 @@ void setattr_copy(struct mnt_idmap *idmap, struct inode *inode, i_uid_update(idmap, attr, inode); i_gid_update(idmap, attr, inode); if (ia_valid & ATTR_ATIME) - inode->i_atime = attr->ia_atime; + inode_set_atime_to_ts(inode, attr->ia_atime); if (ia_valid & ATTR_MTIME) - inode->i_mtime = attr->ia_mtime; + inode_set_mtime_to_ts(inode, attr->ia_mtime); if (ia_valid & ATTR_CTIME) inode_set_ctime_to_ts(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { diff --git a/fs/bad_inode.c b/fs/bad_inode.c index 83f9566c973b..316d88da2ce1 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c @@ -208,7 +208,7 @@ void make_bad_inode(struct inode *inode) remove_inode_hash(inode); inode->i_mode = S_IFREG; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(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 e0108d17b085..5d2be9b0a0a5 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -547,7 +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_set_ctime_current(inode); + simple_inode_init_ts(inode); } return inode; } diff --git a/fs/inode.c b/fs/inode.c index 3bb6193f436c..4f8984b97df0 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1837,27 +1837,29 @@ EXPORT_SYMBOL(bmap); static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, struct timespec64 now) { - struct timespec64 ctime; + struct timespec64 atime, mtime, ctime; if (!(mnt->mnt_flags & MNT_RELATIME)) return 1; /* * Is mtime younger than or equal to atime? If yes, update atime: */ - if (timespec64_compare(&inode->i_mtime, &inode->i_atime) >= 0) + atime = inode_get_atime(inode); + mtime = inode_get_mtime(inode); + if (timespec64_compare(&mtime, &atime) >= 0) return 1; /* * Is ctime younger than or equal to atime? If yes, update atime: */ ctime = inode_get_ctime(inode); - if (timespec64_compare(&ctime, &inode->i_atime) >= 0) + if (timespec64_compare(&ctime, &atime) >= 0) return 1; /* * Is the previous atime value older than a day? If yes, * update atime: */ - if ((long)(now.tv_sec - inode->i_atime.tv_sec) >= 24*60*60) + if ((long)(now.tv_sec - atime.tv_sec) >= 24*60*60) return 1; /* * Good, we can skip the atime update: @@ -1888,12 +1890,13 @@ int inode_update_timestamps(struct inode *inode, int flags) if (flags & (S_MTIME|S_CTIME|S_VERSION)) { struct timespec64 ctime = inode_get_ctime(inode); + struct timespec64 mtime = inode_get_mtime(inode); now = inode_set_ctime_current(inode); if (!timespec64_equal(&now, &ctime)) updated |= S_CTIME; - if (!timespec64_equal(&now, &inode->i_mtime)) { - inode->i_mtime = now; + if (!timespec64_equal(&now, &mtime)) { + inode_set_mtime_to_ts(inode, now); updated |= S_MTIME; } if (IS_I_VERSION(inode) && inode_maybe_inc_iversion(inode, updated)) @@ -1903,8 +1906,10 @@ int inode_update_timestamps(struct inode *inode, int flags) } if (flags & S_ATIME) { - if (!timespec64_equal(&now, &inode->i_atime)) { - inode->i_atime = now; + struct timespec64 atime = inode_get_atime(inode); + + if (!timespec64_equal(&now, &atime)) { + inode_set_atime_to_ts(inode, now); updated |= S_ATIME; } } @@ -1963,7 +1968,7 @@ EXPORT_SYMBOL(inode_update_time); bool atime_needs_update(const struct path *path, struct inode *inode) { struct vfsmount *mnt = path->mnt; - struct timespec64 now; + struct timespec64 now, atime; if (inode->i_flags & S_NOATIME) return false; @@ -1989,7 +1994,8 @@ bool atime_needs_update(const struct path *path, struct inode *inode) if (!relatime_need_update(mnt, inode, now)) return false; - if (timespec64_equal(&inode->i_atime, &now)) + atime = inode_get_atime(inode); + if (timespec64_equal(&atime, &now)) return false; return true; @@ -2106,17 +2112,18 @@ static int inode_needs_update_time(struct inode *inode) { int sync_it = 0; struct timespec64 now = current_time(inode); - struct timespec64 ctime; + struct timespec64 ts; /* First try to exhaust all avenues to not sync */ if (IS_NOCMTIME(inode)) return 0; - if (!timespec64_equal(&inode->i_mtime, &now)) + ts = inode_get_mtime(inode); + if (!timespec64_equal(&ts, &now)) sync_it = S_MTIME; - ctime = inode_get_ctime(inode); - if (!timespec64_equal(&ctime, &now)) + ts = inode_get_ctime(inode); + if (!timespec64_equal(&ts, &now)) sync_it |= S_CTIME; if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) diff --git a/fs/nsfs.c b/fs/nsfs.c index 647a22433bd8..9a4b228d42fa 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_set_ctime_current(inode); + simple_inode_init_ts(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 485e3be8903c..8916c455a469 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -908,7 +908,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_set_ctime_current(inode); + simple_inode_init_ts(inode); return inode; diff --git a/fs/stack.c b/fs/stack.c index b5e01bdb5f5f..f18920119944 100644 --- a/fs/stack.c +++ b/fs/stack.c @@ -66,8 +66,8 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src) dest->i_uid = src->i_uid; dest->i_gid = src->i_gid; dest->i_rdev = src->i_rdev; - dest->i_atime = src->i_atime; - dest->i_mtime = src->i_mtime; + inode_set_atime_to_ts(dest, inode_get_atime(src)); + inode_set_mtime_to_ts(dest, inode_get_mtime(src)); inode_set_ctime_to_ts(dest, inode_get_ctime(src)); dest->i_blkbits = src->i_blkbits; dest->i_flags = src->i_flags; diff --git a/fs/stat.c b/fs/stat.c index d43a5cc1bfa4..24bb0209e459 100644 --- a/fs/stat.c +++ b/fs/stat.c @@ -57,8 +57,8 @@ void generic_fillattr(struct mnt_idmap *idmap, u32 request_mask, stat->gid = vfsgid_into_kgid(vfsgid); stat->rdev = inode->i_rdev; stat->size = i_size_read(inode); - stat->atime = inode->i_atime; - stat->mtime = inode->i_mtime; + stat->atime = inode_get_atime(inode); + stat->mtime = inode_get_mtime(inode); stat->ctime = inode_get_ctime(inode); stat->blksize = i_blocksize(inode); stat->blocks = inode->i_blocks; From patchwork Wed Oct 4 18:52: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: 13409301 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 A7777E7C4EE for ; Wed, 4 Oct 2023 18:54:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 413858D009C; Wed, 4 Oct 2023 14:54:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C3F18D0002; Wed, 4 Oct 2023 14:54:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B2F18D009C; Wed, 4 Oct 2023 14:54:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1F99F8D0002 for ; Wed, 4 Oct 2023 14:54:43 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E68B71C9F1F for ; Wed, 4 Oct 2023 18:54:42 +0000 (UTC) X-FDA: 81308680404.14.0FAB3AA Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf07.hostedemail.com (Postfix) with ESMTP id 3AB494001D for ; Wed, 4 Oct 2023 18:54:40 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JjCLMHa9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of jlayton@kernel.org designates 145.40.68.75 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=1696445681; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=V6+qe6AGparTSOjauaKonsVYwrcp/k0IaLgG1CC3Ipw=; b=djkWvDoQvGKAI618y17dbY16pdltNcUmCgi46gLfDihaDa5d/xMsp24x2jVZNsaaa5W+rN eVoA0i05/0KALuvuy3jSJzic44lHqZjR9iz9V0eTVe73meQlyPeIhNL1Qd8Hqk8R923POI 53we3e2Y3gakEPs6HeSJbE8WA52KgXQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JjCLMHa9; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of jlayton@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696445681; a=rsa-sha256; cv=none; b=VHbAdqDpNWOMmrBLjuz1taZTffGYOzi9oYxMgPOq9BldmwHYthbB9B+VdZiP4ivTJz68tB JA3dU5kQ2ehbnGJ0T4kKyRgC6EQy8541fj1eNcmM1Xyu3QWI89hEyf1RVt3rJ8WE0vqH+y SWN+r2ZHCMOcH4HRhicqNHbcCSWVlnk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id C23C9B81FE5; Wed, 4 Oct 2023 18:54:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E2CDC433C8; Wed, 4 Oct 2023 18:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445679; bh=p1Dmt9XjnzAIX2jMetI3FBJUlMhdUAq23wbUyqvehig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JjCLMHa9gGt1lQ2XglXkWIOzENaZqGQds9dyNJRseHF7EiGAA4OQYoi85LQLmjerE W8FBwPDioyvpOxPK4SsvWmfmOJFhaQ/auThs4fF5EMh6fvA/N06QRW/BZHoaTCb8qR JfGxyvUL5iiEeiP/BQzzmnpOfMwLqK9PQRk1kwhs3++i33ChgTGZAL4lmby1YURqqO 5MMygpwKgaGff/zh75Jj7sUd5GeLsGG0j6xslMdzq+jnE/+DMDf+QxMvEe23VwhezG w+VDO5JZfF6S7M421QsoVPWflcKapd4cnqFBWvHd/PcCA/EJiIq+aMcOY0aLgROZjM myDH5ZPPCUwxg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Subject: [PATCH v2 45/89] hugetlbfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:30 -0400 Message-ID: <20231004185347.80880-43-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185347.80880-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> <20231004185347.80880-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: ajnqb1mhu4wgr7wngdnxazc9qeqq53bx X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 3AB494001D X-HE-Tag: 1696445680-696442 X-HE-Meta: U2FsdGVkX1+0llg2OfTcDU3GOe9etjRtTmZ/j8kFe7xZLZIW7UG7QNfel7kofG00WZJ2iEzM3wqNYHatgYxo2pRH1AjKgRokafeFtQexmkbrKJnD3LdCeLXMK7PF0avxAdfI3Kdjf1TJowt1+q/pdh0ePJYyAUjW+lyFvkwamKmQtlE0GWwX2P5rn+Z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0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/hugetlbfs/inode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 926d01c493fb..ebb3506eeeee 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -981,7 +981,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_op = &hugetlbfs_dir_inode_operations; inode->i_fop = &simple_dir_operations; /* directory inodes start off with i_nlink == 2 (for "." entry) */ @@ -1025,7 +1025,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_mapping->private_data = resv_map; info->seals = F_SEAL_SEAL; switch (mode & S_IFMT) { @@ -1068,7 +1068,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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); d_instantiate(dentry, inode); dget(dentry);/* Extra count - pin the dentry in core */ return 0; @@ -1100,7 +1100,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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); d_tmpfile(file, inode); return finish_open_simple(file, 0); } @@ -1122,7 +1122,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap, } else iput(inode); } - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); return error; } From patchwork Wed Oct 4 18:53: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: 13409302 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 DFA4AE7C4EE for ; Wed, 4 Oct 2023 18:55:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 65E0D8D00A7; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E87D8D0002; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 488478D00A7; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3485B8D0002 for ; Wed, 4 Oct 2023 14:55:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 13F39802EE for ; Wed, 4 Oct 2023 18:55:28 +0000 (UTC) X-FDA: 81308682336.24.A301A57 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 6119018001A for ; Wed, 4 Oct 2023 18:55:26 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=F18Oj6eE; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1696445726; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qQTDCLUWbjKPjQu7SLJ59PyTx7087Qx4d7zqkuxG61A=; b=VoBf4nKm/vH4G/lPEjJvfpvbncGYtAtaTejfGCVKukTDQLHQtoaq0ENYtGCD3XzopSsa/f dqwBxkcDeJIHwYoEcZpLW+sLtbEGfJKYyqLEynZKMgdp8vq2Gi4KK8Cs24irngM4Z5E6TD 8VzdJCglBfONSDq37aWHuQbfw0VR+qI= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=F18Oj6eE; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1696445726; a=rsa-sha256; cv=none; b=sYQyl6kH5ad/5W7MSEDlBLlR0sZkNrtQrBPbA+Zedu7GtS/N4ZmtrLgMDcQOBCbHCqhpNp 1YweZoHn5J2f2EomPmZVmlyFEwgyqTFedbXE24c995bf9Yc5QWY7ZOfVGT0zkjFghOfRGo oJ05k3pSRE/tF9j/L5Ffw7Tvhl6GuRc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4EB84616A6; Wed, 4 Oct 2023 18:55:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93445C433CA; Wed, 4 Oct 2023 18:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445725; bh=862ZbMc7Iwgtnwh3GqR4Jl+nGAZ2XLWIwUU6rRcMJ6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F18Oj6eEab2Bi2zSWygWYjomZTGEXh+alEUcKmrc6ouzTyG9T9RJoncvIMYXRKrDr utHJ7sNOMpE1DGMtUh0UhzIy2Etoret3APYucUxWjlvQB7zjoQNQFRxfUvDb0JmwJD XkPEjWwGp46ZIIEyxLNNj7Dg5+WGU/jRokhgISzy+pgDltJH7hnRdWdRjWfF7OdVpY MVkkDEX2Bi541//U87NX5bARZdafBUR7yD7JrSsTQxnH6GyNtCtY61i6TEZGSMM/9B 7FbiXS9cs59RkjuXHxDVZyTNCzqtHVV+V4B7sGuShqTmuwFrlXzzjv5svqIR2alyV3 s0teUdzfhXgGw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org Subject: [PATCH v2 82/89] mm: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:07 -0400 Message-ID: <20231004185347.80880-80-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185347.80880-1-jlayton@kernel.org> References: <20231004185221.80802-1-jlayton@kernel.org> <20231004185347.80880-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 6119018001A X-Stat-Signature: q3cd4stuqswpum4hm9rzxhn6myofqoud X-HE-Tag: 1696445726-720716 X-HE-Meta: U2FsdGVkX1+13xwnUrvhFTVbKwZTJ6Yyr55+PWazQqbSq7ATi8pUfdh/lHqkHQYa4z7qIeTjsQOtObpOTVv9xIBoiOf8QwrQCuq6YRCi+KUHqxDrx49Svg3EEPaAdjkYXyiU1/g47h382rIuOWFBxRyxi0z1skRh+tb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va8HVkuA== 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: Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- mm/shmem.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index a3ec5d2dda9a..93c09d1837fb 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1111,7 +1111,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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); inode_inc_iversion(inode); } EXPORT_SYMBOL_GPL(shmem_truncate_range); @@ -1222,7 +1222,7 @@ static int shmem_setattr(struct mnt_idmap *idmap, if (!error && update_ctime) { inode_set_ctime_current(inode); if (update_mtime) - inode->i_mtime = inode_get_ctime(inode); + inode_set_mtime_to_ts(inode, inode_get_ctime(inode)); inode_inc_iversion(inode); } return error; @@ -2475,7 +2475,7 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, inode->i_ino = ino; inode_init_owner(idmap, inode, dir, mode); inode->i_blocks = 0; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_generation = get_random_u32(); info = SHMEM_I(inode); memset(info, 0, (char *)inode - (char *)info); @@ -2483,7 +2483,7 @@ static struct inode *__shmem_get_inode(struct mnt_idmap *idmap, atomic_set(&info->stop_eviction, 0); info->seals = F_SEAL_SEAL; info->flags = flags & VM_NORESERVE; - info->i_crtime = inode->i_mtime; + info->i_crtime = inode_get_mtime(inode); info->fsflags = (dir == NULL) ? 0 : SHMEM_I(dir)->fsflags & SHMEM_FL_INHERITED; if (info->fsflags) @@ -3248,7 +3248,7 @@ shmem_mknod(struct mnt_idmap *idmap, struct inode *dir, goto out_iput; dir->i_size += BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ @@ -3335,8 +3335,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); inode_inc_iversion(dir); inc_nlink(inode); ihold(inode); /* New dentry reference */ @@ -3356,8 +3356,8 @@ static int shmem_unlink(struct inode *dir, struct dentry *dentry) simple_offset_remove(shmem_get_offset_ctx(dir), dentry); dir->i_size -= BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_to_ts(dir, - inode_set_ctime_current(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_set_ctime_current(inode))); inode_inc_iversion(dir); drop_nlink(inode); dput(dentry); /* Undo the count from "create" - does all the work */ @@ -3504,7 +3504,7 @@ static int shmem_symlink(struct mnt_idmap *idmap, struct inode *dir, folio_put(folio); } dir->i_size += BOGO_DIRENT_SIZE; - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); inode_inc_iversion(dir); d_instantiate(dentry, inode); dget(dentry); From patchwork Wed Oct 4 18:55: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: 13409303 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 AD54EE7C4EE for ; Wed, 4 Oct 2023 18:55:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39F528D00A9; Wed, 4 Oct 2023 14:55:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 328D58D0002; Wed, 4 Oct 2023 14:55:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DF218D00A9; Wed, 4 Oct 2023 14:55:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EB22F8D0002 for ; Wed, 4 Oct 2023 14:55:52 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id C017D80403 for ; Wed, 4 Oct 2023 18:55:52 +0000 (UTC) X-FDA: 81308683344.09.01965EB Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf23.hostedemail.com (Postfix) with ESMTP id 70110140018 for ; Wed, 4 Oct 2023 18:55:50 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U4cHhSwb; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 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=1696445751; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=DqCEz/v1NIFQEdA9M9suOzM+orY90TuUbymMwTjHgsE=; b=8a1qp6gv/Av5UQXLfU2KH3GMP6zduJcK9/JzcRcJCS3vIctuNOtbLQ++WnJ0nHbDdau1ht 4UWdNxupdzwTQl9RL9qKIHUKomGtbRRTUJxIyovgocYx6le4mzzx4uuIcCJ0J31NVx8xZ3 SKKADmBHJgVS7Rg4SZD5XKF5PsdHKr0= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=U4cHhSwb; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf23.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696445751; a=rsa-sha256; cv=none; b=anRfFfbhBXO7ItzY2uq4nnD//FBO1EZOhC//6A3qlQgaRujvGpSgkApyNrp/0ViGjLkitV Ye9bcoQ20SEe0uOCXeanFNzc52J1O4Sn4HJuIw0nag+e9QHt6lY9Bme4wGz0xKRahzK5XC vrSgjI9fXMY3E1lQNJUGr6SAdUnOHLE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 93066CE1E77; Wed, 4 Oct 2023 18:55:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BD6BC433C9; Wed, 4 Oct 2023 18:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445746; bh=g/yzBkH2Lp29tPfDBqNp+9Elc+zqCeoJYNIVCamPD2Q=; h=From:To:Cc:Subject:Date:From; b=U4cHhSwb0LbjLA0qPOmmG7XGfwhLrdUKNdOP6jb0JmroYvkDlGxxFYbdBHNbhzXNH iovfoJxTxBNF3fgWoxKD5rhfozOY+7XT8L1cOwcimaEFAuQea9kFSm7ljzuINveJng 8O/TRaYWLsMFAu0WZqR+Ej7+BaviQVOBsP8mffc2SqReX6OXjtiZTmCmLoR9/saHwB c5rjkuCRPMb/Q55YD3oJLDC2dFLpMza5Y6vaUnEAxOls8VOQTB4gdTGSQ3fEJfeL1x KMOBQbkmXFBlyX1vgIb23wb+t56+wSAOGwpJ/lOlOTTFlZfD0AdwHSMDPWo5mfkyr4 HgGj4IVfBzhTQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , Linus Torvalds , David Sterba , Amir Goldstein , Theodore Ts'o , Eric Biederman , Kees Cook , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , 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 , Mattia Dongili , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Brad Warrum , Ritu Agarwal , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Jiri Slaby , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Ian Kent , Luis de Bethencourt , Salah Triki , "Tigran A. Aivazian" , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Joel Becker , Christoph Hellwig , Nicolas Pitre , "Rafael J. Wysocki" , Ard Biesheuvel , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Christoph Hellwig , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , Mike Kravetz , Muchun Song , Jan Kara , David Woodhouse , Dave Kleikamp , Tejun Heo , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Mark Fasheh , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Iurii Zaikin , Tony Luck , "Guilherme G. Piccoli" , Anders Larsen , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Sergey Senozhatsky , Phillip Lougher , Steven Rostedt , Masami Hiramatsu , Evgeniy Dushistov , Chandan Babu R , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hugh Dickins , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , Kent Overstreet , Brian Foster Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rdma@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, gfs2@lists.linux.dev, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-hardening@vger.kernel.org, reiserfs-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-trace-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-bcachefs@vger.kernel.org Subject: [PATCH v2 87/89] fs: rename inode i_atime and i_mtime fields Date: Wed, 4 Oct 2023 14:55:28 -0400 Message-ID: <20231004185530.82088-1-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: 70110140018 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: d9kjigpyi4ch3qk3den4nddzi6wgpcri X-HE-Tag: 1696445750-355955 X-HE-Meta: U2FsdGVkX1+1I/Pb002qQiiAyY22/4gANnsXuvXs9RBiF9EJcc8gXar3ZuMBEiKLYMTpvOwYQ4Tbk4ow3chR5tgk+7aouVEEnmayyicv2DDX+HTWmkv9dn2GUJFDwjKK5PL3aCpvNPraVzIpgXVPrTHRI9YzXz/1Ux4Hzp4cl4P42RC6DQZKhmyLAs9pNuH/L1LM86rhXnJTPIn6ZkxLI1RDPxLgn5/NNDNBQkOLnC0X5CaGwPbtEAfduPUnakccx92UXslKpyxQhhFoHp7PkUaq0yMNyfJpIVbyFsLP1y4JZDPfh/ICwsDk/i2ij0VL3dGwWCLIFRhBGgHaDRovEcwHIue4QMTFxjY9c/j1etoWtoaR64u9UOGfebEz222dKeIJBcNYXc/C2AjqgqbfVjmQSTIPEaqhYBYKZfMQZaWkzDeowQT90pHL/W1wrkOhCXruqN67OSKhwiZMVYmkw702oKA1oPsib+KmQeZm0U+lMXuoY15ON0H77gfuduvqrs+FIFQLfAfAIX8qcTxapmirNWx2psbc4daKx2GMY210gW1vU61cT3bYZuwvux2/qXzOqo9/9gYT+VHVWf5ySO0IxvxymmKKvpjOe7ne+2ixAYzA2b17rI0yIRXv1fMZsfAVCE+9mjpU6i380NlGsp7nswltelGq0MGke6pnt8eCwqehmh2Wj/1USVyu311IW34KUgd4THjB5KekyxEYhRUPxCJBrdPK+lsroH8AtkAGPZmQ/Gsf0ZjtSedZXm2ELCMxIFbP90h2Pn9qX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BahKxu5eFmvUjznkbj4RBS6ud+KxYY4AhHe5RX13X80FUp/yRmjUtdrC8DE4caQohMGZKsniJILPB2RCYlczacWAyxS+3FXAMB3BJJiqhEhsDrrLfb4DdDNDbezuHnWuABa8zG3RZPs1zpynNP/xwZAIEQINzQqvwa637BXbLFyox3xZUyryBGmIB/1gsFtyRC5FpVDEfjqDHCLLessqP+6pflHRfbG2do9q3ENN+gj4YpOBuUwi4XYNs30fA3ODFhgtuCgMMq4tZ0+KlMm9LeV1jxx2082m5x7npL5HZFtoouPcsdlAcmJoMgFKpKOCYlGZJRR0xYeXrW1+wGfo5hApNiWwKQYUwwuqA4w8orVIKVUPh9EY4QRAVzL/SCN8Jlr 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: Rename these two fields to discourage direct access (and to help ensure that we mop up any leftover direct accesses). Signed-off-by: Jeff Layton --- include/linux/fs.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 3ca610d42176..84fdaf399fbe 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -671,8 +671,8 @@ struct inode { }; dev_t i_rdev; loff_t i_size; - struct timespec64 i_atime; - struct timespec64 i_mtime; + struct timespec64 __i_atime; + struct timespec64 __i_mtime; struct timespec64 __i_ctime; /* use inode_*_ctime accessors! */ spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ unsigned short i_bytes; @@ -1517,23 +1517,23 @@ struct timespec64 inode_set_ctime_current(struct inode *inode); static inline time64_t inode_get_atime_sec(const struct inode *inode) { - return inode->i_atime.tv_sec; + return inode->__i_atime.tv_sec; } static inline long inode_get_atime_nsec(const struct inode *inode) { - return inode->i_atime.tv_nsec; + return inode->__i_atime.tv_nsec; } static inline struct timespec64 inode_get_atime(const struct inode *inode) { - return inode->i_atime; + return inode->__i_atime; } static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, struct timespec64 ts) { - inode->i_atime = ts; + inode->__i_atime = ts; return ts; } @@ -1547,23 +1547,23 @@ static inline struct timespec64 inode_set_atime(struct inode *inode, static inline time64_t inode_get_mtime_sec(const struct inode *inode) { - return inode->i_mtime.tv_sec; + return inode->__i_mtime.tv_sec; } static inline long inode_get_mtime_nsec(const struct inode *inode) { - return inode->i_mtime.tv_nsec; + return inode->__i_mtime.tv_nsec; } static inline struct timespec64 inode_get_mtime(const struct inode *inode) { - return inode->i_mtime; + return inode->__i_mtime; } static inline struct timespec64 inode_set_mtime_to_ts(struct inode *inode, struct timespec64 ts) { - inode->i_mtime = ts; + inode->__i_mtime = ts; return ts; } From patchwork Wed Oct 4 18:55: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: 13409304 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 08775E7C4EC for ; Wed, 4 Oct 2023 18:56:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 993BD8D00AB; Wed, 4 Oct 2023 14:56:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 91C798D0002; Wed, 4 Oct 2023 14:56:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D2C58D00AB; Wed, 4 Oct 2023 14:56:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 586018D0002 for ; Wed, 4 Oct 2023 14:56:05 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 338831CA458 for ; Wed, 4 Oct 2023 18:56:05 +0000 (UTC) X-FDA: 81308683890.17.99102CD Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf06.hostedemail.com (Postfix) with ESMTP id 68789180002 for ; Wed, 4 Oct 2023 18:56:03 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SDZrwTkR; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1696445763; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=futZctVsmURmQGZ/KDgafuW1qDPP1YKGtvIp0lF1GQQ=; b=zWgGpKWlJX+c7Bz0WuWktZHPxeiPssY/PoaXLQ2g5mEKhvs7DiMNw28ABHxqa0qXjJtSw5 A/DqCjUCCjCu68oVoakBLY3QOKe1S9u+lyzVKXgIiiCYac/kl/qZXLSbOT+LOQ0Nk5hysd DVi8XQbK6m0uI5o3G3B/HtULaH/qcwA= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=SDZrwTkR; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf06.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=1696445763; a=rsa-sha256; cv=none; b=STbQcIqgLa2WRGBtMOhkKbe7uTvE81kmXndwlqADqd6v3xCxEQUizpECeKKwtFkm2xnR9b 0ZP7VO+QiVZ7w3JMQUQFP1rsS/HhwUFAWuFJMnlmSAPFPEh6YYrXzuFppjubzasF3fOcuf QOVSjboVIt+VvaLZEVR5N6g/XJ/5kh4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 431A661681; Wed, 4 Oct 2023 18:56:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C352C116A3; Wed, 4 Oct 2023 18:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445762; bh=sLBQkX6C3uZBg0HDRv8gvWKbTBaFbLFrj7RUWYAQhtM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SDZrwTkRfcCOZGW15481BzgRhMnUfqbehqGZ70SkT07TpnQHXu6UZfqn2H3DH/IgB NREMwV+WxrirSQUoJ/gwdJuN20x7Oz09gVp00C5J4jUQVvPa7HndP8pgLhpw+3XdE6 sgwldkiPDhzPzj2g3RqGA/gLpn5OXG2RxT2QYd/q9czrrGxn2+biB5bnvlPb+wW7mJ 1yXSUZIQbCkJJ9A+zsHeXrou8bbwxUhD+l+R1pwZkVAnrBM97dSGO7YTQ9XanaOiAq xtFzLLS3PpGLDldOhnDRuM8I6A6BQmH5bnq3JkmbbMZcpJWkhUCscVq82P/pMn/I9p +1GtWq5/j2IpA== From: Jeff Layton To: Alexander Viro , Christian Brauner , Linus Torvalds , David Sterba , Amir Goldstein , Theodore Ts'o , Eric Biederman , Kees Cook , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , 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 , Mattia Dongili , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Brad Warrum , Ritu Agarwal , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Jiri Slaby , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Ian Kent , Luis de Bethencourt , Salah Triki , "Tigran A. Aivazian" , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Joel Becker , Christoph Hellwig , Nicolas Pitre , "Rafael J. Wysocki" , Ard Biesheuvel , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Christoph Hellwig , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , Mike Kravetz , Muchun Song , Jan Kara , David Woodhouse , Dave Kleikamp , Tejun Heo , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Mark Fasheh , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Iurii Zaikin , Tony Luck , "Guilherme G. Piccoli" , Anders Larsen , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Sergey Senozhatsky , Phillip Lougher , Steven Rostedt , Masami Hiramatsu , Evgeniy Dushistov , Chandan Babu R , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hugh Dickins , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , Kent Overstreet , Brian Foster Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rdma@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, gfs2@lists.linux.dev, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-hardening@vger.kernel.org, reiserfs-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-trace-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-bcachefs@vger.kernel.org Subject: [PATCH v2 88/89] fs: switch timespec64 fields in inode to discrete integers Date: Wed, 4 Oct 2023 14:55:29 -0400 Message-ID: <20231004185530.82088-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185530.82088-1-jlayton@kernel.org> References: <20231004185530.82088-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 68789180002 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 4ftekhqcppoofdyz94gxqhu7d4kamxc3 X-HE-Tag: 1696445763-374042 X-HE-Meta: U2FsdGVkX1+knqXXJt+NqymujTc05yz/2HfEg7d8qFLQ7QzH1Fu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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: This shaves 8 bytes off struct inode with a garden-variety Fedora Kconfig. Signed-off-by: Jeff Layton --- include/linux/fs.h | 53 ++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 84fdaf399fbe..485b5e21c8e5 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -671,9 +671,12 @@ struct inode { }; dev_t i_rdev; loff_t i_size; - struct timespec64 __i_atime; - struct timespec64 __i_mtime; - struct timespec64 __i_ctime; /* use inode_*_ctime accessors! */ + time64_t i_atime_sec; + time64_t i_mtime_sec; + time64_t i_ctime_sec; + u32 i_atime_nsec; + u32 i_mtime_nsec; + u32 i_ctime_nsec; spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ unsigned short i_bytes; u8 i_blkbits; @@ -1517,23 +1520,27 @@ struct timespec64 inode_set_ctime_current(struct inode *inode); static inline time64_t inode_get_atime_sec(const struct inode *inode) { - return inode->__i_atime.tv_sec; + return inode->i_atime_sec; } static inline long inode_get_atime_nsec(const struct inode *inode) { - return inode->__i_atime.tv_nsec; + return inode->i_atime_nsec; } static inline struct timespec64 inode_get_atime(const struct inode *inode) { - return inode->__i_atime; + struct timespec64 ts = { .tv_sec = inode_get_atime_sec(inode), + .tv_nsec = inode_get_atime_nsec(inode) }; + + return ts; } static inline struct timespec64 inode_set_atime_to_ts(struct inode *inode, struct timespec64 ts) { - inode->__i_atime = ts; + inode->i_atime_sec = ts.tv_sec; + inode->i_atime_nsec = ts.tv_nsec; return ts; } @@ -1542,28 +1549,32 @@ static inline struct timespec64 inode_set_atime(struct inode *inode, { struct timespec64 ts = { .tv_sec = sec, .tv_nsec = nsec }; + return inode_set_atime_to_ts(inode, ts); } static inline time64_t inode_get_mtime_sec(const struct inode *inode) { - return inode->__i_mtime.tv_sec; + return inode->i_mtime_sec; } static inline long inode_get_mtime_nsec(const struct inode *inode) { - return inode->__i_mtime.tv_nsec; + return inode->i_mtime_nsec; } static inline struct timespec64 inode_get_mtime(const struct inode *inode) { - return inode->__i_mtime; + struct timespec64 ts = { .tv_sec = inode_get_mtime_sec(inode), + .tv_nsec = inode_get_mtime_nsec(inode) }; + return ts; } static inline struct timespec64 inode_set_mtime_to_ts(struct inode *inode, struct timespec64 ts) { - inode->__i_mtime = ts; + inode->i_mtime_sec = ts.tv_sec; + inode->i_mtime_nsec = ts.tv_nsec; return ts; } @@ -1577,34 +1588,30 @@ static inline struct timespec64 inode_set_mtime(struct inode *inode, static inline time64_t inode_get_ctime_sec(const struct inode *inode) { - return inode->__i_ctime.tv_sec; + return inode->i_ctime_sec; } static inline long inode_get_ctime_nsec(const struct inode *inode) { - return inode->__i_ctime.tv_nsec; + return inode->i_ctime_nsec; } static inline struct timespec64 inode_get_ctime(const struct inode *inode) { - return inode->__i_ctime; + struct timespec64 ts = { .tv_sec = inode_get_ctime_sec(inode), + .tv_nsec = inode_get_ctime_nsec(inode) }; + + return ts; } static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, struct timespec64 ts) { - inode->__i_ctime = ts; + inode->i_ctime_sec = ts.tv_sec; + inode->i_ctime_nsec = ts.tv_nsec; return ts; } -/** - * inode_set_ctime - set the ctime in the inode - * @inode: inode in which to set the ctime - * @sec: tv_sec value to set - * @nsec: tv_nsec value to set - * - * Set the ctime in @inode to { @sec, @nsec } - */ static inline struct timespec64 inode_set_ctime(struct inode *inode, time64_t sec, long nsec) { From patchwork Wed Oct 4 18:55: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: 13409305 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 E3D42E7C4ED for ; Wed, 4 Oct 2023 18:56:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 834078D00AC; Wed, 4 Oct 2023 14:56:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BD338D0002; Wed, 4 Oct 2023 14:56:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5746F8D00AC; Wed, 4 Oct 2023 14:56:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 41FC28D0002 for ; Wed, 4 Oct 2023 14:56:23 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0F41380414 for ; Wed, 4 Oct 2023 18:56:23 +0000 (UTC) X-FDA: 81308684646.26.0F2B074 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf03.hostedemail.com (Postfix) with ESMTP id B9FC420020 for ; Wed, 4 Oct 2023 18:56:20 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=NqVtdmXP; spf=pass (imf03.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1696445781; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bas1HH1yNprEzYlUdRGZTq3Olr7EjY5TS7D6MU0JW7o=; b=MKAitvTCVPja+4T0XW3jjx4RKUmKUve37CHmEpAEPF6/QmfHYqwYQfooU5XOkUbWreI6VJ PjW2i6XWVgr4VVqBoCfJ3KFcIXWqXYHuIMz015+sH+T5AkqwpiruqBA9c+UekvRzmmgZ1k 95hyWchX7suMYVRhM5SBiAQwqco+fTg= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1696445781; a=rsa-sha256; cv=none; b=IyI+HZFg4S4D3IbyFgtsylubWR9MOqX3oAlYH8j6H5fzR12j9iut9zgpHykL1AK8C2SmMi 2b/3qIICdX1qKUnJXeOUJHbMI2Dk7MlgZ9SAcW0/CLDCAjO8o9cmeGI5qh5Kn+iKbkkfBu dURwFKJXQ8C65sAYB2Ej/XKZ+Vn1D10= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=NqVtdmXP; spf=pass (imf03.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id E28BDCE1E77; Wed, 4 Oct 2023 18:56:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 675C9C433D9; Wed, 4 Oct 2023 18:56:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445777; bh=iC7KwsOJJL3kT0M8KubHc+xTYSGXLa7gjxgf1YgvBK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqVtdmXPTE3K9q9deuJTm/G7a71zUKszCFqZsp5GIQNtA7H7/+QIS49PlOMCUfFNJ 1ydyxG0x0Zhc5NXKKvQZoNb0pMC2bwR6porAQ3qOkvHn+oCaXipMdg5DIlUK6kK3dJ /qGaNm9SdmE2IDbECVrjFagXBbmQuihBc1Xhxlya1LZKKRDWQwFqYqNeRTG4/PcP8U fjxjbvBWhJKav9Mn2S5Lw52vmEkf02EL+EOCc8xxck+JdDNrgRWXBSojP+3KV6r6+j osY5RvD+bQgIMRf1FSVwxbtgizfCN1brIMaKXTHpZ/pGKsilyXHn7K+ZkEvj2U6B0B tzn7voxPB+lnw== From: Jeff Layton To: Alexander Viro , Christian Brauner , Linus Torvalds , David Sterba , Amir Goldstein , Theodore Ts'o , Eric Biederman , Kees Cook , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , 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 , Mattia Dongili , Dennis Dalessandro , Jason Gunthorpe , Leon Romanovsky , Brad Warrum , Ritu Agarwal , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Mark Gross , Jiri Slaby , Eric Van Hensbergen , Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck , David Sterba , David Howells , Marc Dionne , Ian Kent , Luis de Bethencourt , Salah Triki , "Tigran A. Aivazian" , Chris Mason , Josef Bacik , Xiubo Li , Ilya Dryomov , Jan Harkes , coda@cs.cmu.edu, Joel Becker , Christoph Hellwig , Nicolas Pitre , "Rafael J. Wysocki" , Ard Biesheuvel , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Namjae Jeon , Sungjong Seo , Jan Kara , Andreas Dilger , Jaegeuk Kim , OGAWA Hirofumi , Christoph Hellwig , Miklos Szeredi , Bob Peterson , Andreas Gruenbacher , Richard Weinberger , Anton Ivanov , Johannes Berg , Mikulas Patocka , Mike Kravetz , Muchun Song , Jan Kara , David Woodhouse , Dave Kleikamp , Tejun Heo , Trond Myklebust , Anna Schumaker , Chuck Lever , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Ryusuke Konishi , Anton Altaparmakov , Konstantin Komarov , Mark Fasheh , Joseph Qi , Bob Copeland , Mike Marshall , Martin Brandenburg , Luis Chamberlain , Iurii Zaikin , Tony Luck , "Guilherme G. Piccoli" , Anders Larsen , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Sergey Senozhatsky , Phillip Lougher , Steven Rostedt , Masami Hiramatsu , Evgeniy Dushistov , Chandan Babu R , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Hugh Dickins , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley , Eric Paris , Kent Overstreet , Brian Foster Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rdma@vger.kernel.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, gfs2@lists.linux.dev, linux-um@lists.infradead.org, linux-mtd@lists.infradead.org, jfs-discussion@lists.sourceforge.net, linux-nfs@vger.kernel.org, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, linux-karma-devel@lists.sourceforge.net, devel@lists.orangefs.org, linux-unionfs@vger.kernel.org, linux-hardening@vger.kernel.org, reiserfs-devel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-trace-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-bcachefs@vger.kernel.org Subject: [PATCH v2 89/89] fs: move i_generation into new hole created after timestamp conversion Date: Wed, 4 Oct 2023 14:55:30 -0400 Message-ID: <20231004185530.82088-3-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231004185530.82088-1-jlayton@kernel.org> References: <20231004185530.82088-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: B9FC420020 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: hxc4xmanrba31t8iwsfm1zyn3k44rdy4 X-HE-Tag: 1696445780-692126 X-HE-Meta: U2FsdGVkX18ZPJaot6sZaLpwhHMWK4GMkw5GecGYyk00+Aw4UyBuLDxey+rEXtyhC4LNn9DtqOHK6MqHUopj0VJbtJbHmRyq36/Ww1vl/AhdMp7OCOksgbiwdLMxnMtytjk83bBA/Dmto9JbYbNk0p0oVu2xCDtxZXk8aMAyYMufnkt+dgR1Z8VQMqQhwoc5hLwo9aCCP/LLlmaaPT6z+OJkC6CQAt24T4EINhwIGYxBhMcTZ1BgW1j+UD/5cjRuLiHZ+LJkWWEOCRX2VLRkW2e4tR5F2mL8C3ijjG2ZOCw+64YlN2U74s94QXwOx15Lt9VbXMqQYNtIYHF1NxFBoxkgq/FNX9LZfKUL6+9r9rtivngXu2svSivj7cAd4lxThi8ZLvz6Ef0c/IlSsV0/o/SpspMeG91mgLWjDkD5GQn7PovPxV2OIk/vdtyft+Zse5fQ+BAVAHW15+VrAsCS2eA3lixBev8SMVQvbzs9ymVHrq/yQID2zLh8ZPKrSH/cnlJn5PM1V6mFGXrHtkNS0NfpOuuWRKc8pqZ3Mk7vOGaXZetAEujNBaCqdfz0p9f7T3sAkWcSZyOSUJRF+kGX251q05FSlzup0ffAGnnZY3VnzBUQl7R7ozD8xQxBP8+Q4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XImZnrqV8x3BeQJSMw6HVnzj20NYs/vaJrZ2tj4oUe9qqJMxUwrqLyZMX6tionBxNjqqy1S4mVD6cndl GniqA1DT z0HYdGqmvZHoSlU2uP+UN7g+rVL1Jb9S1RCQKxK10lpV3y1+WjdPgfewUZ3R9cygIOta3MVs+HPFYkGi/jM9wUWcPpDfEdmF9Omma53y25yRw+AyiNwry6w0ZTiO82XwYawWz7qYCfJ+6PebwIyy36ZzKSSGJ4fvRszpCupFYU5gkUgWehrn8X6ueyZ5aP0Lt+r6rlfs54yNOVjATHbVpC1nLYFbiFxiDYglj1nGT5OdrIY35yOacdhfdKNvY7GFNEG0dSYqLSWQXuG6WYS4MBsYPLKd02dIdHdMVeQTKfHbcRIDfdIf3ouG8U0YinoHxSSp7MKoOzuXh9Dyro/1dleRLkYdIPMVe8UCs3p86b/iap1CnB+mIZRunbZ1PCcwqQ/OB9TKm596YlUa6EFIkfDeqFjgVW1vR+6SE5I+HbMA== 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: The recent change to use discrete integers instead of struct timespec64 shaved 8 bytes off of struct inode, but it also moves the i_lock into the previous cacheline, away from the fields that it protects. Move i_generation above the i_lock, which moves the new 4 byte hole to just after the i_fsnotify_mask in my setup. Suggested-by: Amir Goldstein Signed-off-by: Jeff Layton --- include/linux/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 485b5e21c8e5..686c9f33e725 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -677,6 +677,7 @@ struct inode { u32 i_atime_nsec; u32 i_mtime_nsec; u32 i_ctime_nsec; + u32 i_generation; spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ unsigned short i_bytes; u8 i_blkbits; @@ -733,7 +734,6 @@ struct inode { unsigned i_dir_seq; }; - __u32 i_generation; #ifdef CONFIG_FSNOTIFY __u32 i_fsnotify_mask; /* all events this inode cares about */