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: 148470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp338911vqb; Wed, 4 Oct 2023 11:53:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH89t90zEr0hZ7nxk7WXfv+RbUqaYKIXeZPUHJyzR8rEGU+xzVU4pR584lomsqUpvsBg6XL X-Received: by 2002:a17:902:c94e:b0:1c7:245a:7fea with SMTP id i14-20020a170902c94e00b001c7245a7feamr4418997pla.58.1696445621391; Wed, 04 Oct 2023 11:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445621; cv=none; d=google.com; s=arc-20160816; b=EjC/o8uy7w5N+OEmkcGrWgZ1IdH2CZ8ZMf3ESBKgtIeivRdu6v1ZUmYIiPQ8HBvgKF PFAJ195FbXtZ17qcGbfXn76VloRPHeu6LYSTyAu0a98WTUplKFbrcSxq6HB59pBWUd3e Xlh/k/rCVjLu9WTAKcEFu0k/GUQqkLu4ZIpe6/lZRZywidwrgsOEQ8sTcCJ8YrbaUAbk A6tJ0K4ArYau8DepVAsGoHnllc/Z/Ic4iyt6b2gfGjwFtksmgunNm6YyVf0Zhjg+qWGi 5kIc9ISwHzTHmFqPi+mESmtF9YLzlrcoF9506+5iGJWwqgC5DATuFRR7Qar7RxuA1+EX uXrg== 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=QWhhZ2HY3q6y+CdS0jBj7wQXCOI69iF98oOeRBayFwM=; fh=Mu8cExWZ0ryo+xXd15sIvDuJ/P4rEjrt9uTues01RKA=; b=SRHc00R7nb7cM93jnnC+py6Qkp66YDxhZBvQGBGGDAlGyLh5E6XNUNg/EzjRU3h8n1 08dDBS7N0+vRC0v1PQdt/AabHC5RwyR85SxIFsLnqd/SQeOUyjSagsYp1sctBI9UI+xS BvKJf1gawAL03LUQeTIYYl/ILHio+aKMbEaDWi0bLcUiOf1RNeHNTxpNKbweq0TUKtnj yn1BLwmRYdCWZkJPPoAVcKqk0co+XlnsYbE31P26NosxvFBf+4YBi9HLMlpXqsGIJMSW PWOxfvQNbnwHtv3eFEfYOXUrgZytcBEgUnliWiqVkFvtkX1rRHocHvZDiJp0LSJ9GKaN wLbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BecAjuFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id be8-20020a170902aa0800b001b84f9263e7si3853204plb.325.2023.10.04.11.53.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:53:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BecAjuFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 43B9F83E8FF8; Wed, 4 Oct 2023 11:53:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244723AbjJDSxd (ORCPT + 19 others); Wed, 4 Oct 2023 14:53:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244552AbjJDSxO (ORCPT ); Wed, 4 Oct 2023 14:53:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2A9611F; Wed, 4 Oct 2023 11:52:55 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:53:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852163884377927 X-GMAIL-MSGID: 1778852163884377927 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: 148471 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339139vqb; Wed, 4 Oct 2023 11:54:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHeZdHX5UmATPHK6r7IJuP3YkV7Hf8bW5cTxVp6Sxgs9NCqGBUrjlwc5qcmBzZdaQrgxwlf X-Received: by 2002:a17:902:cec3:b0:1bd:a22a:d409 with SMTP id d3-20020a170902cec300b001bda22ad409mr3648334plg.40.1696445653658; Wed, 04 Oct 2023 11:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445653; cv=none; d=google.com; s=arc-20160816; b=bb7S7RrO9dsjbT41xwF/d8hqv1bUxyeoXQeEErwlu3liulTOgbrMwroSGB0yPEkOIW hpDjzSPX3YEbu1dPP1aGE+FDnTCtImOY9U+5La6ZimPlakbAPN8/xdeU2JekgIRjweYm GjZb2yUZXTGJAMao5Ttt/GCzemBvxEddfK7foGOlj6709ozJ036Z2/V/N3lnw+ybig9H B/T7UaIzwJXhrI3OnzXI1fozy0jhMipzxKkq3sIAP/AuljlRufogysXMo6q/IGa/n7yM 5gv7/Yf9YtTLdcGPscBaAu8ZyIVEYUAmY5N+6FuHxa0zmE2laT2C4y7j9pp/0d1HLVxC s4rQ== 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=unNUcEec+SGV+uDsnLtxSVad26ekVVI8AperL64RTOA=; fh=Mu8cExWZ0ryo+xXd15sIvDuJ/P4rEjrt9uTues01RKA=; b=nyeVwBlUUf2D7A/J5RhE9tJO3mLrxoxeNWos9tOMTw4UOW/8Wh03M2n6KL83y2Yfsw a0tWTrMx+lhDsltBQMLfdnz5JzFQ5gDGy/ws/fjXA0l60DSJLZ5l4MwwXOS5VSRrnJR+ JKLNXFLQKfcPkwuROaDEAr0wozfeFuy47M5mjSaULqpaAIVW+MsmR7AUKvNSrMw2uL6M KSp/tDXGuLTcI1IsSTR/l6iR/JBpSVmyaKeyQt9w1KWnY8v5ExKHcq0QDNYq/qM1yRc9 cQIQEA0fqEjVXki0qYIYk8Ku1c4oHVUku0CkQmDbdvlB8COIOfL2enYmC8NQ1d+rx1RC OorA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=itt8PzKJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w20-20020a170902c79400b001c60ecf8f7asi4051439pla.258.2023.10.04.11.54.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=itt8PzKJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BB4B983EB302; Wed, 4 Oct 2023 11:54:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244787AbjJDSyF (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244662AbjJDSxX (ORCPT ); Wed, 4 Oct 2023 14:53:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD55EAD; Wed, 4 Oct 2023 11:53:10 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:54:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852197962042295 X-GMAIL-MSGID: 1778852197962042295 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:51: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: 148493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340344vqb; Wed, 4 Oct 2023 11:57:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTsETgXloD546/3YUNoVltRRWOLE6kvJKgWZ82JXZcGxB9VRRxRmkZpm3i5cmD/dSxLxvu X-Received: by 2002:a9d:7746:0:b0:6c6:3ea5:cdbf with SMTP id t6-20020a9d7746000000b006c63ea5cdbfmr2970202otl.28.1696445825663; Wed, 04 Oct 2023 11:57:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445825; cv=none; d=google.com; s=arc-20160816; b=ozJPN1F1z6dizFRP693JPFudpKsDaEmEL4V6OPh/10odLLdAtgaJFxzPxpwi1qVwPM HdMHNZIdd+Qe5JS7vsERjELbyyH9u7EkGhYFMVAVRDhFAUJbx+cJ6oUoH86E4yQy1SEn 7BdQCBqLW/UnNpRayyYME4YItbDeIrOjwPxdf4Ych5yJpSL9WdRxTyqmK4uL8eTeSG3Q sWva0h1s2qfeo7H+UvNb88ToOOWycSidoN5UQoPLkLCp5hRl6e3RFW9MTT/5fzHpeQZp FJyyVWi580P2ePDfJdhO0jOuxUrSQ1UsMuC3dzI4zrmx4vrGjtjmXJsL9mylIRM87vIv xU4w== 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=WEKk+mHNIo1/UaGWm+8QYSwdF1omjPgX2A2b1WrFApk=; fh=Br4sZYkkHPCGn6Gc64OzX/zEQ/Cpu1eLW5N/aT160X8=; b=vIIOVtbH9PcUT0IU678pk9+lHfYOfDGQx1hEEgPWZS4oBCjOml0XIDAXMIrn2XwMnq zTVL2FyR45j7fzq2QDVScv8ChLNQLg7qaSlfOBEdcOC1jmGy4xIunYlrbnUiGqF1VfCl yVZBiO+5I873zg/4IVLzwSKGwL8o/rrn6E04PT/3iImHfLR+arNEmLHgDzQicvQruoFX FeDTxYUPjQoUa6KCRw1TH+5Lil5oFX7DiKNoqT1EDP3qNRVVBNNEWNJ9IJa2UosRGyr+ 6vPe8UhHmcuYBDdQBphiMoWDlqh+LF0gmrfJ1+JJ25p6MdsIcXZmgDL3blHSitD/k00E XSzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dpOrlZpJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t185-20020a6381c2000000b00578d71ef3d7si4536277pgd.733.2023.10.04.11.57.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dpOrlZpJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DBA9F81BDA62; Wed, 4 Oct 2023 11:55:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244716AbjJDSyk (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244702AbjJDSy3 (ORCPT ); Wed, 4 Oct 2023 14:54:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3EE719AE; Wed, 4 Oct 2023 11:53:50 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A720C433C8; Wed, 4 Oct 2023 18:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445630; bh=jwS/maqXmK0T9pimsNUUGNYN+WZVE+M+UfX5KqHyk1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dpOrlZpJSqLuel0lQLPdPOTonwy+6VYYeFt7ydcVpG1CIXwDVqnK+ehXtyCLiMCEZ yRkFAtkLQEsTSW03T3wkPVqxur3jAWS/jyFvFtjeDZLHBqclPwF2TZX5z/a3UJX4xE GLOnUHAsfRrrBXxBqJZAJyJVcmIAZ4fm5D4aNqZuhNlfma7i/PYYGBrXTpPyMq8JDk xSBGV87ATL/NvkViy2Gq+kan4g9EoU4SSrjUQkbfF+fe/+6Zy08T4r+Ezk8GjA7VQ2 MHYKWZcZ3yhbV8oMAxhPvPsiv2QRAQW03aI6yG3zS/EoNb51/p8m07NX82dKE2yQea EeMuB2M49THEg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nicholas Piggin , Christophe Leroy , linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2 03/89] spufs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:48 -0400 Message-ID: <20231004185347.80880-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:05 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852378179253302 X-GMAIL-MSGID: 1778852378179253302 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- 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 38c5be34c895..10c1320adfd0 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_set_ctime_current(inode); + simple_inode_init_ts(inode); out: return inode; } From patchwork Wed Oct 4 18:51: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: 148472 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339394vqb; Wed, 4 Oct 2023 11:54:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFKJBI2QxZdSQpfIDrqMZTkSfTy/FSTf9bhqgdFJlR0mYoHhzPT49fapnyw1TYDC0hisIcP X-Received: by 2002:a17:90a:950e:b0:274:8be8:f767 with SMTP id t14-20020a17090a950e00b002748be8f767mr2896758pjo.15.1696445691440; Wed, 04 Oct 2023 11:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445691; cv=none; d=google.com; s=arc-20160816; b=txNf+oA9nm4xC9eiXQhN3luydcCiBYW6skuqwxd2WPsNx6FDK3HzBOCwus/URzXXwG l7BbOAm8PaQoBuJQRmjRyLTTT8wdOypDET3ljGsLBNhFitmytTEuHwK7Ttl7AOJ6Ad5y eAHEbv/q3gpAE2QPxLOv6PwGCQ6TT+F4STagjZm3uW6nv1Vo+suwhhNXWL5hyyRJMu7h 83T6iH5uJ5Q2AFBAEcAKKB/S1FPjgq3Y9fWka9yugT6+fG0FT/dhqVBoLTANDMbbbxPp 7P4t2HoNYIx8UEQo8XVKxprxekbeT++7MoVyb9bIVn6zVT1MH8sfxL86BR+90CV/Oid3 ze1Q== 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=CHCiuPPNFdqmROpO+/5/zKKdi4fmafXqhfFywouZ1KM=; fh=alN9iiYU7VU/LyDGC48ggoW9bbwq3WwAF7zkwWi62ns=; b=EhuArN30bAZD53TMeIcGqz3Gcwt288yuPXLyDXuIE2uNo4ppGp0+sOVurML1fRC4rV Q2f7j2Q2J5/aVHZF4eCDADPBuDhV3D5HnO3Bh/ivpczA/oehtHehCaIROT802HIKxu5y ZSSdIGZ/8oSmrwJoJvhzq+81eWeEo+MVQqitXiAXXlu1dZhUAKcX3fHmAJ/0Znfbuq2Z xZs45c5S0aYzYve4p3jZwW3/ACCLfgw66JYopKGDm+J4RcT8vJxst1buu46QQQBWQNgn F+70lgU5jDr+cclmB3+HyQ4hGc2KVFXBw0W/WntYyDR6+mkgPy4bo46FZXkDhfPPbUJo Oz/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S0rD3xt5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a8-20020a17090ad80800b0027761a3a4b0si2085210pjv.0.2023.10.04.11.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S0rD3xt5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DC4B583EB30B; Wed, 4 Oct 2023 11:54:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243700AbjJDSyn (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244703AbjJDSy3 (ORCPT ); Wed, 4 Oct 2023 14:54:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A53C719AF; Wed, 4 Oct 2023 11:53:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91AB5C433C9; Wed, 4 Oct 2023 18:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445631; bh=HdzDDIAOL0gyCSOGAQpME4U8jFKk2Teg8J7WHsz4110=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S0rD3xt5/twMo5w2l6u/b9eeLMHekUDAQLI4UDIld+vM0pW+5jjCXGPZuvR5rWnFe 3n8hVDKA7Tg+eu5X5KYGVCRpV9nUWHRfHJSKmv5Lp4Fn7LulDHX7egs9NX7CDGgGuB Gdptz0wYuxHjFCp6gRkR3jRc2fbNf44s83X7h4R72N7qED4gYb5F7h4qlQLts04pG5 /detTTOnXPt3mfgt6AKSHW2QvMUjkMOdGLoAf2zcunl49eIsrDpHqcbKvAw5+VX87W hc7TgiCu2DJTD0HNhI7DD5jdWo4FieZu47KDPErL37hNpKzS8031iAQcpqcM1RIGTs C8qIbcH1F5GTw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Borntraeger , Sven Schnelle , linux-s390@vger.kernel.org Subject: [PATCH v2 04/89] hypfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:49 -0400 Message-ID: <20231004185347.80880-2-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:54:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852237708220782 X-GMAIL-MSGID: 1778852237708220782 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- 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 ada83149932f..858beaf4a8cb 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_set_ctime_current(inode); + simple_inode_init_ts(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 = inode_set_ctime_current(ret); + simple_inode_init_ts(ret); if (S_ISDIR(mode)) set_nlink(ret, 2); } From patchwork Wed Oct 4 18:51: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: 148494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340355vqb; Wed, 4 Oct 2023 11:57:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHdikIxBlKry9WEYK1jM+y3GmuPSxRaSZ6t5Ey2JvOfMD7y5SL8cpUVI91Q6sxCcVl4B0CT X-Received: by 2002:a9d:4f0a:0:b0:6c4:cda6:ff31 with SMTP id d10-20020a9d4f0a000000b006c4cda6ff31mr2942884otl.15.1696445826745; Wed, 04 Oct 2023 11:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445826; cv=none; d=google.com; s=arc-20160816; b=jDfRLqzRpbwhbEQcf7Y7hZR3eHIHux003hbxYyazETDJ/CMOLBKDOVPKBCUrFUnffy YYN615sdHbjv1469aae1p4kCSgxXSqpICImTkexOeRbuD+tLEUVY3VhNwlwCLprGLJVx 7IpJLYF88womKO7Ph0QxcyMSFWT5aibYzY6kT/0OWUFqGczzuGtoI9AjiVFSLydO/qzp Q01YDr/M0yclCqzUjy1wdgrxyiVSSsG463SYKFImsycj+RDXSrE6OmiJ53NHWlkQ5RbV cvNrW4H1nxg5UVkRQU1bDOgiJ7gZk3Kast5b6dxOoKxdSmc4sm6OMg/0yDe2cwbDnwOw +tvw== 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:to:from :dkim-signature; bh=TXh681QDGS181WMZTnsIyqCMqt9OhLdQkE5Kp2hfHnw=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=LDTwHggCMHM7QMLr0R5pVwpiQ2vu0u2F7rcNfMJJJGXS8uiy46H1vJ9lgiqSagMcVD 8IfWOHOr1Qinl66UhYqBh98ZY96LHSl8fpBFlu3BB/VYOb569rZtdYKVhhlCaK64cV9I IFnSOpMjXm9n66F6c4DUMBto+wL5I0KlnDLEpGe5Y3gtIL9EHwiMPta8LGXU7Tj8wiRB PeVRVQyrnO/caSzCpGIXoPoURVzqXjDwvd8Pq9nHSYE+TaYWkxWXWNJV+HmZIs7qqEH2 VHNTbxs2Jr6MJU5Rt7gCthFXnGAIjs98wMGqYjLwCLDfsdbY2sTcmQuyCF/KRTIS3j73 XIKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="m/jtbGes"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k190-20020a6384c7000000b00577f4d85fd7si4176783pgd.316.2023.10.04.11.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="m/jtbGes"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EBB448067A4A; Wed, 4 Oct 2023 11:55:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244618AbjJDSyq (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244711AbjJDSya (ORCPT ); Wed, 4 Oct 2023 14:54:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2EAA19B5; Wed, 4 Oct 2023 11:53:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C61DAC433C7; Wed, 4 Oct 2023 18:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445632; bh=/xK/B6crc2QtnH34wiVJcFRPWuSlj5Mtmrs9i42Ixu4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=m/jtbGes7U0TXtS0+fShctLS3xlbZ9Fvqpbgs2AifVk0qOF1YhfztR717yxqiazjw 8t00zssO1041r/jaS4LsVO37nbDBU9cRac7pt9go6+V3+tuBK3crQn9gHMvKisTa4Q EISdA7I8TLOV6RtpnKzuxuUp4VRLpTwJzjm2DcwqPXUGd1yFCET/MO7vkp+2V6mZIx +QXvwIaKHpChBwOSCqrNqmpaRDKXqYypSBYG8gWmfrDgdsc+4LybyANF+mgU/wDQ20 zU3U9MDqkufxCttdWBGHo91bgyNPJHhgTPS2VZgv5SO57CqFSjwhIPJYj/so6Xw2jk tAt5jtFE74bcg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/89] android: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:50 -0400 Message-ID: <20231004185347.80880-3-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:24 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852379163240796 X-GMAIL-MSGID: 1778852379163240796 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- 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 81effec17b3d..420dc9cbf774 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -152,7 +152,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_set_ctime_current(inode); + simple_inode_init_ts(inode); init_special_inode(inode, S_IFCHR | 0600, MKDEV(MAJOR(binderfs_dev), minor)); inode->i_fop = &binder_fops; @@ -431,7 +431,7 @@ static int binderfs_binder_ctl_create(struct super_block *sb) } inode->i_ino = SECOND_INODE; - inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); init_special_inode(inode, S_IFCHR | 0600, MKDEV(MAJOR(binderfs_dev), minor)); inode->i_fop = &binder_ctl_fops; @@ -473,7 +473,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 = inode_set_ctime_current(ret); + simple_inode_init_ts(ret); } return ret; } @@ -702,7 +702,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_op = &binderfs_dir_inode_operations; set_nlink(inode, 2); From patchwork Wed Oct 4 18:51: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: 148506 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340855vqb; Wed, 4 Oct 2023 11:58:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjT/kyIp0++PpGm9bEheZ5in5KPAS9SMtBA5iiX773ev9t8zdLwCeUP7ntUZw/Q3fY3az7 X-Received: by 2002:a17:90a:cc01:b0:279:47d:318a with SMTP id b1-20020a17090acc0100b00279047d318amr2942661pju.29.1696445891464; Wed, 04 Oct 2023 11:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445891; cv=none; d=google.com; s=arc-20160816; b=ylIFYuevGoxTBxEF1e3J4Nr/uFVjrH7EFkhW+oodr2inp5svdM1L1aHNIwT4cx/1ht oli4NzQLcaqZ8l4hVnO2m/toYRNRhOSLeelbQb8ssjOhZ8p9j/XO1xvmg44RXUYdaniL 1ZJ7AW4rjLn0P/dYAsCb/orDNg5kL+0wR/2Vm8M5h0Qa816TvcA3e1eazQWD6xLszeXZ LMdE/Ywqvfhw9gb7lDzJTO5WecQngwhqBIj7fyO5mxbZAD4bj+HCBJ8RyfQ21/ROrrs7 hBoAjSjdlwGpUokBvsG7T5ji2xeVX+enSMrZA/BCteXH2r7V497dTLDz+8PN4NpvIGKl h40Q== 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=XN5nPd+IBIVst8C1o4nxh1GfDTIkPDNBgikYyk5PiTk=; fh=+8yfMUekUhCQzg47WX0vwKLpcMT8BNCzX6xaRcIjE9o=; b=GWbHSwnyyTaDAKL1umzQ/cv+I3fJkoxeb+oe9ADdC/IEjbqIjXhA6YJ42DsMJkOUgp HaPu69j9qHCwS+z3QFZqX0O2fd8/jHZvMSGiE0Dfpeh7D4bEzgnt/oZ+aCBrLUypnm7A mjShLwx1wOh9CX/HPHDEqPNvFOQunubcX+chpleUCBE4jIDodkWSrCCpF2wwMOZcr3Cy ZLtHChZ9Qatomf4Sn42AMDrr+fCi/AVoLXIwP7Wdz3acHlklEcmodAjqTKtX6oPPDFue 3v/wTIB/xQMGiuoIma4HLXIMkTbo7zWQLfD4RsvelO8zgBguuEjrMxiVDG3LvkQcrTpb Qmqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dWftD498; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y13-20020a17090a1f4d00b002791baa4729si1995779pjy.57.2023.10.04.11.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dWftD498; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0861683F02B1; Wed, 4 Oct 2023 11:57:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245031AbjJDSz7 (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244720AbjJDSyb (ORCPT ); Wed, 4 Oct 2023 14:54:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3278C19BA; Wed, 4 Oct 2023 11:53:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFD2AC433CA; Wed, 4 Oct 2023 18:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445633; bh=ypj7rmODurA3z/UzEOTAbR4NZeN+HrhD93EAgqGeHr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dWftD498o2QH9qj3mfNM61PvQPNOOCFsL6yLDsryUp3K8244fiVHlVbOF/xkvFm9g b9uWjpnYCNxtS3X5PjqDGFnyintMnbA89RUvnMe7/l8hgNxa6lrDc9nijkGxLEEwv0 +dBp0TdN2kt9evt6TrV+4tJyhBr0AvQbWdkREVCxZCLI0zkTxQKbOQoZeivSDjsLBa ljJK5bJCciHhvU4U+1JvRqlfCBZmWflhbPHvxXY0NploZBhHVC21mSCcPhKguuPdsB zmU4gyTR1Xk6U8h7kS6vq+DFfieAQtr8xJBx6+UySBTOtqT2z4nss7PFeQk2uS0Avl o6YHz/j62ybdA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Subject: [PATCH v2 06/89] char: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:51 -0400 Message-ID: <20231004185347.80880-4-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852446926868735 X-GMAIL-MSGID: 1778852446926868735 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/char/sonypi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/sonypi.c b/drivers/char/sonypi.c index 9211531689b2..22d249333f53 100644 --- a/drivers/char/sonypi.c +++ b/drivers/char/sonypi.c @@ -920,7 +920,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf, if (ret > 0) { struct inode *inode = file_inode(file); - inode->i_atime = current_time(inode); + inode_set_atime_to_ts(inode, current_time(inode)); } return ret; From patchwork Wed Oct 4 18:51: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: 148478 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339683vqb; Wed, 4 Oct 2023 11:55:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+qZb9xTeGa164hoqW0St+1XopgTXN8anJvzsVnrQKcwuV5HNoKaakpecciQqSh/ZkmHqe X-Received: by 2002:a05:6a20:6a2b:b0:15a:7d2:a418 with SMTP id p43-20020a056a206a2b00b0015a07d2a418mr721926pzk.19.1696445731506; Wed, 04 Oct 2023 11:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445731; cv=none; d=google.com; s=arc-20160816; b=dtjYeGnP1lF9/+KEXYXYDaCK7Yje87FZMsa3ZfEJxx9OVNya8lqA1+yqk+obp0+FSZ Lmyf3pKIaGMMomrwLxAvsB8bMEvI5hqBy7Cs8jnQEvtMOyTTl+jC8BAzAl6ZBz8FNjKh xWpbw6F7z5JqXzWjGr3Hj0vmaO8GQbSTjvbmbaSOk40CDUbR96zg8YWMcarfDzMM64J6 7VJsUMG/w1BtdRj9KYIW/dMQ5LHKT+mLtmJ+veFnTDT4nSEcqqI9LNiTcTSlOeXwRqOf hHgn7ZvrVc+l2z9pp+N8Z5nmrbMEsE0e0UDGE3Xj3JKsoFDSF6Z1KkkbtGpHSHEeuMFn 6sFQ== 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=TNkgBsMsE5F4aPBYUzWfSHxVkNOas739NvWaT9dkkZ4=; fh=4hjXy+Ew9zLbKbPcMTIRIHhS9JFJb7yUsoehK99e63k=; b=0qPEfBOqTwV9Kcs1dtPqdnw/vNW2WjIW078bETP2J8KZjH+D+TxGsCOouFVQ4xtsEF F0FpnyIz25auozdv1e72CsucH0HiJk5jnne/YVBuAWRtYFG1Ky6GW2+PQQ+C0h+vOMj6 WHljD4Ac8QSZ9DOws0VK/pztmBHTVovuOjcs3H8JnKen025Y5h1c3rlAx1+e6RYoKGXG 5uBeMnr3MWHQjYfKzc7PYGg1OHbu7PWx6oY1grJrhpu/4rMmqAmSZahL2uux3OL30QBh 49QbrlsVS/euZSpRxdVno6DzG8P2CwNkfCR7pz+6DdDKzxblj00GPkTqicMEmEYOdMq4 1ZoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iDoGTPkz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p30-20020a63951e000000b00565e9c3a308si4391381pgd.788.2023.10.04.11.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iDoGTPkz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6E64683EB31A; Wed, 4 Oct 2023 11:55:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244715AbjJDSzV (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244722AbjJDSyb (ORCPT ); Wed, 4 Oct 2023 14:54:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEB7F19BF; Wed, 4 Oct 2023 11:53:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8165C433CD; Wed, 4 Oct 2023 18:53:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445634; bh=OjZRsVOhL4N5a68/cSqDR7Hd40kPAU0k6mob5huCQzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iDoGTPkzLTFKZF8o1zfAcpwFb/FP2eM4KayhXfGi5bZJ4aSlAByMBCv9bO3VjAJlf oRMBMYMieY7ATM/k9oYCRgsW6qaTBMh9/efAuFZmcPed+iV0t9zyxjRCKDi61nJx+x bLcE8B1TFNkvKtLc8ULX/epWt2tLFMB9T9k1uSiEKOG+tkiLYxfQYrBmMD62wjaot3 f0xQ1Ly1ezhNVE6B/h2veLzjfNCBIwNCrAUwgqrbbUtV78u8LYk654MS2cX5njkdKq mG61M3GDiD6bsmdkkVo7f0bk5q8v0id5DA5E5dsVkoI7ObiAgZoCa4I0NiR37Jpsr4 snR3sjNF9vt6Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-rdma@vger.kernel.org Subject: [PATCH v2 07/89] qib: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:52 -0400 Message-ID: <20231004185347.80880-5-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852279465750690 X-GMAIL-MSGID: 1778852279465750690 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/infiniband/hw/qib/qib_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qib/qib_fs.c b/drivers/infiniband/hw/qib/qib_fs.c index ed7d4b02f45a..455e966eeff3 100644 --- a/drivers/infiniband/hw/qib/qib_fs.c +++ b/drivers/infiniband/hw/qib/qib_fs.c @@ -64,8 +64,8 @@ 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 = inode_set_ctime_current(inode); - inode->i_mtime = inode->i_atime; + simple_inode_init_ts(inode); + inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations; From patchwork Wed Oct 4 18:51: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: 148474 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339500vqb; Wed, 4 Oct 2023 11:55:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYo9gmYzr58/d6e16Jf58rBK2nDEJ1Xt+PZ2sUxEnyQcd//8y2ltLCsC8uG/8/2enhoqiu X-Received: by 2002:a05:6a20:549e:b0:161:28e0:9abd with SMTP id i30-20020a056a20549e00b0016128e09abdmr3797228pzk.16.1696445706542; Wed, 04 Oct 2023 11:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445706; cv=none; d=google.com; s=arc-20160816; b=AI/pyVVuo+vfEZxaGxgrV9VVYVyRv9/wphRTv1z7W64rm8OzveLfz2lB1sU2KMyHoG Y4i5higdbEOW+Xjqrzad0nWw4Uv0L/LY78XImg5ZMxPiXlpd6OrNJXhtwGouPEc6o0sA FZdyiR2MNKOAwBAn5aRv4n0hnuhS1Z9eG9tMSmLrRzhL+RWXHjS2Y2AnAFe3BNvZ8Nwl SdqrvKkFYp8fBdviXk9hbODY0igSsgWVFY6QZAspEgjUvcme6BFf2+tyIDlDM0d2yVfq xBtCl+COagA/iax/b6JxRl+nlpuHc5dbPnb5QnEMooRHVSjM9ZP3+8X/8JGhTCJy1Zz1 Q/ig== 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:to:from :dkim-signature; bh=2KTg7KGTmFkvksi5+W6S3ZWAweESuHoXa2mE84FgHsE=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=bKyYv95uw6qLnZMrXvjBEoSB7hpSXa7JaTlgaTytDss+IALAdMDuZshiUqZ2opZCy2 ygQJ68tGoRVZrMCxI8h1m5FwuT5TlguFKJFcJ5X2/UktlJasipHiFjZ7R7ptpTtPBYm/ RZinoVRGrv7PVlg6Npso9go0TwBlmUemuzohGwd3Ke6OuzKQzmV/f/GxwgYS6qwnvRrJ aSN1dHhHVeilo5wMCfxxnEr+XvC4uJxNdQXwxVDVlveTC2inZb/XS+jxA0vxeUNN0bf0 GChcBwJCO94gCweI79cqg4X+b0fqLdYQHIu32/PWhmJRl96zFd8fnX2N2L3gtsYIFvqw rkGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dL5McEqj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id br13-20020a056a00440d00b00690bd178205si4214486pfb.215.2023.10.04.11.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dL5McEqj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2979983EB31B; Wed, 4 Oct 2023 11:55:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244584AbjJDSyt (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244613AbjJDSyb (ORCPT ); Wed, 4 Oct 2023 14:54:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5733AB; Wed, 4 Oct 2023 11:53:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED9F8C433CB; Wed, 4 Oct 2023 18:53:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445635; bh=+m4vHtTCSivPH1utLD9McAoOUgvVr+qXDjYigg31yRk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dL5McEqj3tHHiMI8N2HDvNPgIJHqCPclzoyprEQR5qnv0qpXaCUctb1Qq/by+GVUx b/eSnKYruYk53EzBHW+JP3A5h1DftIXq50aZulipUXp6twy0QctjUykGM7soucI/Fl rNHNbtuB+8i62Tb6oUJ5cIARp3tpVPpIn7EAHEqTdOuhbPTmHywDOJyEYg3a9tB9uH fS5AWKfhSDiD0CrO0JuoPt8Rhv2DERMu5yStid74AoENr8nunmrx7fyQgWkt3Rtw6C mf6Uk9SFpQZmh40MkVeJkwIQF5w15Di2PEZ5kShqFMTGOTHL31EovK40LunOPixtGg /WbLSO31sI6fw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/89] ibmasm: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:53 -0400 Message-ID: <20231004185347.80880-6-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852252998635119 X-GMAIL-MSGID: 1778852252998635119 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/misc/ibmasm/ibmasmfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 5867af9f592c..c44de892a61e 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 = inode_set_ctime_current(ret); + simple_inode_init_ts(ret); } return ret; } From patchwork Wed Oct 4 18:51: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: 148473 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339467vqb; Wed, 4 Oct 2023 11:55:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFkyAJNdwl+zt4PGIWMWDvndNn/cHNV1RebtDTMFiNcOwMwCYM5zEpiSvyferbCQq5AM7r X-Received: by 2002:a17:902:e5c1:b0:1c6:777:712c with SMTP id u1-20020a170902e5c100b001c60777712cmr3846917plf.51.1696445701327; Wed, 04 Oct 2023 11:55:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445701; cv=none; d=google.com; s=arc-20160816; b=KLY3uHO1PwfxHv5XaxK3ohRJWWHlFamOT66rZ2Lw+GXs0byNbqMCDLYJOxAhiMyCNO 2+rxR7KYSwoLWqJxBSSQqn4EF9H99hSygv6lEekIZfNnLK8xEZLdpadmX0HtIcVrwLVh oHmmscKnryAfwoZ1jVXxE0KdWrhNwqx/33ynGkYzAjODgKwx/jiv55f47vjfDAoLNuvd xbfo58SS9v1XzD2yk0lrHqrPvA4+2V8fL66OZshbaI/r/m2Fhgw4jEtTfPmYBUaEeVx9 fmhiG/lFE8G5IujXlam16Uj9ubUo4NiTRpUULCb4DCWDBWLz0oEECNqIhtQ2M2Iv3NJP btuA== 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:to:from :dkim-signature; bh=siS8hfE4h7osZepl8GMTn8v3Wv4xrfLVRngsGhllWb0=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=riNsmrWNcehp6aA3+fNuiwVy/ZrFpQJsZ6+MhMLUj9JOUoDRLfCUjUDvRbu42WBNKD LjfXpg182w/Lb4zIO8Kikt1ZOHoxFbtUDCI44ulO2YuuS6qKqK+77Nab+Fe6htbmvs1F yRks9cXHAxyzGS/gP3IDWj0v2PWKjdSFMZN51Ee7vRkJgjPkWthyJqvvCg+5ApMR68qB 1s1BeH1spM0SoTvMA9LZtgGoBNNVNer/dX4pOZdEWGQRa/vR116Ytn0zAtDGsgN/c3oK M6MU2b+/LsEg6yAQte5qJZMZdK+dOQ0Mhc5bZkWckABaOELaZmn6/ZhHf2e9p8nQszC1 QGVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OiAQYCLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id r21-20020a170902e3d500b001c3c94d212fsi4129686ple.97.2023.10.04.11.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OiAQYCLA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7F85583EB325; Wed, 4 Oct 2023 11:54:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244656AbjJDSyw (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244551AbjJDSyc (ORCPT ); Wed, 4 Oct 2023 14:54:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D45871AC; Wed, 4 Oct 2023 11:53:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFA4DC433C9; Wed, 4 Oct 2023 18:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445636; bh=xycpCLpfZO5cWJqgRoaNPhUR3uWaHBiSqgCz6ZToHjc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OiAQYCLAzdDweMJ9wL+eTqCmdPkm6tseNh9Zfa6cWPbZem+bl0BLKgVyv6f/1ujMZ r4LTTHGRz6f2FD0GvaqKWaTt7/6DYP30eXLmBQZRziwld5Zhz8DuSWs3uCSipqttLy tsmkoJUQ8SvOS4/3pZghQMyoQRpmmnV94jN/vHRimdPY23LCMy+wKXrTYFbtL5FY6M ApJDt7gUTdBABgE9kyPdloigdsqhTcyRl//eplho8rF8dOew+GFRfugRH5wuxZFuNs dEr+NtSgTKC5eVIn4ntOkUo3MwLUM8ohQCSbGZHW/Av0ZMGpfqiQt7K4IXk22GoYrB VKyrdvKNfvuMg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 09/89] misc: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:54 -0400 Message-ID: <20231004185347.80880-7-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:54:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852247665888478 X-GMAIL-MSGID: 1778852247665888478 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/misc/ibmvmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/ibmvmc.c b/drivers/misc/ibmvmc.c index 2101eb12bcba..7739b783c2db 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); dev_dbg(adapter->dev, "write: file = 0x%lx, count = 0x%lx\n", From patchwork Wed Oct 4 18:51: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: 148498 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340413vqb; Wed, 4 Oct 2023 11:57:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEc/8Ll3quRjEfGEuVDFLNL2NQZT0aIFRgN6fxdyhwFsVKyBSs985EffAjb/rgFz4sK7YBk X-Received: by 2002:a05:6a00:3118:b0:691:2d4:2389 with SMTP id bi24-20020a056a00311800b0069102d42389mr2483617pfb.21.1696445832088; Wed, 04 Oct 2023 11:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445832; cv=none; d=google.com; s=arc-20160816; b=w87alImGRLfa1ytbZIgrTdS3wfRDqRHodv6YGqLdexBhA5rB+uC03bPJJpGZdC1KuJ mlr+mIxQmzdXR+He+zQIghNGQ1lV5OBnlRd+/NBDhl9Akb7j67TkGtscxTnTdcJfxMEp m0G+09pH4DGh7johfAU9ttyb61Z68+sd8hrXVrcp5ysYAY8GwW2teXAmY2uPwiKlPZZj Cpjc7F+sN04MO9BOCdpVbQmVroFivPpNKyOE7LylfJlC8Cvlt+cBNJ3g3vC7DR35GKGu 7OY/rHJe74NYakBnApc4QfDZAaG+fOzDliFpB1c2vPOnVjrCe/PN1UKSLm5Xc5sSX4YE Oecw== 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=IHqPnh5NO5koOfHm0kuppPJ5bKCooHMBngdappiZq9k=; fh=+8yfMUekUhCQzg47WX0vwKLpcMT8BNCzX6xaRcIjE9o=; b=qoxkzgYDXtf8w97laWF0yNcbpG+CvYrca+O4ORxPZVGT8JxGHGOg6kEOm8CxeVf3b+ knFPb9+C6LIxN3nNO2x79EffmD/yYkGTYh9SOGJful1bBJ0bxDdVZvA2/S8X8b1hZsOL zmcenOXMcsmrdM+a8vFQqxM18Ak945Dl5mqOcRDO6nNOZ/zjQAaLiBEnn3oqoG7UWUrJ 1b/6tfmmWzGyM85XfZ86sHsmUeDJXstulaKp85xE/NEMjuH4iZTk7dxh2S56HeqnzxQy 6YOioEMxYAmX9pWOe2TIlsVwDXeAyNFtsySThOS7vX5WNemgGrAhQRivo0RTZY14XHb6 zZOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cYjQcmal; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h21-20020a056a00219500b00690f0a78ecesi4321936pfi.315.2023.10.04.11.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cYjQcmal; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 332328052BFF; Wed, 4 Oct 2023 11:56:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244849AbjJDSyz (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244668AbjJDSyc (ORCPT ); Wed, 4 Oct 2023 14:54:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06C29BF; Wed, 4 Oct 2023 11:53:57 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01300C433C7; Wed, 4 Oct 2023 18:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445637; bh=dXqgQsJjfAWhvfig5etpj934h1JjwrT6x4JCfVoFzuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cYjQcmalERu9mI4bJVS0/LehJ2ryG/ntAm3KL5pbo80fBsuWh20qXdy4/bDFLr6wD ARk6GO3LTKmqtMMVv7s0VfutnxuWU51m0jmDgvjlGu8HrLui55Z0YNx6205PJST21W HEeV082Cub74DzPlkzit9wFivuCjMO6ImWf6zXdOMZSGGHovTwGmKwUi6MlJGKA4Zt 05EmSCltohrDA59hOHEPVUCdM8jWeXKWlEgB1696q0Zs7/j5FQ/YbFEFjgJtSOYTlZ ec939jJTnwrZerGLxBDgq4ct8tUO0tT1pxoewjM0WiRu75DQ+U2zrLE/DHLO2CqjSh TnT52D0o/GyuA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: platform-driver-x86@vger.kernel.org Subject: [PATCH v2 10/89] x86: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:55 -0400 Message-ID: <20231004185347.80880-8-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:46 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852384818001833 X-GMAIL-MSGID: 1778852384818001833 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/platform/x86/sony-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 9569f11dec8c..40878e327afd 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -4092,7 +4092,7 @@ static ssize_t sonypi_misc_read(struct file *file, char __user *buf, if (ret > 0) { struct inode *inode = file_inode(file); - inode->i_atime = current_time(inode); + inode_set_atime_to_ts(inode, current_time(inode)); } return ret; From patchwork Wed Oct 4 18:51: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: 148495 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340359vqb; Wed, 4 Oct 2023 11:57:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGO23cPR9+XlnAtUNZSl5xkBGAQToPbnKf1pLGIVLH4EFwLQKX1o8jYWl5i6HrQP4ZdMygd X-Received: by 2002:a05:6a00:3a02:b0:68f:ece2:ac2a with SMTP id fj2-20020a056a003a0200b0068fece2ac2amr3326480pfb.27.1696445826999; Wed, 04 Oct 2023 11:57:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445826; cv=none; d=google.com; s=arc-20160816; b=auexXYj3EGG5FisP0f6VKWv0AJrFq9JY6Akr3fMig3p7RkdOq9y5HyPaSaioA/fqPC waRP3BjkvrNCiB/KPkG6a3JUAZ5dpvayNvUx5t/4MMPXDlKkwfPfZiLoQVF09YDyEYQo KVKPYyxO+SzYsKgD3phzXkzjEqHGF0aOLf/0b7ZtIwdk1Bh4RMfzEULG9B4FcRPtYXfH tIBnXSOY7eHJtyquZgFbfOQbYKCojTD9AVbbC+mUDJGLgkQxi9KbMw7avTm/7YIFNL12 eR1ivVXjiYbgcY/TlAfKkG38eNHA/SV5zEcHdg/KF44sgnvX43NJ2Pb3MW3C7MIBP81A 1vSA== 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=U4wpQWUGzifEjJdjEw6rI1fxJBh+1RMeGTM7uwWT+uA=; fh=xIe+y0AIA/13BB/Cht5aiJtIw4tu3ICDozyOO0XAK3c=; b=a1CIXrk0MB4g1iYQRbQLzt+8zQOCYjVpqF50z4Gf8u7ccyVfVNigF+/iHmu3BuD5wL 6I9yTy2CXZP/3qdp1tnWEgyESnlAnkIWRcxZd4qj/ykjkP/Vaq8l/Szscuqe1kW/Bbdj 3JD6o71Vosot+qDsHOX7d3nxl7N6YQLr89thikDcanjgBY8Z8Nn5c92AQVhy9PtnyCfO 1LGXAl7ATb54dg84mmKO+7ScH0yZEkBU3h4TpPy9xPJXv5s0Qv/zxPiG2FGIqO40gbzJ U0kRcpx7tHa6g046avzc+dwsTi/HiPcjRsKuTw/IDz4hAnECVpzdO7Qm1b9gUhxuP8AF FOaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JK4zl64w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id cd24-20020a056a00421800b0068fb5ca50cdsi4122038pfb.126.2023.10.04.11.57.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JK4zl64w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 36FED8098413; Wed, 4 Oct 2023 11:55:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244689AbjJDSy4 (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244555AbjJDSyd (ORCPT ); Wed, 4 Oct 2023 14:54:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C17931B9; Wed, 4 Oct 2023 11:53:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1834BC433C8; Wed, 4 Oct 2023 18:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445638; bh=hZN4D2LR8rX2IepRw2s44AxIsoHnPwI3Eb9y8mHRkJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JK4zl64wCK8ykXQg8vk5HEV4//9DGnJiz4Zp1YPsTgutEakWwDZZjpgtjlglhi+0i aGd8qlG4Zlck0WAKGtWNAb75q6Rx4QHd2gQie0CJhKt75QakBFc4o134l4iHIAIdtX m2MIvlxVBWL05psdjdNXW4oCKSHk/e6YPyqLsI1aJYlpf7RsXVPOonE+r07QEn6kyK mTgI12qEMGsIjp9yXe11amt060B8Uho9nntQcpkoym7wE1Z/+9IxdhRCXVLQ4dba8r hP0zbvBAeolWi2tpnL8AKRhRRdYjyeSeuz1moemQ0fRhFZZxXlaXtZ11xuZe3fAWJ/ F8dCeU0U/iHyg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-serial@vger.kernel.org Subject: [PATCH v2 11/89] tty: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:56 -0400 Message-ID: <20231004185347.80880-9-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:50 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852379310697626 X-GMAIL-MSGID: 1778852379310697626 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/tty/tty_io.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 8a94e5a43c6d..d13d2f2e76c7 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -818,7 +818,7 @@ static void tty_update_time(struct tty_struct *tty, bool mtime) spin_lock(&tty->files_lock); list_for_each_entry(priv, &tty->tty_files, list) { struct inode *inode = file_inode(priv->file); - struct timespec64 *time = mtime ? &inode->i_mtime : &inode->i_atime; + struct timespec64 time = mtime ? inode_get_mtime(inode) : inode_get_atime(inode); /* * We only care if the two values differ in anything other than the @@ -826,8 +826,12 @@ static void tty_update_time(struct tty_struct *tty, bool mtime) * the time of the tty device, otherwise it could be construded as a * security leak to let userspace know the exact timing of the tty. */ - if ((sec ^ time->tv_sec) & ~7) - time->tv_sec = sec; + if ((sec ^ time.tv_sec) & ~7) { + if (mtime) + inode_set_mtime(inode, sec, 0); + else + inode_set_atime(inode, sec, 0); + } } spin_unlock(&tty->files_lock); } From patchwork Wed Oct 4 18:51: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: 148480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339703vqb; Wed, 4 Oct 2023 11:55:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEEoDy9hZNaENgWh+iHHZCDMumdgFTWV49QhoC4vWmEzgW9v5pQvOpSVSTHchmgpBbNe4Kn X-Received: by 2002:a05:6e02:dd1:b0:351:5acb:271 with SMTP id l17-20020a056e020dd100b003515acb0271mr3036265ilj.1.1696445735120; Wed, 04 Oct 2023 11:55:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445735; cv=none; d=google.com; s=arc-20160816; b=UbMEOJSJkq9WFlHSJBj1J9Ub6nC6VTh3FzE9k5Wb760v6lgHjemqYo0jf4YvUOAgcf BH2togIXd2JfL/3OBrp6PkTtzX5tR61wn7k3nk5DTsyfcoctfJJjAEyA4316v76cm6if V56UmNs1aEaTE9vVNz6SwVAV1tJ5pfmoUSFpj93ahXoiogJvWmUpV5eesAFvj6Ndvhaz dmva33i9uB4Ir2pboYC3DXnePjjiRVcnLzYSco67JTNsyV0cGVib2djOMmYTD50e9CtE 3rzilXfqywMZuB+bIAsQYrEiaXCyXbvyV8DMj8K4XBoZETjcWSflsO1kNW6bZjv3rurf JVaA== 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=fL+EyVqkBTYExpCM4k1FwIrKsIo0k379SBAdFSF6Oy0=; fh=aPoMQYeH3F20yp3HXGkR3ALuDT4a0EJUzoGf/IQZKok=; b=0nri8Unpi4zoTzK01LD8c91N8x1kr3NvlMvxLPh3Lsshl+GkUhZ/pN5Px1WsW9Dsnk kxYsUBQH7/8xeh9SB8DJgD+xrmrz20linMMAxrZD08bSXBBGsNp/9pzpy2qudvoj/AbI TjX4h5psGuom5S6QlTLcZvLFz6amPwMz566ynwxMkRYwy24QDJT2Hl8O/4mpqfiV1LEw PjCi2cC3hHAuAR4vAZH1Nda7C3H85g/lHvUUh/d/wP8nVAJDNrU/N6OCoUqGboXIFwyU tL+d7h/PIKjB03d9USKgxFA/fYYjhrOG8MXX5yZ0K4RQPtfhAVD2WStjTGykHI3L5UWY Fgcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aWNMv/15"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id by17-20020a056a02059100b005859b1c086fsi4643402pgb.532.2023.10.04.11.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="aWNMv/15"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 86A9C83EE9F9; Wed, 4 Oct 2023 11:55:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244624AbjJDSzZ (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244670AbjJDSyd (ORCPT ); Wed, 4 Oct 2023 14:54:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A261BC6; Wed, 4 Oct 2023 11:53:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 29917C433CD; Wed, 4 Oct 2023 18:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445639; bh=hJ13L6+0t085ntXpxQD42WXHyl1kwHHYbjDB4aBhDeI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aWNMv/15ARZhZhz2JIW4IT6BxNZIhAACW1IpWm0oA5a0Ku7/GgtXJemfhpVudk59l 5TX1yy/V28obFUalsAn2irlBZqK4IX+8M05sQiNWwaPmDE+RV7rjbYMGz3XTXZEW6g 2rXQ/vgtA8cpZ4DgnSomxppCGHmNkZTfBnm/zpfy/0fghx4/xx4hPtJ3msfs437il7 0N1S6+RtCDL5wMmnG4xbxq9Iyh4li4JUCRW2J8lbo4g1AKcXpSb3i7IuxlNGXFrhKo GargV9EdMqWGJ1gNyFpiopMdi/ljmC3utqxNumBMbn1wk7Tftp4WaISQiWgenC2xG1 c4yMnckWz8Fjw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org Subject: [PATCH v2 12/89] function: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:57 -0400 Message-ID: <20231004185347.80880-10-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852282959216045 X-GMAIL-MSGID: 1778852282959216045 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/usb/gadget/function/f_fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index af400d083777..efe3e3b85769 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1383,8 +1383,8 @@ ffs_sb_make_inode(struct super_block *sb, void *data, inode->i_mode = perms->mode; inode->i_uid = perms->uid; inode->i_gid = perms->gid; - inode->i_atime = ts; - inode->i_mtime = ts; + inode_set_atime_to_ts(inode, ts); + inode_set_mtime_to_ts(inode, ts); inode->i_private = data; if (fops) inode->i_fop = fops; From patchwork Wed Oct 4 18:51: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: 148475 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339553vqb; Wed, 4 Oct 2023 11:55:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSwsVIsmj+ba39eV+XEolOvAuDZNrGGs733x4x68xOGZckqhGLJ9zeJ3OjZb2liBLDF1ND X-Received: by 2002:a05:6a00:13a9:b0:68c:3f2:5ff7 with SMTP id t41-20020a056a0013a900b0068c03f25ff7mr3715366pfg.1.1696445712715; Wed, 04 Oct 2023 11:55:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445712; cv=none; d=google.com; s=arc-20160816; b=QmjgctCwALMnyRI0ownPxY/0tWMZlYBvXqPO4CvoY8/dZ24rMMH+DU7gPRtUiNZHAv hDdHoMerrgfTIwh2IKTmu0z/DJorDfSulA6e+ObK8asSW1kMZ3iHKHKzRdHs0IB4zkCv mDPmZ/xmuXS1EXpWDGna8Ja5nNBrU3EfvQLwxfukDHFzi5Y+ufHnkXv6eQW3/kN/c+7b b+lhv16x3/OpWP8NBY90XYdal+4iXcmSm6QekxgbjepAiILZW9srrLcX43yK67KWpzpr rko3lEgEM4Tczb4HyFw+53F60av7uHAhMfhhSxvdpVv49rjygohZ8rIKNz08A9vjOReE QdQg== 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=iejuGJ5RmW2zjHpNvqxGawaP/iPHkH/E3cBe4RhuNAo=; fh=aPoMQYeH3F20yp3HXGkR3ALuDT4a0EJUzoGf/IQZKok=; b=HzGSauIoBsqwuHU9ZVylB1go7W+qmsAy+tdkLV2sYnQasf49mVjpeO4vtD+8Y3EzdH kxFWcRtVpLq9rolAHZVoH6AZ0YIIUitUPuFv3DpXCbb+V1v/is0y9BimXGEo9ujrTRL5 maNK7spdU5kaoO6fLq2DysqpJcjZYqsspbtYyhLYr42UNgr4658LDq8xDP9J6w7Jsc8q OvNCIj3e9PApqPwDR/VdsSrC4ubz6eOb3PwPzNu7g6uvivjVwVISVENfbv52lzIytlLO DCzBb8DPUsGhNdaCvlFfYKsXUqDQSfgrLjx/mLYRfx3PbjTaRZn78jp9FomUaeTleOqM EGbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gAhF7P5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id dw5-20020a056a00368500b0068fdeb84453si4203996pfb.265.2023.10.04.11.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gAhF7P5l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id EE57E83EE9C0; Wed, 4 Oct 2023 11:55:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244757AbjJDSy7 (ORCPT + 19 others); Wed, 4 Oct 2023 14:54:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244619AbjJDSye (ORCPT ); Wed, 4 Oct 2023 14:54:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4339D1BD0; Wed, 4 Oct 2023 11:54:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FDD5C433C9; Wed, 4 Oct 2023 18:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445640; bh=kZrh+m6BDY/ck3IWsHLCZAJqaOXaS2UN3A122cBdzhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gAhF7P5lMuXWXH49Rpf51O/OLX0M0ZEsgDfjQrpk9W2DK0YUYYoRh/f2aSH+KL6d5 sgZiX73KgobMg9z/BizZRGIb/g4ShNe7EAbv5CiOoRsKhsfaonx7KRYcPFpD4UN+42 YWr5DBFHgoC0WwTPHZUvCHFP+IIdtoLMYGuB+JfOdzekgLCmjOyTPjxxUgadDKFXrB GpulwzDj85mve/HJCVE+IEVzBDiJJLduRqeCpk0AktG6V11OnymLPp18Z8M2wzZE2S UDchCCh5Q4H5W+VYlrxt6ZRID9uJAFYOxagHFZi4vfLBCG36iUNdQeU0FCpydHksbH H7O4/nPJ1qP1Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org Subject: [PATCH v2 13/89] legacy: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:58 -0400 Message-ID: <20231004185347.80880-11-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852259360462610 X-GMAIL-MSGID: 1778852259360462610 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/usb/gadget/legacy/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c index ce9e31f3d26b..cdc0926100fd 100644 --- a/drivers/usb/gadget/legacy/inode.c +++ b/drivers/usb/gadget/legacy/inode.c @@ -1969,7 +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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_private = data; inode->i_fop = fops; } From patchwork Wed Oct 4 18:51: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: 148476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339614vqb; Wed, 4 Oct 2023 11:55:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEj0uB5coxSeEGwd2M+Xbr/quzrD7t3JDfjIOCW5u1I9Z3QFCGGvJ8K1ocruDhsNL6nNna3 X-Received: by 2002:a17:902:be03:b0:1bf:4a1f:2b57 with SMTP id r3-20020a170902be0300b001bf4a1f2b57mr3072347pls.13.1696445720781; Wed, 04 Oct 2023 11:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445720; cv=none; d=google.com; s=arc-20160816; b=F7tfAi2Ch1uCL0NCGmB6X5F5sUp8zkFBDG5q9NEpWUEsGcaiqD9YRifLJHcpj3gWG/ AtHxjwotyRUzSWdR5xp4jvwHYE+su1yNf/EifEFW5Ssojb7ldjVCyEI4yxRCn+9W9/Nq G4zmMY8st80yFVpZQK4mTSCTevy99Y8x7irPJqPEcmHwC7VxT17n6/txIte54b/iUadn lDQaT8L7dsSDZj3SYKqxmRdTDIQGzV4+ZpdHt7LFaj00iM3MAF7yMDmMavPvfT+tEwbD 6zo6dOU4leCa/3Ui9Cq1CiAJwHqE/8Y5q6wCfndX+0pV60se5XQHkyQ4669c+ZglSCbh IyNA== 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=eS6IpZmSFGN7slEQI7z9lb7w9NWmIC5INShYdOH8Ntc=; fh=aPoMQYeH3F20yp3HXGkR3ALuDT4a0EJUzoGf/IQZKok=; b=Aa04BgcX9CUhbXoqp0Ovye//WLfq05yHhsFbIFzXZ4Ww+NzLsPG9qCu4M8bC0oTTOm 3yfaFXqJeDNx/tw/Fu3llASEsZ8TSLa/xleMq36HGBeJ1oLx5uL36bBF2eEQG0i7sX8K dc050s0UmEkAyxqXcJQg/5YH7Xj+OYfJHbRWohktsjcCYqv7IZPSC0Jls1R0isvE657m 0DQ+aoNYAW2JieryoZ1iqIYCN+gSMqLG4Zb9QvtdJEVcv6ujuC7JIwvS6X1SA8ZC42V6 QLAP0yUFU5VnPNf1VBM8m8CSULnvqRphSoVGzjHxNOxKMgroA4sYT3fxlFcq1L1kqFJE qixA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lMzzUiYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s18-20020a17090330d200b001ab089f7329si4017366plc.73.2023.10.04.11.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lMzzUiYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 841AD83EE9D7; Wed, 4 Oct 2023 11:55:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244595AbjJDSzD (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244632AbjJDSyg (ORCPT ); Wed, 4 Oct 2023 14:54:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E354DC; Wed, 4 Oct 2023 11:54:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58CB9C433CC; Wed, 4 Oct 2023 18:54:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445641; bh=aL1npQRaDyxdHQaKUM6htVz4FWw9EZM92Fgw5A+XXLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lMzzUiYmge9Kq/nics+ARjGwK5zm37X+AARlUtLSvvB84nkLMgyhLoFLrqdZS2FI5 TTKxgfHNAYt0gynJx2ek5ZMptrQWACq6lcQNDaZ0D93HlWy8gFwf7HL4TFJXvRkub5 T33ZENW1Fad0h1irMmnfTzYogqAcFbkOaFqdd2nBqn2JJbEPzZBAZb2XzWbjpTzLtr 6bcWEGpEeCu1RgsLF6AQ+SF1N3Jw5vUZme8hDoEMXlyMcChB+jbsqcKLjh2xCaTc06 f+jDTaaiRn2qThPmXfI3fzj1clZ9RjHOpyZrHJ3cuTNiBuTQFZieRqlSzDqFTOVa7F pDLFPWpXKyLGQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org Subject: [PATCH v2 14/89] usb: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:51:59 -0400 Message-ID: <20231004185347.80880-12-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852268095070495 X-GMAIL-MSGID: 1778852268095070495 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- drivers/usb/core/devio.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 4f68f6ef3cc1..3beb6a862e80 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -2642,21 +2642,24 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); break; case USBDEVFS_RESET: @@ -2668,7 +2671,8 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); break; case USBDEVFS_GETDRIVER: @@ -2695,7 +2699,8 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); break; #ifdef CONFIG_COMPAT @@ -2703,14 +2708,16 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); break; case USBDEVFS_DISCSIGNAL32: @@ -2722,7 +2729,8 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); break; case USBDEVFS_IOCTL32: @@ -2804,7 +2812,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, done: usb_unlock_device(dev); if (ret >= 0) - inode->i_atime = current_time(inode); + inode_set_atime_to_ts(inode, current_time(inode)); return ret; } From patchwork Wed Oct 4 18:52: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: 148477 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339640vqb; Wed, 4 Oct 2023 11:55:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgHcGoil3ph74EITy7Zt+66mDLVTEWXl3fyzilxskmD3TWAA4Mu2KiZU58fbuQTCQEyLek X-Received: by 2002:a17:90a:e144:b0:273:efde:2ea4 with SMTP id ez4-20020a17090ae14400b00273efde2ea4mr2834064pjb.42.1696445726596; Wed, 04 Oct 2023 11:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445726; cv=none; d=google.com; s=arc-20160816; b=A9ps+6Ndx1e7D32vqW0yThFupTeBrEaFASuO+ZsIm3iKv84hp4hxyDzs8yqCfD7eme 1xjpM7oLetaTLTQOGVUGIgc3sDSa7MapAAhCYs4wZdrf6R8Uy/tek0Iiske+QiDUAd8t wsFeCpUjqP72PhJdZ6zupLeKc4lBxRo/EPEntE3vLuEvzFHbqjKwNZ9BNnDX01yIS+lW /3G6hSk7NXAhDigYxgvJcW5UcjqNFMtX8V4o+wP4t7QyW0RNFhfQmn3st99Vy6tGE7+0 wx/79ERos2EKLjqv2pqdq78guiWvJEPAJlMSWCMkwumYmiC6eK0K8muuwMneme0RgjLM WHaA== 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=u7x3KzxraYAidM0zkVTBO5XDZ0OgsdYr9kL9rP3xM+M=; fh=0X1+ZWAKENe79Woy9vzy7Fij6FNDnu7TocbHc/JoZg0=; b=Tgr1bWhVidNvZQmhG+fLusCBbiNxTOMkHNKinY8Vr/HxjZ37+RnnoYjhlN6EwncOoz tfAGajYTPzaM5NlDCk27gY5dBwSpuj8w/p3h1BFQPdPX/7Au/e4YLUmPiX/P7dbV/U0v kFGtyDRAl+sNsacMoZr1imn6o5MRQdG5cN+jRg/jvtr07Phw6GkKzGrnoRJKJM/z/qwT uEIaQ0UWohxXD6JE7N6YgMQVD8Gy3AZgBG8Z750wxdaUAflZEfXyAW5IxDOtB402hoIy +7R8CGIul6bGYNM1zuXIaLvxQOGFTqG1Jd3RDQW9B5qTw9lhu7XTBl5TDkoe6UhnX46S szRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ax0NZpCP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k7-20020a17090a9d8700b0027909685905si2011908pjp.149.2023.10.04.11.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ax0NZpCP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 97F7E83EE9E8; Wed, 4 Oct 2023 11:55:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244893AbjJDSzO (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244640AbjJDSyh (ORCPT ); Wed, 4 Oct 2023 14:54:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45047E4; Wed, 4 Oct 2023 11:54:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EB14C433CA; Wed, 4 Oct 2023 18:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445643; bh=YXOAZwpmSmMbKCHyuLupLOi4EQCnsa9Gey6/PpLo2dY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ax0NZpCPmEOTSvooJuFbBm6D20fN0zJ158OnQZkprETjvEUl1Hw6+yjzvJT9e3RW8 U8Wg65vvaKaxCILA9fZr7kuXCoFu808QagaXkz7BuAHFmocY591c3YS7XOiJodSn0E hzkfEqsy5rBdQHzfW0w9estzT0k9m5iRiS7tsdbILj0uW2lYJP9MHS8mZiEvVumpvG 1gsm0sOm143apja90GRCkN8vqjGpQjdL9F5az303UP81l1HOYKjxGoyzidL+1sq3Sd HayDfuvWBNU6EDjt6DZZatnmdKsARPTHF1nH+Shcu7okfrx14htd6bt+qe2pEhSp+j XeA0w8C+A9GXQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Schoenebeck , v9fs@lists.linux.dev Subject: [PATCH v2 15/89] 9p: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:00 -0400 Message-ID: <20231004185347.80880-13-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852273954138679 X-GMAIL-MSGID: 1778852273954138679 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/9p/vfs_inode.c | 6 +++--- fs/9p/vfs_inode_dotl.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 0d28ecf668d0..b845ee18a80b 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -260,7 +260,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_mapping->a_ops = &v9fs_addr_operations; inode->i_private = NULL; @@ -1150,8 +1150,8 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, set_nlink(inode, 1); - inode->i_atime.tv_sec = stat->atime; - inode->i_mtime.tv_sec = stat->mtime; + inode_set_atime(inode, stat->atime, 0); + inode_set_mtime(inode, stat->mtime, 0); inode_set_ctime(inode, stat->mtime, 0); inode->i_uid = v9ses->dfltuid; diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 1312f68965ac..c7319af2f471 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -641,10 +641,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, struct v9fs_inode *v9inode = V9FS_I(inode); 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_set_atime(inode, stat->st_atime_sec, + stat->st_atime_nsec); + inode_set_mtime(inode, stat->st_mtime_sec, + stat->st_mtime_nsec); inode_set_ctime(inode, stat->st_ctime_sec, stat->st_ctime_nsec); inode->i_uid = stat->st_uid; @@ -660,12 +660,12 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode, inode->i_blocks = stat->st_blocks; } else { if (stat->st_result_mask & P9_STATS_ATIME) { - inode->i_atime.tv_sec = stat->st_atime_sec; - inode->i_atime.tv_nsec = stat->st_atime_nsec; + inode_set_atime(inode, stat->st_atime_sec, + stat->st_atime_nsec); } if (stat->st_result_mask & P9_STATS_MTIME) { - inode->i_mtime.tv_sec = stat->st_mtime_sec; - inode->i_mtime.tv_nsec = stat->st_mtime_nsec; + inode_set_mtime(inode, stat->st_mtime_sec, + stat->st_mtime_nsec); } if (stat->st_result_mask & P9_STATS_CTIME) { inode_set_ctime(inode, stat->st_ctime_sec, From patchwork Wed Oct 4 18:52: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: 148491 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340304vqb; Wed, 4 Oct 2023 11:57:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyACx9pQCWkZy9S4LYPDmWFL6X2nkViU49fVGiWqYto+1qE/AQWZ+/5yc5tKG5b3+yZTNu X-Received: by 2002:a05:6a20:6a28:b0:15e:5e8c:e45c with SMTP id p40-20020a056a206a2800b0015e5e8ce45cmr3574490pzk.30.1696445822805; Wed, 04 Oct 2023 11:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445822; cv=none; d=google.com; s=arc-20160816; b=NEGFQWktCz1PVLPrC+Jt0/WJs1KmIJ7iyGTuPtx9wmqlbf5B6S0dWJnUZWVrTUl1jm +4RZwPCs/BzZU5vV7xcAOTJNCpBDWVyQU3uwMcwtnrQldC930nvnBmQjlzpyiP/O0PSK H6Y/rihEjjUYGReT1/zFY30gNmThPv4NB8tK0XvEcLM5EDtsn5gs0O0AkRisanZvQ1CZ 6r72/noVekK+1yQxaNV0XkCVGoWP/TWi1AjYctx81YjON3BXLLAots6B4cnQkJmNTigP pY4dNc5irmxGNuK0pMsO37wTJquGWFP7AhGTI8kVJw5dABuPE4cqPzPEbKpOEjhZJT0a fixQ== 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:to:from :dkim-signature; bh=zUzi0ecZ6McUc2wVFnJnnf+E9KvB9lXmobyuQr5xY94=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=trmM8sFQAYJ1LCAbMi55MhwtmXMOqYcnMJY47l0LaYrODBj3fKX6J+0dHPHeSeDEWO TvNADuAZop3giVdiE3DmGwVFdgvgS0YuuYK1GnMPczs81boXXdXu7LNQGmcxf7/FAf9G 3j8k60LjjI+o+yYlCnG2ttHbZtHoftE1K1GNHn9ZchgcVM514LT6L7PpjslIic2+jq5P xOG9nNYNhAHVeB8/XK4cx1/YhVlCX8JMqX4GDCZOhbYaAuA2PNou/rYpZiFb8CxMjSt2 tERBawjUjOmKUTbunhfAODqFyZNCBIRn/mB0zV41bfwH2zn9dKhkFGmlcHFTMsZ4CSZ0 InQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EoRc2VFX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l9-20020a170903244900b001bbac6722e6si4726181pls.371.2023.10.04.11.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EoRc2VFX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 84EA6806E551; Wed, 4 Oct 2023 11:56:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244884AbjJDSzH (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244643AbjJDSyh (ORCPT ); Wed, 4 Oct 2023 14:54:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48380F0; Wed, 4 Oct 2023 11:54:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5224C433CD; Wed, 4 Oct 2023 18:54:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445644; bh=lkQRDWuiKfo61lxiPSSdPh1VV4GeCOeWNFYSDC9osaQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EoRc2VFXlKLQGXRZD+Vd/0/PU5CU5y3IK6WGe0dX5u4REbeSleQ0CPdB889hIX76Y kj1y+UCbEOmeA5+KpTf3BcUCHz62hGo5MyONxCwGdrpoU5g7UULnNao/X+OfryAisM Xjj3TaZIZvJ+xkSvZO7NjgQ9cvzHuUA6jM/LsL2/UXUtSeAZcYtkQgPB89ECg20WvB ZVOMaBm2tAZ9KnUgZoIaPaWA+Pc2LmPFCun3oE3JceALTGHu3CRcNwKqzNF6CvOCsM OAj86LIOFrI5iQltOklnTXCjJTyx8yWBZL+3+jDZn4RCQNh1lEHGBBfR+NNSCAF7RZ b7PTk90PaEOkg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 16/89] adfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:01 -0400 Message-ID: <20231004185347.80880-14-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:29 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852374790944437 X-GMAIL-MSGID: 1778852374790944437 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/adfs/inode.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 20963002578a..3081edb09e46 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -242,6 +242,7 @@ struct inode * adfs_iget(struct super_block *sb, struct object_info *obj) { struct inode *inode; + struct timespec64 ts; inode = new_inode(sb); if (!inode) @@ -268,9 +269,10 @@ adfs_iget(struct super_block *sb, struct object_info *obj) ADFS_I(inode)->attr = obj->attr; inode->i_mode = adfs_atts2mode(sb, inode); - adfs_adfs2unix_time(&inode->i_mtime, inode); - inode->i_atime = inode->i_mtime; - inode_set_ctime_to_ts(inode, inode->i_mtime); + adfs_adfs2unix_time(&ts, inode); + inode_set_atime_to_ts(inode, ts); + inode_set_mtime_to_ts(inode, ts); + inode_set_ctime_to_ts(inode, ts); if (S_ISDIR(inode->i_mode)) { inode->i_op = &adfs_dir_inode_operations; @@ -321,7 +323,8 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, if (ia_valid & ATTR_MTIME && adfs_inode_is_stamped(inode)) { adfs_unix2adfs_time(inode, &attr->ia_mtime); - adfs_adfs2unix_time(&inode->i_mtime, inode); + adfs_adfs2unix_time(&attr->ia_mtime, inode); + inode_set_mtime_to_ts(inode, attr->ia_mtime); } /* @@ -329,7 +332,7 @@ adfs_notify_change(struct mnt_idmap *idmap, struct dentry *dentry, * have the ability to represent them in our filesystem? */ if (ia_valid & ATTR_ATIME) - inode->i_atime = attr->ia_atime; + inode_set_atime_to_ts(inode, attr->ia_atime); if (ia_valid & ATTR_CTIME) inode_set_ctime_to_ts(inode, attr->ia_ctime); if (ia_valid & ATTR_MODE) { From patchwork Wed Oct 4 18:52: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: 148479 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339688vqb; Wed, 4 Oct 2023 11:55:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbQLqSpr3cDm+NAa7bWIgaebyHVmVMZF5cBx06+pQ1s/zFuqG6/eg3cssstvbmzlOTAwxK X-Received: by 2002:a17:903:24d:b0:1bd:c7e2:462 with SMTP id j13-20020a170903024d00b001bdc7e20462mr3844803plh.11.1696445731550; Wed, 04 Oct 2023 11:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445731; cv=none; d=google.com; s=arc-20160816; b=jMwftNQYUSUUzb8G9f+pXtPJlfc/yFwZKrYqMtYBHXRrDJwLbICnTbvDPn5i0U0kVj SxS2nnDsd43Ym+aewAzlg4Eb7fCyKetw40KEWOyzAPxjio79VE0vj4737giCYVsuRBCQ oBejaxV1YGZgY2g56ZvZnqwR77zdnYoDIn3maYm/x2ePozURm2Fy89BAElZg1Edk0F5q AMSCRBeTeMjTfcOxfU2Ht6n/2FgdDiyStx0dohkm2wL1HyUXUDnfALNgrCBE6beBDGyF VnMcfm4oUFQ964J04hNvxTdgIjFhZA4U3xw88SFwD6aCPuoGomqtZBgcrsnZxxwk6jTi FhKQ== 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:to:from :dkim-signature; bh=yh7MbjssAApSemPFNv6h8bD1OABMzUhRsT0a583gdjE=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=eY6E674vCccTNnxokPhKwrls314OM/zkPIV+L3FN9m4Qq/OBbIV2DrIlqfDpmvCLoP 0baQxTpJfz5ZtOJLU1Z3LGWAB6Yw4M3YLyX2ZLIiTOOo+rH8BQO+fro8vWlveVfMjx5J BSRtu1Z+4C6PSs5uEUChfTXCKXj+6NI57jfRhxzlQVbLOZRG09pIjEzwXoAeBc0dL2kG 4KvDU0EgNTCwc9WPqfSLw0j4uOKAfBw/OUTyzq5wKSKfvtpq0Gw4J0Z35Y2EONED0G9O 0tfE/bMrhXJiFfQ66SZDZy1Oquk2AD1BToVe+DmEXEkt5ksQb+8xcRxjRSnz2GqtNMzq G3/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QYo/y4oK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id b11-20020a170902ed0b00b001bda93595d9si3938478pld.604.2023.10.04.11.55.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="QYo/y4oK"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9E78883EE9EF; Wed, 4 Oct 2023 11:55:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244623AbjJDSzS (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244648AbjJDSyh (ORCPT ); Wed, 4 Oct 2023 14:54:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E6C8FF; Wed, 4 Oct 2023 11:54:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B79AFC433C7; Wed, 4 Oct 2023 18:54:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445645; bh=dwWfqibgJemP2gjDKO6LNM/P7G5iGswU0cRpE3FsUNg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QYo/y4oKa70cj20ETKx7ox7zliPfuYGoTXTkdkeRKQ1QlZsgpbnQ/InYmQXCdyqss +qeuQDZ5QhVHsWgLMWVOKw0tfyhtZmXTIgeHxPfzmmcK3gIw/wp5LkPw7CvTcHClvG MHSmfyMjkG9I1vbtxsMqqk6Qd3+MA/aXhnsbY6vqS8IWwkCdInO4du5zJLuyGTjEYa RJGj0ltWrjsV0dF6vFtcWye+7rMrGt14EQA/BlDQ8vxT1A+f/BDNuiJ1EJDCacJquR oBIZf4AhPH/KlTfrwMjsZ6FmbvsIXN3xWp2/uub/sgo/GM6WVaLev5Eiza3sCQmfQr 2sEccwCJkjCHA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 17/89] affs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:02 -0400 Message-ID: <20231004185347.80880-15-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852279210896669 X-GMAIL-MSGID: 1778852279210896669 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/affs/amigaffs.c | 4 ++-- fs/affs/inode.c | 17 +++++++---------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c index 7ba93efc1143..fd669daa4e7b 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); inode_inc_iversion(dir); mark_inode_dirty(dir); diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 060746c63151..0210df8d3500 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c @@ -149,13 +149,9 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino) break; } - inode->i_mtime.tv_sec = inode->i_atime.tv_sec = - inode_set_ctime(inode, - (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, 0).tv_sec; - inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = 0; + inode_set_mtime(inode, + inode_set_atime(inode, inode_set_ctime(inode, (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, 0).tv_sec, 0).tv_sec, + 0); affs_brelse(bh); unlock_new_inode(inode); return inode; @@ -187,12 +183,13 @@ affs_write_inode(struct inode *inode, struct writeback_control *wbc) } tail = AFFS_TAIL(sb, bh); if (tail->stype == cpu_to_be32(ST_ROOT)) { - affs_secs_to_datestamp(inode->i_mtime.tv_sec, + affs_secs_to_datestamp(inode_get_mtime_sec(inode), &AFFS_ROOT_TAIL(sb, bh)->root_change); } else { tail->protect = cpu_to_be32(AFFS_I(inode)->i_protect); tail->size = cpu_to_be32(inode->i_size); - affs_secs_to_datestamp(inode->i_mtime.tv_sec, &tail->change); + affs_secs_to_datestamp(inode_get_mtime_sec(inode), + &tail->change); if (!(inode->i_ino == AFFS_SB(sb)->s_root_block)) { uid = i_uid_read(inode); gid = i_gid_read(inode); @@ -314,7 +311,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_set_ctime_current(inode); + simple_inode_init_ts(inode); atomic_set(&AFFS_I(inode)->i_opencnt, 0); AFFS_I(inode)->i_blkcnt = 0; AFFS_I(inode)->i_lc = NULL; From patchwork Wed Oct 4 18:52: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: 148483 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340020vqb; Wed, 4 Oct 2023 11:56:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGkdN2AxPfgUNOJDN4S5akFCrAvcYe6BjVWZOKoycdULYJDjPkl9dV7ElC5NCPuEjdWJBxY X-Received: by 2002:a05:6a20:4306:b0:13e:debc:3657 with SMTP id h6-20020a056a20430600b0013edebc3657mr599279pzk.30.1696445782607; Wed, 04 Oct 2023 11:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445782; cv=none; d=google.com; s=arc-20160816; b=J4fmFTRkO7Wd2F8BbFPQDNrLDwkbjHSNBLnf4nI4LDPpTQEhBQbi/u8TyG34Ni710z edwjTQlAfxWS67iVHzG+HPuOeFZOvqPgWdLLcrMursBILZ418MbzOE9lRAz/QxKeYHDm t5+UGp3/noJoIK0V9f0XFusmaHMgxiI49rRZWS0IGtiLq/Go243iXn5guOEbZ5eV1WCP 0PCIDs74jbjShyhp8Vx9N7iqRR86ys8jQnyYJJtSiBPqwCVrK6efLGZmOTiImvB6KGno CvlTol3JQFNEc81Vnm+6WR/15fIJlY5vIwNdyQXZW6mIHK4m8MEW7M3PIy8ZUqtLMpBS Qouw== 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=a6GlTl+F1zDMF/UtlUDrTHS/TR0c6kSTeS+4hrNQkc0=; fh=vEni2MBgs8NOTTBLK+Ol/uiLcZUCulMCJxVvCzIEaXk=; b=ro9pIyNxJWiy5xs9HT9iosjlMpCsidfSJ+tHGsztHAyv+v7P9EfB0FvXnHyVV0zS4/ D+IlhI/UMhjPgRK/nMZiJn9lKqr///o4WcYoqzyDGOXD8T1B2CA58A4GQUb5l2uxnwGE VF50WciYFvG6MQ887xIPNNUaTjvkqnbEHlVYuUwxxJUckKNkW4aaSOzvll9N4RPs/M8Y 3oO9KatnsBliNW1hh9a4FSZiFkqzagcRz4borbfpOrREFskO0BXf6UZfSMxI+23oeZBc qEF26bbHIch3hjrKm9DdoU9KASuhYDZ1haAEYj8dw1q9VXky1qzerU0BJaHUTu+qmqYT GeDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KkVZKwxJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fd4-20020a056a002e8400b00690b88a9c32si4457851pfb.82.2023.10.04.11.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KkVZKwxJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 0D34F82224E3; Wed, 4 Oct 2023 11:56:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245025AbjJDSz4 (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244672AbjJDSyi (ORCPT ); Wed, 4 Oct 2023 14:54:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B1210C; Wed, 4 Oct 2023 11:54:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D542EC433D9; Wed, 4 Oct 2023 18:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445646; bh=UupUsDht/2Uh1QJSWb9pKVXSuabslAvFgRcjCQxpI+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KkVZKwxJ9W+1ntg6W32LrBtnckVjPI1O6OrCNhGKbgXvI8PYYSTLZqKUCja+XKbqQ YwEcxGwCLPFBqhm3i8+l7C6T7u5bQ0pjcfy4XnySazmC/ZOKSnwG3A8cWO0V68ijv1 79woTxlVLWz8nbG3COTlu9DujVnEH+CEM0ekSvzMZcOGfcAnxFG6b+V5qbdH7whUTQ aciN39+v1Way3qAFT/T5mBqnAmwui51wbXEgUMHTgyEWpIjm9U6lXPbwNNN2HS6Upf 5FMS7cYWto7JStIr/zCIIvjEz+UDEwv1hilzwWCn9VetS+xzX2Spm2piPmuKIpctp6 R8vRIjIZn71hA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-afs@lists.infradead.org Subject: [PATCH v2 18/89] afs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:03 -0400 Message-ID: <20231004185347.80880-16-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852333188528262 X-GMAIL-MSGID: 1778852333188528262 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/afs/dynroot.c | 2 +- fs/afs/inode.c | 8 ++++---- fs/afs/write.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c index 95bcbd7654d1..4d04ef2d3ae7 100644 --- a/fs/afs/dynroot.c +++ b/fs/afs/dynroot.c @@ -88,7 +88,7 @@ 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_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_blocks = 0; inode->i_generation = 0; diff --git a/fs/afs/inode.c b/fs/afs/inode.c index 1c794a1896aa..78efc9719349 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c @@ -91,8 +91,8 @@ static int afs_inode_init_from_status(struct afs_operation *op, t = status->mtime_client; inode_set_ctime_to_ts(inode, t); - inode->i_mtime = t; - inode->i_atime = t; + inode_set_mtime_to_ts(inode, t); + inode_set_atime_to_ts(inode, t); inode->i_flags |= S_NOATIME; inode->i_uid = make_kuid(&init_user_ns, status->owner); inode->i_gid = make_kgid(&init_user_ns, status->group); @@ -204,7 +204,7 @@ static void afs_apply_status(struct afs_operation *op, } t = status->mtime_client; - inode->i_mtime = t; + inode_set_mtime_to_ts(inode, t); if (vp->update_ctime) inode_set_ctime_to_ts(inode, op->ctime); @@ -253,7 +253,7 @@ static void afs_apply_status(struct afs_operation *op, if (change_size) { afs_set_i_size(vnode, status->size); inode_set_ctime_to_ts(inode, t); - inode->i_atime = t; + inode_set_atime_to_ts(inode, t); } } } diff --git a/fs/afs/write.c b/fs/afs/write.c index e1c45341719b..4a168781936b 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -424,7 +424,7 @@ static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t op->store.write_iter = iter; op->store.i_size = max(pos + size, vnode->netfs.remote_i_size); - op->mtime = vnode->netfs.inode.i_mtime; + op->mtime = inode_get_mtime(&vnode->netfs.inode); afs_wait_for_operation(op); From patchwork Wed Oct 4 18:52: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: 148484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340123vqb; Wed, 4 Oct 2023 11:56:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHY/mAHhe5TN+VnuMV5/rRKZlhK6IDOwarnQ9o7KaDj8mcHN64m3hUfIKqPhfBDwGS+RgrP X-Received: by 2002:a17:902:f812:b0:1c6:1ddf:5c3b with SMTP id ix18-20020a170902f81200b001c61ddf5c3bmr2936685plb.28.1696445797699; Wed, 04 Oct 2023 11:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445797; cv=none; d=google.com; s=arc-20160816; b=ZEgnukhxOAT3GxBd6jghyKUr2D45W5yuz68db9AUXMRIa3fucP1bJJONFWIgkpKvdm OeuZlP7WoFDNM4xcXv68ziOJWYkP3yi5+wnQDtKnurY863dqR69YF0YjenVXpUo4El5a KTBMqluvsx8Gdpn0F3rem9Lk9lH/GZrEdS/qYBZDodNOOYS0+8gl4ZyMIGba0MZCqOPw 5mMuddi49+5pgYeb/lipaTFAISXGr1+mTIF5wE5CITgCXg/p89B3ISr0ZW7L9BQRMf9a kB04jaxgYt1i1Iqhpuv0fB3N2xROfGFxX4s9isr65/vkJRO2CgjNZ4vqBw1I3VMW6qvm /98g== 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=ljrOf95K3lMJ6sM56rwczoIDF5jerBsErHMpQdHe7ME=; fh=8sRj4pXGeWd3I48ZGssU2MRGGxH8f7IpW7BNWZdmlJ0=; b=xu/yjdUt+zWH5VDp+QHJVAduHlSjkT5qjPNYbIprBVoeX6sIL6VgHuHsdl6s6MdAVY YW8nErdMHXDkSCq+gX0Sqpm76dOTh/wGbVE1Ysshd3A1ez/qgVxzDyxAHbn+IfQuGxhd pMLNCPXOm+jf3maVHr1VWf3/wfFUyda3QupwVXYIOIIhPOJvzMBzpWDuV7W+4oL6Hzb0 i2GY1ZMZvK8e9f4wElTNwcRdYh6WN+Wt+inYIMJ4jsJLtBjI6OceqlBApQno+UK0Na1E GONSHAr/QCiI+WYGtGC0MrZcQX4UoGIJBIIMYg43r8wpw1hhKw62oMKfmSEW8j9ouGOZ yuyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xhj1Ad6i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x13-20020a170902ec8d00b0019c354055d0si4500630plg.304.2023.10.04.11.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xhj1Ad6i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 46D6D80725D3; Wed, 4 Oct 2023 11:55:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244949AbjJDSzb (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244590AbjJDSyi (ORCPT ); Wed, 4 Oct 2023 14:54:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBDCC116; Wed, 4 Oct 2023 11:54:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02E93C433CB; Wed, 4 Oct 2023 18:54:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445647; bh=KQeY8erJHarU6ZVyZ8B2z5f4xlYqdNPN1UGFBoaYrPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xhj1Ad6izXuGGHYPS9yHSI5iMoKyd+GjFWNN0VYIdRE+nIurlEgOxXt7C6oqYXTOr NApc2qN3QL87evLjHwSUiWgWzS9Pz6iQ9HpQ6kfprWPl6s5d2NmK7kfGuEbBeJYhWl cQa+te9hcBI2DyO535CWvycQ6g+ARcMRf927vKxnJzml3uh75U0yJ4IQcSS9ZVTh17 dwVzOHIa/fisFCCPLEFpCT3DxsL3CQkT9eoQ+etmF/f1Z+v2fWqqFCQOqHeuW4DZfl piFw5Ab48zYajfRl5wbam7R/sx/TsVnyvSOst37uWix1OvcvfqLklNnbip8izGbOMc OjFKjMxwh7j1A== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: autofs@vger.kernel.org Subject: [PATCH v2 19/89] autofs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:04 -0400 Message-ID: <20231004185347.80880-17-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852348697675844 X-GMAIL-MSGID: 1778852348697675844 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- 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 6d2e01c9057d..77b1b90b5d11 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -457,7 +457,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_ino = get_next_ino(); if (S_ISDIR(mode)) { diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 512b9a26c63d..530d18827e35 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); return 0; } From patchwork Wed Oct 4 18:52: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: 148503 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340630vqb; Wed, 4 Oct 2023 11:57:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGTe1ObaNhBBvmmNqpvjXerdu9PM1gT8ku49abQ76uG74ehBnUkxXEnf1oCOrvxyJDwx1d X-Received: by 2002:a05:6808:17a5:b0:3ab:81e4:4da0 with SMTP id bg37-20020a05680817a500b003ab81e44da0mr4152302oib.42.1696445860559; Wed, 04 Oct 2023 11:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445860; cv=none; d=google.com; s=arc-20160816; b=gzTgBmZqvBYWkqU5NgukQ8zjC9kU66yIb0oi7SfJF/Q5tk0Ndo/O9OXjrDXxiIaQAz MMYtBMgVDiNtrvshL+iEKdznqDSRuswJIPk2qsSV8E+kVQIu4YeN+MjeX2XLGhH8Z2hW 4XOftjNxgvqSt2V+jdgUKkZoX22LJP/7I6cgXqttnuMFyvPgOCJeirWPsEoZg6xhIdkE T7N21BRskI1wCxV6tprk035iJwZlcTX3MwRxTDfrv4bvs6zM63oRsvhxnHc8f0qPXEA7 5qQK10x1dzRvA1PgnYWEhbJEjxC/CNW/dJ3x4kRJusaWg832aQnXV+r749mBOWyT5OCP lIWg== 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=xkvVx7djYlCIcZPMsfhmxabeLMxMppNlAY6t+E5Nwqg=; fh=WRXpDjKWQ8Wk4cZg/9Wj/5Rnfg3DIlvGtC7yQnn6Nb0=; b=jRycyqOWQcM+8WJtfqyjQKZt3YZ/sR8oVrYcLZozWA4/YKufU9W+84OlK3OFHFK5nB NoS2C+TNSXJoyfCaGA/v1UyJtqvQkaMFxDf7WwVkIa3VMjNVIFHuzjhJLBHdcvK7CviU mR6+KEZLjEGdOU7ifCJ2OJdFDxxdvSdaKjYCSZIOrmG7tGzynOYmn/6wZaMjse2YN0Du 02IuUg0D3SCh5JyIMawtoUyO4Ik3TxdoOXaaKTwkFsrFFVYhxIiwD7d9YT+Ed/jd9idl hWCUXsGxbvVm8XBprtt8gVZ6+o7fPGmYVZ33SjfzRX3yNrOH27iftvXx+AQIWefFlzCt aVJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rVuNjVHq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id w190-20020a6382c7000000b00577f7b6e7b4si4295289pgd.624.2023.10.04.11.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rVuNjVHq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D50FB80B6324; Wed, 4 Oct 2023 11:56:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244789AbjJDSzj (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244610AbjJDSyj (ORCPT ); Wed, 4 Oct 2023 14:54:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ACD7194; Wed, 4 Oct 2023 11:54:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 152C2C433C7; Wed, 4 Oct 2023 18:54:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445648; bh=VZeO+KnP0i1FeqM9/WQ8dV1qUSykp6CVzxV5q5AtMB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rVuNjVHqLVXKtCF8V9QISykbfPweeRDvwbMinu2ovVQpxwapBwWpIIFVteeAe+3a6 cYfLkTUg0JDy4TYKZyztkUThmAzhVVE/+eMuArnkQtfSaPubU1d17ue6S/4hdWSpva DALvVd4hOeNdSE+ilgZhxCatPXs9Vmlxqvzu1ljONuqNaaJOvHTYnYhNlR8e6itx6e oAYI+b0dDP20O3wjsR+/Wa6WYgRHxsTLNcincm1a9xHHTBmQJJIzM0tI2isko7M3ji ouZ3iEV+i4GGc4QLw3fCVFbpbo/YQXSPdLvkvBolQXN+RRPTthOjkiiDvs5Um3oKdz Y7D2D1TqKrsCg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Brian Foster , linux-bcachefs@vger.kernel.org Subject: [PATCH v2 20/89] bcachefs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:05 -0400 Message-ID: <20231004185347.80880-18-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852414917907437 X-GMAIL-MSGID: 1778852414917907437 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Acked-by: Brian Foster --- fs/bcachefs/fs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 09137a20449b..1fbaad27d07b 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -66,9 +66,9 @@ void bch2_inode_update_after_write(struct btree_trans *trans, inode->v.i_mode = bi->bi_mode; if (fields & ATTR_ATIME) - inode->v.i_atime = bch2_time_to_timespec(c, bi->bi_atime); + inode_set_atime_to_ts(&inode->v, bch2_time_to_timespec(c, bi->bi_atime)); if (fields & ATTR_MTIME) - inode->v.i_mtime = bch2_time_to_timespec(c, bi->bi_mtime); + inode_set_mtime_to_ts(&inode->v, bch2_time_to_timespec(c, bi->bi_mtime)); if (fields & ATTR_CTIME) inode_set_ctime_to_ts(&inode->v, bch2_time_to_timespec(c, bi->bi_ctime)); @@ -753,8 +753,8 @@ static int bch2_getattr(struct mnt_idmap *idmap, stat->gid = inode->v.i_gid; stat->rdev = inode->v.i_rdev; stat->size = i_size_read(&inode->v); - stat->atime = inode->v.i_atime; - stat->mtime = inode->v.i_mtime; + stat->atime = inode_get_atime(&inode->v); + stat->mtime = inode_get_mtime(&inode->v); stat->ctime = inode_get_ctime(&inode->v); stat->blksize = block_bytes(c); stat->blocks = inode->v.i_blocks; @@ -1418,8 +1418,8 @@ static int inode_update_times_fn(struct btree_trans *trans, { struct bch_fs *c = inode->v.i_sb->s_fs_info; - bi->bi_atime = timespec_to_bch2_time(c, inode->v.i_atime); - bi->bi_mtime = timespec_to_bch2_time(c, inode->v.i_mtime); + bi->bi_atime = timespec_to_bch2_time(c, inode_get_atime(&inode->v)); + bi->bi_mtime = timespec_to_bch2_time(c, inode_get_mtime(&inode->v)); bi->bi_ctime = timespec_to_bch2_time(c, inode_get_ctime(&inode->v)); return 0; From patchwork Wed Oct 4 18:52: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: 148502 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340605vqb; Wed, 4 Oct 2023 11:57:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuez7/CSb8+NAWIDeTmxpaN9FbERM+uvVDlhP878ssolDs7f+2ZgeEFTBebaS0xL4SrCy5 X-Received: by 2002:a05:6a20:12c6:b0:131:a21:9f96 with SMTP id v6-20020a056a2012c600b001310a219f96mr3941313pzg.6.1696445857795; Wed, 04 Oct 2023 11:57:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445857; cv=none; d=google.com; s=arc-20160816; b=tn3BBjnJ+9MrJRyGtcZZ7p+kqDhqZwFCZhMMhkVbGDwsxZUEZxFk/pai4NcHPzOTAX Qt8F24kvukuxDRUksq5qjCKCTmE5pnAam1Sq1Zc1VMIux6Qg6vJWM/VqYmPWJAvQ10Wx sm5b91++gsWwiFXzKt/jZJTEwwaTkx5SjPtitCU/aUGuE5WX/qdoNDmrXy2QUhT1VF6G O1NGOLVZQUsmh0ziRV3OX1O+Cu4o4hPSH/yUqGwjPffJMDMHa0NU32hsTRsaH0HX3Edy MPunuGpaCR/9y1UoS0DeeUwnnIjaIWx50wFG2nQYlmZuLl3+2nM9a4DJ9Cl80Wa/lWPQ 34XA== 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:to:from :dkim-signature; bh=YSsnlec1xGuU2Jl51BZIwKIIfDgV1Nt10P8rr7Z2Sb4=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=TAIYWw/Kw3ENjza2BwGFQWT4DRpTPJQrC0b/pPgPgWoO/5mc5gCG0VfJHt7prs6mHx 0IE4ZpdKj+VbWkIZ5tfgZVCcejlCekJrbqC3HfOha6VuCcsROlzNN1cOjigyEmj/nYWN pssx6z5qIYzHgBY3/RvpjX55DDDfFdCIBYJa+rB1gUDJfM2OCPyVGGezXGgV27NutWnK R0EOEHd6jgyBHsv62zO+l0fwv8Pvf4ernIIdTkc/08R2WatJpozXtvRyvmg8ec8i6kMm vX8UNZYyLHe5iz17dlg+S6yLGyfFYvMf0KrJnhLwD12wtvqmtQ9tjebAdPLtZtVK9oqg M9gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hy5MtmzK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id lc6-20020a170902fa8600b001c383a64ebesi4016289plb.319.2023.10.04.11.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hy5MtmzK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7BEBD80A1A5C; Wed, 4 Oct 2023 11:55:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244973AbjJDSzf (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244682AbjJDSyj (ORCPT ); Wed, 4 Oct 2023 14:54:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD29A10C1; Wed, 4 Oct 2023 11:54:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36A5FC433C9; Wed, 4 Oct 2023 18:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445649; bh=VkAfakFbY6ou3c5RDJgTwIvdzPUdIonMnNTFVcvTr1M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hy5MtmzKQjrJyQih03qiOmAzQIiVH8DW64l0nVh70slcGif6PG7Ug71JsbGxnFIik xtTdcAFC/LGP8VBQGH/PsgGNWnOlwQhl3I2fcWDc6YTQxInbopfyMj995+dah3RyuD 8ltfqUlBFHNfQiWTiDrMs3zQBzpqdD/H52Sn8KTjEWUWtRupTawcOymrStA+hEc/ua yo3RWbzy+AaXjBRTblSCEc7uCO4Ia6VMDmYwzhDGh5hHvY+J0g4HLpiQgwYVVdEgDL eAOlAoOUqCxiXr3QDNo1Xpo/yZKsXj5hUBftSPdg72AaTXCU1cEBZHdpSiHx3uWia0 4LwYX08UDZPiw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 21/89] befs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:06 -0400 Message-ID: <20231004185347.80880-19-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:55:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852411675369227 X-GMAIL-MSGID: 1778852411675369227 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/befs/linuxvfs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index 9a16a51fbb88..9acdec56f626 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c @@ -360,11 +360,11 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) * for indexing purposes. (PFD, page 54) */ - 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_set_ctime_to_ts(inode, inode->i_mtime); - inode->i_atime = inode->i_mtime; + inode_set_mtime(inode, + fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16, + 0);/* lower 16 bits are not a time */ + inode_set_ctime_to_ts(inode, inode_get_mtime(inode)); + inode_set_atime_to_ts(inode, inode_get_mtime(inode)); befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num); befs_ino->i_parent = fsrun_to_cpu(sb, raw_inode->parent); From patchwork Wed Oct 4 18:52: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: 148481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339900vqb; Wed, 4 Oct 2023 11:56:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETehkQDECUuRqtHN24kwDep5xckpNy6P9ea3lNrgDizi/ZuEnfgrfHO67Kr+ws5MwkUvYn X-Received: by 2002:a17:902:744c:b0:1c0:98fe:3677 with SMTP id e12-20020a170902744c00b001c098fe3677mr3167777plt.56.1696445764972; Wed, 04 Oct 2023 11:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445764; cv=none; d=google.com; s=arc-20160816; b=v1w/YdqjQsM6phzp24REX07uXfzVIOL4iVyathZIEqjEWqnExuY6bE8GEIHROgIYM1 vLuJlUKsey52McipD6dwA8ud1NnOSFScuQcQXEdoqcBGuqhwx5h7UxfGkKpQdd8PLViW zjdWIAWPjqzyQWubrQMtw+nU33YF1hVQxaDEGC5qzEhVDae2hrwBikNuoLYel5xEBotf Eur84bvMhjZNhWMnY17Lu1xYCTS2yEdMT17vcZl2f2XGkELdeP/9liCj2DCYRzHrzWlQ y+BaXaky7YnhYnQKs2UYrqkAZVx0p2FYA9OPBKiUTd278v6hknCpJPSc4sbMdsMU9Oj/ efpw== 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:to:from :dkim-signature; bh=4SMDG/0VclnsFFNAkF3uQvHoTkserlnE11bmZaPeSNI=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=yLNGTRnBpxpFnHutKbL1HRSHy8ZTSKCGGhLYrHKDoGMDlwJYs5dKBI4tvaItpMTV/M E+mHcmzX2nL2DUpk/0W6hIBlhvLiNnc1Ap3vZpEVGYSi/oZFdxTurPiDGZJL9TMASG+q ZscjDCZ05NiPcqxKX6nK5vXZQpdubjCQOG8J+PYay2bkVieYQ8aX0ohTk73UuMYWCbaF oio/A3nWUyqVKCtEvEPK7UymWuDiYa1DA3TimSAMRet7xvR27efkZFIt8qMY6w7r4Gkt wBF1VoUINARmQUWFZX7gDcdSOGgeNB/l19aGVIzgr+jqzQrhPmB3zVTwbixAq7qlxApJ 7rBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GnE2TT9W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x10-20020a170902a38a00b001c60d6a620bsi4064602pla.95.2023.10.04.11.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GnE2TT9W; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D20D180755EA; Wed, 4 Oct 2023 11:56:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244852AbjJDSzp (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244690AbjJDSyj (ORCPT ); Wed, 4 Oct 2023 14:54:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3B510C2; Wed, 4 Oct 2023 11:54:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4806CC433C8; Wed, 4 Oct 2023 18:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445650; bh=0i9CE7r71pJZdjXfXE2Jus9B4sidSAXbrDfTPPIl14s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GnE2TT9WztiIbYrPDDM3P8R317hzMEYg4euMcqPSj84n6G15y1PPLK49SWkpodR9i u0dL6aNYtHiaGmWi0a74cz5BW7FXbAg0yOt1qsksaPXqrkIDD64ZPs5oLJo8ktTEtb BLgQTvWSPC/WLw4XDzIp7NsutReIk3fU9VGVF1tIfQSfZCgqWLgg5vieCsqqmIoj3p /G8Sy2MRGvRNy4OrGNKBcOb1/yuDPdr14g0gbcYMhLza84f30cAkNEThpJffw5B+7x 1UrGfHIVM8JK1Bwl8zZGOryrwRAK3iw+wqsUV7ixycJ1+kQScPScGWE01RhzkxgAzR OVnZjqD0kSRtQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 22/89] bfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:07 -0400 Message-ID: <20231004185347.80880-20-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852314498814902 X-GMAIL-MSGID: 1778852314498814902 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/bfs/dir.c | 9 +++++---- fs/bfs/inode.c | 12 +++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/fs/bfs/dir.c b/fs/bfs/dir.c index 12b8af04dcb3..fbc4ae80a4b2 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_blocks = 0; inode->i_op = &bfs_file_inops; inode->i_fop = &bfs_file_operations; @@ -187,7 +187,7 @@ static int bfs_unlink(struct inode *dir, struct dentry *dentry) } de->ino = 0; mark_buffer_dirty_inode(bh, dir); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); inode_dec_link_count(inode); @@ -240,7 +240,7 @@ static int bfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, goto end_rename; } old_de->ino = 0; - old_dir->i_mtime = inode_set_ctime_current(old_dir); + inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir)); mark_inode_dirty(old_dir); if (new_inode) { inode_set_ctime_current(new_inode); @@ -294,7 +294,8 @@ static int bfs_add_entry(struct inode *dir, const struct qstr *child, int ino) dir->i_size += BFS_DIRENT_SIZE; inode_set_ctime_current(dir); } - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, + inode_set_ctime_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 e6a76ae9eb44..355957dbce39 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -80,11 +80,9 @@ struct inode *bfs_iget(struct super_block *sb, unsigned long ino) set_nlink(inode, le32_to_cpu(di->i_nlink)); inode->i_size = BFS_FILESIZE(di); 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_set_atime(inode, le32_to_cpu(di->i_atime), 0); + inode_set_mtime(inode, le32_to_cpu(di->i_mtime), 0); inode_set_ctime(inode, le32_to_cpu(di->i_ctime), 0); - inode->i_atime.tv_nsec = 0; - inode->i_mtime.tv_nsec = 0; brelse(bh); unlock_new_inode(inode); @@ -140,9 +138,9 @@ static int bfs_write_inode(struct inode *inode, struct writeback_control *wbc) di->i_uid = cpu_to_le32(i_uid_read(inode)); di->i_gid = cpu_to_le32(i_gid_read(inode)); 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_get_ctime(inode).tv_sec); + di->i_atime = cpu_to_le32(inode_get_atime_sec(inode)); + di->i_mtime = cpu_to_le32(inode_get_mtime_sec(inode)); + di->i_ctime = cpu_to_le32(inode_get_ctime_sec(inode)); 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 Oct 4 18:52: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: 148528 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342489vqb; Wed, 4 Oct 2023 12:01:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFU4Qiid99IucpMo6ZS8PtR7NRooqYO1FUEsi0aTgCdqtDbF+ltFeovgbPcjyoaGSJbvNps X-Received: by 2002:a05:6a20:a11a:b0:13d:ee19:7727 with SMTP id q26-20020a056a20a11a00b0013dee197727mr3656789pzk.18.1696446068358; Wed, 04 Oct 2023 12:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446068; cv=none; d=google.com; s=arc-20160816; b=l9f1vWYjxhmtv25Zck1V3jbom1MJeuGTMk8uyvy9JTmq4Lyuf7qbzvwBPMfdu7nsMc ogv5BWoeI2dXUmH/h/c2KrHIpkY9dAgBGh63JzU4nbZaNe7W+aE4YE656FiDO8sQdnS/ V3YP+jy3gMAVy6hS+resG1/8SIpyPXB9hkNnqGr2MiAkwpdVHv/dnK+EO29Wek1tSb/6 GYoqoA0ysqNafBaPTgg9AY/gfPRZGDpthDuwhBPguKn5fluzM0FFcMSOUhjvbhFK4CAO K/GABtjY0V0BItqJhzNw6EyFOKLSA6CayaG+ZoKdkOu1Sfh0xwz03Ak0tciwjMpU1zYJ pwvg== 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=K8wyvWFlEk/ojJj/4kVDIkfMtCbh/VKB0o6QI/JdbZU=; fh=UIStBJvlqOcG0eJXpcE4hrsP5r3uHd8xntseFyzSDLA=; b=ThJUF2vPyR0fPG8GN087+GiJPjm+ffV8N2xpAMBhBjK1EUbtV4BrFclZJBtYKPg0/R leSn2Mq/3xJNNlm+1cXzhkKXHI55Y3ilanS/5WbUFA4sPfQ/tSlugG9aiK4G7rExeuuP 6rY17OKfYx4pMeSpw5omLuxSiprK3u7PF5GNOQD5wQPHUpYuuvOnckB1yh5Yz2Ropbhw vn2aKzWXT4f+PY2J+Q4iyhUyB7MeTF9Vg5b1vfo6ttURUP62hzYKM/S9CEg6sECMfWXm zpJlp6++7rCfPpfh9y28BH7hWmooByYIvd1E9cP2dbX1VS/wPK4idMUHuAUkKKz/XU7S NmGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y5Q19qQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u22-20020a056a00159600b0069102c864c5si4614192pfk.218.2023.10.04.12.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y5Q19qQq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 9A3E080613B6; Wed, 4 Oct 2023 12:00:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244998AbjJDSzt (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244708AbjJDSyk (ORCPT ); Wed, 4 Oct 2023 14:54:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A299619A6; Wed, 4 Oct 2023 11:54:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8596C433CA; Wed, 4 Oct 2023 18:54:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445652; bh=wcoGb0eczeeES9BQXcCkzd9FnbAJEJPkUTNGutZl0cA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5Q19qQqpqsh3uJtw2Uxvm9Ec1seNJLC54Us6Z81PXy0APeLUDcqy9mxGIFCBx+NG tjZqNVrZ+7fSJd8W7Ofj0vvx/p/49sDUhllSSUr/13m3OEZo6Dqs18OEVkx8A69uNc lB8ay1rHS6RIfB+2CgDfatfSpJBieyMvSpE0xrl/FANsN/PS0BObFgMMw0eGKgYCRh sU1+/9b90uKkiaoxYO2Phw3C85YhaFQ/S+E/B7BrMTnjSx6Mv+6lKRp9HSInzAV4Rb 335BO6OrkjkoB6v2wmaiWWff+NbQrRmMr9Sp7Hrc1pRDGHkMGR4xEWAw8XsK9cx735 fEVRkOiu98RiQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH v2 23/89] btrfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:08 -0400 Message-ID: <20231004185347.80880-21-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:24 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852632459548035 X-GMAIL-MSGID: 1778852632459548035 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Acked-by: David Sterba --- fs/btrfs/delayed-inode.c | 20 +++++++++---------- fs/btrfs/file.c | 18 +++++++++-------- fs/btrfs/inode.c | 43 ++++++++++++++++++++-------------------- fs/btrfs/reflink.c | 2 +- fs/btrfs/transaction.c | 3 ++- fs/btrfs/tree-log.c | 12 +++++------ 6 files changed, 51 insertions(+), 47 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 35d7616615c1..63454bf3dc52 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1833,19 +1833,19 @@ static void fill_stack_inode_item(struct btrfs_trans_handle *trans, btrfs_set_stack_inode_block_group(inode_item, 0); btrfs_set_stack_timespec_sec(&inode_item->atime, - inode->i_atime.tv_sec); + inode_get_atime_sec(inode)); btrfs_set_stack_timespec_nsec(&inode_item->atime, - inode->i_atime.tv_nsec); + inode_get_atime_nsec(inode)); btrfs_set_stack_timespec_sec(&inode_item->mtime, - inode->i_mtime.tv_sec); + inode_get_mtime_sec(inode)); btrfs_set_stack_timespec_nsec(&inode_item->mtime, - inode->i_mtime.tv_nsec); + inode_get_mtime_nsec(inode)); btrfs_set_stack_timespec_sec(&inode_item->ctime, - inode_get_ctime(inode).tv_sec); + inode_get_ctime_sec(inode)); btrfs_set_stack_timespec_nsec(&inode_item->ctime, - inode_get_ctime(inode).tv_nsec); + inode_get_ctime_nsec(inode)); btrfs_set_stack_timespec_sec(&inode_item->otime, BTRFS_I(inode)->i_otime.tv_sec); @@ -1890,11 +1890,11 @@ int btrfs_fill_inode(struct inode *inode, u32 *rdev) btrfs_inode_split_flags(btrfs_stack_inode_flags(inode_item), &BTRFS_I(inode)->flags, &BTRFS_I(inode)->ro_flags); - inode->i_atime.tv_sec = btrfs_stack_timespec_sec(&inode_item->atime); - inode->i_atime.tv_nsec = btrfs_stack_timespec_nsec(&inode_item->atime); + inode_set_atime(inode, btrfs_stack_timespec_sec(&inode_item->atime), + btrfs_stack_timespec_nsec(&inode_item->atime)); - 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_set_mtime(inode, btrfs_stack_timespec_sec(&inode_item->mtime), + btrfs_stack_timespec_nsec(&inode_item->mtime)); inode_set_ctime(inode, btrfs_stack_timespec_sec(&inode_item->ctime), btrfs_stack_timespec_nsec(&inode_item->ctime)); diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 004c53482f05..04a045663f7b 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1111,17 +1111,18 @@ void btrfs_check_nocow_unlock(struct btrfs_inode *inode) static void update_time_for_write(struct inode *inode) { - struct timespec64 now, ctime; + struct timespec64 now, ts; if (IS_NOCMTIME(inode)) return; now = current_time(inode); - if (!timespec64_equal(&inode->i_mtime, &now)) - inode->i_mtime = now; + ts = inode_get_mtime(inode); + if (!timespec64_equal(&ts, &now)) + inode_set_mtime_to_ts(inode, now); - ctime = inode_get_ctime(inode); - if (!timespec64_equal(&ctime, &now)) + ts = inode_get_ctime(inode); + if (!timespec64_equal(&ts, &now)) inode_set_ctime_to_ts(inode, now); if (IS_I_VERSION(inode)) @@ -2477,7 +2478,8 @@ 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 = inode_set_ctime_current(&inode->vfs_inode); + inode_set_mtime_to_ts(&inode->vfs_inode, + inode_set_ctime_current(&inode->vfs_inode)); ret = btrfs_update_inode(trans, inode); if (ret) @@ -2718,7 +2720,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 = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); ret = btrfs_update_inode(trans, BTRFS_I(inode)); updated_inode = true; btrfs_end_transaction(trans); @@ -2738,7 +2740,7 @@ static int btrfs_punch_hole(struct file *file, loff_t offset, loff_t len) struct timespec64 now = inode_set_ctime_current(inode); inode_inc_iversion(inode); - inode->i_mtime = now; + inode_set_mtime_to_ts(inode, now); trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { ret = PTR_ERR(trans); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 52576deda654..25298eed0b26 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3763,11 +3763,11 @@ static int btrfs_read_locked_inode(struct inode *inode, btrfs_inode_set_file_extent_range(BTRFS_I(inode), 0, round_up(i_size_read(inode), fs_info->sectorsize)); - inode->i_atime.tv_sec = btrfs_timespec_sec(leaf, &inode_item->atime); - inode->i_atime.tv_nsec = btrfs_timespec_nsec(leaf, &inode_item->atime); + inode_set_atime(inode, btrfs_timespec_sec(leaf, &inode_item->atime), + btrfs_timespec_nsec(leaf, &inode_item->atime)); - 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_set_mtime(inode, btrfs_timespec_sec(leaf, &inode_item->mtime), + btrfs_timespec_nsec(leaf, &inode_item->mtime)); inode_set_ctime(inode, btrfs_timespec_sec(leaf, &inode_item->ctime), btrfs_timespec_nsec(leaf, &inode_item->ctime)); @@ -3931,19 +3931,19 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, btrfs_set_token_inode_nlink(&token, item, inode->i_nlink); btrfs_set_token_timespec_sec(&token, &item->atime, - inode->i_atime.tv_sec); + inode_get_atime_sec(inode)); btrfs_set_token_timespec_nsec(&token, &item->atime, - inode->i_atime.tv_nsec); + inode_get_atime_nsec(inode)); btrfs_set_token_timespec_sec(&token, &item->mtime, - inode->i_mtime.tv_sec); + inode_get_mtime_sec(inode)); btrfs_set_token_timespec_nsec(&token, &item->mtime, - inode->i_mtime.tv_nsec); + inode_get_mtime_nsec(inode)); btrfs_set_token_timespec_sec(&token, &item->ctime, - inode_get_ctime(inode).tv_sec); + inode_get_ctime_sec(inode)); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode_get_ctime(inode).tv_nsec); + inode_get_ctime_nsec(inode)); btrfs_set_token_timespec_sec(&token, &item->otime, BTRFS_I(inode)->i_otime.tv_sec); @@ -4141,7 +4141,7 @@ static int __btrfs_unlink_inode(struct btrfs_trans_handle *trans, inode_inc_iversion(&inode->vfs_inode); inode_inc_iversion(&dir->vfs_inode); inode_set_ctime_current(&inode->vfs_inode); - dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode); + inode_set_mtime_to_ts(&dir->vfs_inode, inode_set_ctime_current(&dir->vfs_inode)); ret = btrfs_update_inode(trans, dir); out: return ret; @@ -4314,7 +4314,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 = inode_set_ctime_current(&dir->vfs_inode); + inode_set_mtime_to_ts(&dir->vfs_inode, inode_set_ctime_current(&dir->vfs_inode)); ret = btrfs_update_inode_fallback(trans, dir); if (ret) btrfs_abort_transaction(trans, ret); @@ -4964,7 +4964,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 = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); } } @@ -5608,9 +5609,9 @@ static struct inode *new_simple_dir(struct inode *dir, 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 = inode_set_ctime_current(inode); - inode->i_atime = dir->i_atime; - BTRFS_I(inode)->i_otime = inode->i_mtime; + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); + inode_set_atime_to_ts(inode, inode_get_atime(dir)); + BTRFS_I(inode)->i_otime = inode_get_mtime(inode); inode->i_uid = dir->i_uid; inode->i_gid = dir->i_gid; @@ -6285,9 +6286,9 @@ int btrfs_create_new_inode(struct btrfs_trans_handle *trans, goto discard; } - inode->i_mtime = inode_set_ctime_current(inode); - inode->i_atime = inode->i_mtime; - BTRFS_I(inode)->i_otime = inode->i_mtime; + simple_inode_init_ts(inode); + + BTRFS_I(inode)->i_otime = inode_get_mtime(inode); /* * We're going to fill the inode item now, so at this point the inode @@ -6452,8 +6453,8 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, * values (the ones it had when the fsync was done). */ if (!test_bit(BTRFS_FS_LOG_RECOVERING, &root->fs_info->flags)) - parent_inode->vfs_inode.i_mtime = - inode_set_ctime_current(&parent_inode->vfs_inode); + inode_set_mtime_to_ts(&parent_inode->vfs_inode, + inode_set_ctime_current(&parent_inode->vfs_inode)); ret = btrfs_update_inode(trans, parent_inode); if (ret) diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index fabd856e5079..f88b0c2ac3fe 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -29,7 +29,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans, inode_inc_iversion(inode); if (!no_time_update) { - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); } /* * We round up to the block size at eof when determining which diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 77f8175d464b..d2105bfa6297 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1911,7 +1911,8 @@ 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 = inode_set_ctime_current(parent_inode); + inode_set_mtime_to_ts(parent_inode, + inode_set_ctime_current(parent_inode)); ret = btrfs_update_inode_fallback(trans, 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 6b98e0dbc0a4..8c024ab22086 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4134,19 +4134,19 @@ static void fill_inode_item(struct btrfs_trans_handle *trans, btrfs_set_token_inode_nlink(&token, item, inode->i_nlink); btrfs_set_token_timespec_sec(&token, &item->atime, - inode->i_atime.tv_sec); + inode_get_atime_sec(inode)); btrfs_set_token_timespec_nsec(&token, &item->atime, - inode->i_atime.tv_nsec); + inode_get_atime_nsec(inode)); btrfs_set_token_timespec_sec(&token, &item->mtime, - inode->i_mtime.tv_sec); + inode_get_mtime_sec(inode)); btrfs_set_token_timespec_nsec(&token, &item->mtime, - inode->i_mtime.tv_nsec); + inode_get_mtime_nsec(inode)); btrfs_set_token_timespec_sec(&token, &item->ctime, - inode_get_ctime(inode).tv_sec); + inode_get_ctime_sec(inode)); btrfs_set_token_timespec_nsec(&token, &item->ctime, - inode_get_ctime(inode).tv_nsec); + inode_get_ctime_nsec(inode)); /* * We do not need to set the nbytes field, in fact during a fast fsync From patchwork Wed Oct 4 18:52: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: 148482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp339966vqb; Wed, 4 Oct 2023 11:56:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEOmYsWwx6IsrrWnbSkef82I1Cq/2T9KYPnFB/r0QKlGbD+tCqWoJ9P9qCQh/+DyoRbFEy/ X-Received: by 2002:a17:902:76ca:b0:1c7:7b27:f9a9 with SMTP id j10-20020a17090276ca00b001c77b27f9a9mr2774926plt.59.1696445775898; Wed, 04 Oct 2023 11:56:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445775; cv=none; d=google.com; s=arc-20160816; b=STOtuxs7vS2hyVOWRUDCIwkuAYGfwzcEUpgz6YdJOOOjVFwjNmB54uHw+JATqSjupc +7t5f3nLc25kyBr+u0GyAr5UeT3JJZ3ZzaJBFl6X5cEXbqM49EYktZBRoRlEtxO65gVq Hvs+3cpSltDAfOwognqYlcNbS/U7YzQ2tOABX8Ys024L9hSlQIrlHx61TV0Xt1BOJ11d 9eR2LtN14YAkQSObOCeb5GINI3S8N1mwc3bOwUVmJgQJF2N8z1kDRN4akMiGoJmDrRy8 WVemIsyXWfungy1bKIYbGCdHJgjxWFr1v9V5lmfRuBTlhl5vQBfLyHdC2eg+Ttbf0TJx ueeA== 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=ATNzcwWS+iYpnt3zGKV4RMDQhyOFLTb+DbXErfi52qY=; fh=KmhyYBQEtbQbL/GTzFyZaYa8PLHD/0mbeD8flYs9mpA=; b=m2po20s0k0YhSEnLy7tKdI3lOJFLXcw/CIooOFu6r3jeKyv16DCnRb/WK5dj1vgCTk mbRR6XHjxWqrKTQRUiyC5P/Phu7ihCKEdwnrawu5O+2vShfMoEk21h98AofzfSYnDf4k t+Z5L2OgzQYeWyQw4vsWiV/YNLR8BhOkJj7OutSv+h9uwHWsyBg2gEPLbn6aIpgjkJ9E kYMxTTmZLpRRTQMZUWyY9Ud/10m46aokZ1D332lY4WBHdDtijMpcoqGEJlfH8dWY5mz4 bJqY81UTSx/W68FOCZuBhB1pG95x0gk2a1EolNQKAaSXA9v+y0ywWFaPZJKGS/ylMg8g RrIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=peCDhFvy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id la7-20020a170902fa0700b001c61af1e683si3954082plb.641.2023.10.04.11.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=peCDhFvy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3D9948029222; Wed, 4 Oct 2023 11:56:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245013AbjJDSzx (ORCPT + 19 others); Wed, 4 Oct 2023 14:55:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244758AbjJDSyk (ORCPT ); Wed, 4 Oct 2023 14:54:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F4F81BB; Wed, 4 Oct 2023 11:54:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47F56C433CD; Wed, 4 Oct 2023 18:54:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445653; bh=2jXhlJqEcDz9nCd85yf7zPQyE0gGNseKC4eGu/mb95k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=peCDhFvyDTAEte2SI46TPQLXkwn4da+nbi+HaRdv5Pu9lPE64KPfmA542HpVG9ukD mro6IGhbfWHMx4w4nF52GZGxZI3XLSvImyXKWQWR6nLuDZkB4WHcBCx9/xPy6fWju3 vjsVXpPxVW86zDNXZzK+w3lz+A35/KZaBfjYdMqLmbf+urP32NFzzDFQN7FzGmv4m7 9AzSZjPU3XEPUd7WngjdZs4yKso3KZ1wsk+7nZppnI/iYmKdPn41vJHjKXH0xTX9sx a6vI2s5yHBa+hijTo3Iit7JzUiMEudxS9Slo9mJjx9o0SkHsg5yQiBxIRcTZlv+nRX 3uoislce/m2pQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ceph-devel@vger.kernel.org Subject: [PATCH v2 24/89] ceph: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:09 -0400 Message-ID: <20231004185347.80880-22-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852325985012635 X-GMAIL-MSGID: 1778852325985012635 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ceph/addr.c | 10 +++---- fs/ceph/caps.c | 4 +-- fs/ceph/file.c | 2 +- fs/ceph/inode.c | 64 ++++++++++++++++++++++++-------------------- fs/ceph/mds_client.c | 8 ++++-- fs/ceph/snap.c | 4 +-- 6 files changed, 51 insertions(+), 41 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index f4863078f7fe..936b9e0b351d 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -750,7 +750,7 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) dout("writepage %llu~%llu (%llu bytes, %sencrypted)\n", page_off, len, wlen, IS_ENCRYPTED(inode) ? "" : "not "); - req->r_mtime = inode->i_mtime; + req->r_mtime = inode_get_mtime(inode); ceph_osdc_start_request(osdc, req); err = ceph_osdc_wait_request(osdc, req); @@ -1327,7 +1327,7 @@ static int ceph_writepages_start(struct address_space *mapping, pages = NULL; } - req->r_mtime = inode->i_mtime; + req->r_mtime = inode_get_mtime(inode); ceph_osdc_start_request(&fsc->client->osdc, req); req = NULL; @@ -1875,7 +1875,7 @@ int ceph_uninline_data(struct file *file) goto out_unlock; } - req->r_mtime = inode->i_mtime; + req->r_mtime = inode_get_mtime(inode); ceph_osdc_start_request(&fsc->client->osdc, req); err = ceph_osdc_wait_request(&fsc->client->osdc, req); ceph_osdc_put_request(req); @@ -1917,7 +1917,7 @@ int ceph_uninline_data(struct file *file) goto out_put_req; } - req->r_mtime = inode->i_mtime; + req->r_mtime = inode_get_mtime(inode); ceph_osdc_start_request(&fsc->client->osdc, req); err = ceph_osdc_wait_request(&fsc->client->osdc, req); @@ -2092,7 +2092,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, 0, false, true); ceph_osdc_start_request(&fsc->client->osdc, rd_req); - wr_req->r_mtime = ci->netfs.inode.i_mtime; + wr_req->r_mtime = inode_get_mtime(&ci->netfs.inode); ceph_osdc_start_request(&fsc->client->osdc, wr_req); err = ceph_osdc_wait_request(&fsc->client->osdc, rd_req); diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 14215ec646f7..a104669fcf4c 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -1421,8 +1421,8 @@ static void __prep_cap(struct cap_msg_args *arg, struct ceph_cap *cap, arg->old_xattr_buf = NULL; } - arg->mtime = inode->i_mtime; - arg->atime = inode->i_atime; + arg->mtime = inode_get_mtime(inode); + arg->atime = inode_get_atime(inode); arg->ctime = inode_get_ctime(inode); arg->btime = ci->i_btime; arg->change_attr = inode_peek_iversion_raw(inode); diff --git a/fs/ceph/file.c b/fs/ceph/file.c index b1da02f5dbe3..b96d4e74ae99 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -2489,7 +2489,7 @@ static int ceph_zero_partial_object(struct inode *inode, goto out; } - req->r_mtime = inode->i_mtime; + req->r_mtime = inode_get_mtime(inode); ceph_osdc_start_request(&fsc->client->osdc, req); ret = ceph_osdc_wait_request(&fsc->client->osdc, req); if (ret == -ENOENT) diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 800ab7920513..e846752b9a1f 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c @@ -185,9 +185,9 @@ struct inode *ceph_get_snapdir(struct inode *parent) inode->i_mode = parent->i_mode; inode->i_uid = parent->i_uid; inode->i_gid = parent->i_gid; - inode->i_mtime = parent->i_mtime; + inode_set_mtime_to_ts(inode, inode_get_mtime(parent)); inode_set_ctime_to_ts(inode, inode_get_ctime(parent)); - inode->i_atime = parent->i_atime; + inode_set_atime_to_ts(inode, inode_get_atime(parent)); ci->i_rbytes = 0; ci->i_btime = ceph_inode(parent)->i_btime; @@ -837,28 +837,31 @@ void ceph_fill_file_time(struct inode *inode, int issued, /* the MDS did a utimes() */ dout("mtime %lld.%09ld -> %lld.%09ld " "tw %d -> %d\n", - inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec, + inode_get_mtime_sec(inode), + inode_get_mtime_nsec(inode), mtime->tv_sec, mtime->tv_nsec, ci->i_time_warp_seq, (int)time_warp_seq); - inode->i_mtime = *mtime; - inode->i_atime = *atime; + inode_set_mtime_to_ts(inode, *mtime); + inode_set_atime_to_ts(inode, *atime); ci->i_time_warp_seq = time_warp_seq; } else if (time_warp_seq == ci->i_time_warp_seq) { + struct timespec64 ts; + /* nobody did utimes(); take the max */ - if (timespec64_compare(mtime, &inode->i_mtime) > 0) { + ts = inode_get_mtime(inode); + if (timespec64_compare(mtime, &ts) > 0) { dout("mtime %lld.%09ld -> %lld.%09ld inc\n", - inode->i_mtime.tv_sec, - inode->i_mtime.tv_nsec, + ts.tv_sec, ts.tv_nsec, mtime->tv_sec, mtime->tv_nsec); - inode->i_mtime = *mtime; + inode_set_mtime_to_ts(inode, *mtime); } - if (timespec64_compare(atime, &inode->i_atime) > 0) { + ts = inode_get_atime(inode); + if (timespec64_compare(atime, &ts) > 0) { dout("atime %lld.%09ld -> %lld.%09ld inc\n", - inode->i_atime.tv_sec, - inode->i_atime.tv_nsec, + ts.tv_sec, ts.tv_nsec, atime->tv_sec, atime->tv_nsec); - inode->i_atime = *atime; + inode_set_atime_to_ts(inode, *atime); } } else if (issued & CEPH_CAP_FILE_EXCL) { /* we did a utimes(); ignore mds values */ @@ -869,8 +872,8 @@ void ceph_fill_file_time(struct inode *inode, int issued, /* 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_set_ctime_to_ts(inode, *ctime); - inode->i_mtime = *mtime; - inode->i_atime = *atime; + inode_set_mtime_to_ts(inode, *mtime); + inode_set_atime_to_ts(inode, *atime); ci->i_time_warp_seq = time_warp_seq; } else { warn = 1; @@ -2553,20 +2556,22 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr, } if (ia_valid & ATTR_ATIME) { + struct timespec64 atime = inode_get_atime(inode); + dout("setattr %p atime %lld.%ld -> %lld.%ld\n", inode, - inode->i_atime.tv_sec, inode->i_atime.tv_nsec, + atime.tv_sec, atime.tv_nsec, attr->ia_atime.tv_sec, attr->ia_atime.tv_nsec); if (issued & CEPH_CAP_FILE_EXCL) { ci->i_time_warp_seq++; - inode->i_atime = attr->ia_atime; + inode_set_atime_to_ts(inode, attr->ia_atime); dirtied |= CEPH_CAP_FILE_EXCL; } else if ((issued & CEPH_CAP_FILE_WR) && - timespec64_compare(&inode->i_atime, - &attr->ia_atime) < 0) { - inode->i_atime = attr->ia_atime; + timespec64_compare(&atime, + &attr->ia_atime) < 0) { + inode_set_atime_to_ts(inode, attr->ia_atime); dirtied |= CEPH_CAP_FILE_WR; } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || - !timespec64_equal(&inode->i_atime, &attr->ia_atime)) { + !timespec64_equal(&atime, &attr->ia_atime)) { ceph_encode_timespec64(&req->r_args.setattr.atime, &attr->ia_atime); mask |= CEPH_SETATTR_ATIME; @@ -2626,20 +2631,21 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr, } } if (ia_valid & ATTR_MTIME) { + struct timespec64 mtime = inode_get_mtime(inode); + dout("setattr %p mtime %lld.%ld -> %lld.%ld\n", inode, - inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec, + mtime.tv_sec, mtime.tv_nsec, attr->ia_mtime.tv_sec, attr->ia_mtime.tv_nsec); if (issued & CEPH_CAP_FILE_EXCL) { ci->i_time_warp_seq++; - inode->i_mtime = attr->ia_mtime; + inode_set_mtime_to_ts(inode, attr->ia_mtime); dirtied |= CEPH_CAP_FILE_EXCL; } else if ((issued & CEPH_CAP_FILE_WR) && - timespec64_compare(&inode->i_mtime, - &attr->ia_mtime) < 0) { - inode->i_mtime = attr->ia_mtime; + timespec64_compare(&mtime, &attr->ia_mtime) < 0) { + inode_set_mtime_to_ts(inode, attr->ia_mtime); dirtied |= CEPH_CAP_FILE_WR; } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || - !timespec64_equal(&inode->i_mtime, &attr->ia_mtime)) { + !timespec64_equal(&mtime, &attr->ia_mtime)) { ceph_encode_timespec64(&req->r_args.setattr.mtime, &attr->ia_mtime); mask |= CEPH_SETATTR_MTIME; @@ -2653,8 +2659,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_get_ctime(inode).tv_sec, - inode_get_ctime(inode).tv_nsec, + inode_get_ctime_sec(inode), + inode_get_ctime_nsec(inode), attr->ia_ctime.tv_sec, attr->ia_ctime.tv_nsec, only ? "ctime only" : "ignored"); if (only) { diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 615db141b6c4..e4cfa3b02187 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -4353,12 +4353,16 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg) rec.v2.flock_len = (__force __le32) ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1); } else { + struct timespec64 ts; + rec.v1.cap_id = cpu_to_le64(cap->cap_id); rec.v1.wanted = cpu_to_le32(__ceph_caps_wanted(ci)); rec.v1.issued = cpu_to_le32(cap->issued); rec.v1.size = cpu_to_le64(i_size_read(inode)); - ceph_encode_timespec64(&rec.v1.mtime, &inode->i_mtime); - ceph_encode_timespec64(&rec.v1.atime, &inode->i_atime); + ts = inode_get_mtime(inode); + ceph_encode_timespec64(&rec.v1.mtime, &ts); + ts = inode_get_atime(inode); + ceph_encode_timespec64(&rec.v1.atime, &ts); rec.v1.snaprealm = cpu_to_le64(ci->i_snap_realm->ino); rec.v1.pathbase = cpu_to_le64(pathbase); } diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 813f21add992..6732e1ea97d9 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -658,8 +658,8 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, BUG_ON(capsnap->writing); capsnap->size = i_size_read(inode); - capsnap->mtime = inode->i_mtime; - capsnap->atime = inode->i_atime; + capsnap->mtime = inode_get_mtime(inode); + capsnap->atime = inode_get_atime(inode); capsnap->ctime = inode_get_ctime(inode); capsnap->btime = ci->i_btime; capsnap->change_attr = inode_peek_iversion_raw(inode); From patchwork Wed Oct 4 18:52: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: 148532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342876vqb; Wed, 4 Oct 2023 12:01:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLRR72w2seH9rYsk/SvOqoZ6pjB2EF5+rJHT1d/aAIRnz1jeywn5SQ4K0h1n4UmUjOE5cJ X-Received: by 2002:a17:90a:e912:b0:26b:59b7:edb with SMTP id ki18-20020a17090ae91200b0026b59b70edbmr2890854pjb.33.1696446093492; Wed, 04 Oct 2023 12:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446093; cv=none; d=google.com; s=arc-20160816; b=TXiota74V0XIeJ0w8wYDdaPJbDcmoAC+KfM9MCynRwBmbBIV+afTsrtwdDEK21Fezv nhHx7f6cPvtkjUMb1TODMQvDCI3qMBjBZYqOH+Q0KkYl2sf/96iDrtLJGVyp/uu69G8i PfsW5DEHP0UVcrHRT/RwsMY9MxpYZBFYEtKkxsutFERr4WtLSlhMLxcOrkKiINddDFxU B6dGLYQ5Wm7axonU3mLlXfN6v1qfSSpfKT5S/Kn3L1iaiCEeVO3KJ1L5vRWpYneLljtv TL69E6LQjNbD3q6uzYHq82FQTlD1Szr7RKtkDNdEVbuceYimJQwOW/39SVfQa2Y/i3Ay bLcQ== 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=XDbgdZg7i1qBVKYqqzMvBkh9KIIU8R0gWwY+sB9w+ho=; fh=U00o22A5guAsQ/H7sYA5gASj7ckr5iMwnVMfCN7Dj3k=; b=nx+nIXCh1KoaJi2P6KmWJXuseQKmP67TcJ/GIjd2u0/BdIBRpLFgfxMGcc1EYrqTlk lkqpjF+pUqjKXfezI7ynO3WSbrabmB6dXzYyDJeSgXixK6dF+xAovpM2VxBIcATl3UOj iIa76p/fbRyGVMWaD6FJEHIExmsrpQA53T0xnvfb1TaaSmaS5pRwoVuTJFdX+LWkmSRw O88T56L43UJcWEA4y4Nr1JjCUaf2cfH64d1JBK006bSL6DBWuqcnX/NuXx7003+onlct Zt02uvlgb4vR94ZsVPAyXbUY9aUU3pNbztwyL3ROZaV3HoG9iaPURJMN2+WqkdZuoFsJ zUjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IB2pxtQa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id b2-20020a170902650200b001bbf293f45esi3965607plk.625.2023.10.04.12.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IB2pxtQa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EEF23808752E; Wed, 4 Oct 2023 12:00:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245033AbjJDS4D (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244763AbjJDSyl (ORCPT ); Wed, 4 Oct 2023 14:54:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EE691BD6; Wed, 4 Oct 2023 11:54:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E6C6C433C7; Wed, 4 Oct 2023 18:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445655; bh=0hQGPDet/2ubMEAKVsIRGkoE0lOJhsfJjtVDXmuhn4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IB2pxtQayP6q4otNg40wSM94rdIZr6pYnoy1FqU/ilsb9JTGCOTvQ5wkzk40XR4Fn 4aXwT8YNufv1TMSFSAgDzPpE1SLXSGn2/0Ua1KTGxK6StLhLN24uSCLexT+mn1BG9D QjpMrnXOiBnpiC4iU8zRe7L6IyaoKFJNg8nRZebEhjNSx30yv62fvTQ3CrnMxgEQ0v kk0S5D8MTKAMccWzpqnpdBdOJv42qbaL2e1cKUjvI8rUY0YVUUSTFmaiOiEuYiNNmD Si1S4u/duMJvTT87s3NT15BW14lHCfKMv7Zj9u+tSoXpZNtQKMgR6MowvPcaR1H+Zh eERgtcSUArcXg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: codalist@coda.cs.cmu.edu Subject: [PATCH v2 25/89] coda: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:10 -0400 Message-ID: <20231004185347.80880-23-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:57 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852659243115798 X-GMAIL-MSGID: 1778852659243115798 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/coda/coda_linux.c | 6 ++++-- fs/coda/dir.c | 2 +- fs/coda/file.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index ae023853a98f..1d2dac95f86a 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c @@ -123,9 +123,11 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) if (attr->va_size != -1) inode->i_blocks = (attr->va_size + 511) >> 9; if (attr->va_atime.tv_sec != -1) - inode->i_atime = coda_to_timespec64(attr->va_atime); + inode_set_atime_to_ts(inode, + coda_to_timespec64(attr->va_atime)); if (attr->va_mtime.tv_sec != -1) - inode->i_mtime = coda_to_timespec64(attr->va_mtime); + inode_set_mtime_to_ts(inode, + coda_to_timespec64(attr->va_mtime)); if (attr->va_ctime.tv_sec != -1) inode_set_ctime_to_ts(inode, coda_to_timespec64(attr->va_ctime)); diff --git a/fs/coda/dir.c b/fs/coda/dir.c index cb512b10473b..4e552ba7bd43 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); #endif } diff --git a/fs/coda/file.c b/fs/coda/file.c index 42346618b4ed..16acc58311ea 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 = inode_set_ctime_current(coda_inode); + inode_set_mtime_to_ts(coda_inode, inode_set_ctime_current(coda_inode)); inode_unlock(coda_inode); file_end_write(host_file); From patchwork Wed Oct 4 18:52: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: 148486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340254vqb; Wed, 4 Oct 2023 11:56:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7FLJn6HCeAbMw2EbR9iEOTwUrZydeJhjweVjBVHvBPjS5YiYw15O+AghmD7NJ88X4am3n X-Received: by 2002:a05:6a00:1912:b0:690:d2b0:1b37 with SMTP id y18-20020a056a00191200b00690d2b01b37mr3750603pfi.10.1696445816478; Wed, 04 Oct 2023 11:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445816; cv=none; d=google.com; s=arc-20160816; b=KurxQsGMTD8BN0T0asdb6wv0+aET1E044iaO3SrRJjphQmFZZ0LfzNS62yxWC/wMSN KUmOk8k2vcbQk3AyrEgc3u/tbfeuFjn0EiLvfxFEJ5lYlOReKIgpm4xj9r9QcDktN0ZD 5+cP4MhHqcOODkqXXLpTLDA3/ds+FCDinqrPjUMR8C71jbQe9MPSCZhBPo6pCHAShY0f 6a8BFVNfVp8v1Ua/RsRqnfQdB4jKleQpZfeGyZvYPw9J4h7jfIss2bPcJe0Sg2OJEs/j 7UuVsrquNKPzPmzFQvGjj70xXasc9gUOFoDhFm+LJbEff0cnuRKDMhYztwrRTMhWoLOo VQNw== 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:to:from :dkim-signature; bh=YeLBDtkEmlMzBbfoWA5faebfvb4mHF7GaaUtunIi7gE=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=qdDdO3SEnFsImDSX6gDIiEk+52V+cg0cU1Qb7k1I0tQun2n10GlOMtd19Fj0Luxtyh XtCrx8l+uZ+0FQHtzUWBd0Bqew/8ntTvFRhLXSxyhm+9zUI4d9FJ66rLfkynKTpNOAqC vnTIU9lUC8AMKU1lFabhN9h0qNuqt1B2gd6H5Ae11Fl0B2ylQuM4Et5XR+Mb6484VSXC qoHJv/QDhES7BZIQ+KwBZ1qHcYz8cnz1ZTcpL+UpIXfvLv6HGrFCjLelotIMd05aHtYr ki/MpF8nK39Nd33H7Npq6z3TLd0sjiG+W6pXRj472xhVqbCwtW8p+PQ8NzsLmZ7rU9Q8 41DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJNDbbs6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b18-20020a056a000a9200b0069338b22bfdsi4444756pfl.205.2023.10.04.11.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mJNDbbs6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 65D63823CEA5; Wed, 4 Oct 2023 11:56:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245130AbjJDS4k (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244771AbjJDSyl (ORCPT ); Wed, 4 Oct 2023 14:54:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B3121BDF; Wed, 4 Oct 2023 11:54:16 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B9C2C433CC; Wed, 4 Oct 2023 18:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445656; bh=TT4KITqoqB8jSKsxQR+oCA25khBY5ch0dceuLZl/LT4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mJNDbbs6B3Xh0mYVrlNnjJWru2bJV1Mq1I2rrOwZOj7Ad6zDJGpRY/xOqBO3ax5gU u6vXqX6WBSrsPHEw1L/GGXLyzDLsRG7yJAwFwsYdJqZuD1ngL72MkfLWYw+RF6G0sR 4p8HnRxTmxNiFPu+71InFc9JzhBbusg1VI/1hSPbJhjX+ZXiaeuDF9AVPOE82yyl/r LfQLrQzxSA3m45mKjZD0OS8+Jq+LeRdn6GcmmX45PNLHvMUPYXgo/OWWUzbPO38xQY ilUuLhCPusGNuZ8AhBQlkFg6ZD3GJH3gKGyEdy0uM/Z9f/TtST59uoN4PHudiV7Wd/ 1LCJwfhHZuNxA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 26/89] configfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:11 -0400 Message-ID: <20231004185347.80880-24-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852368666331940 X-GMAIL-MSGID: 1778852368666331940 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/configfs/inode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index fbdcb3582926..dcc22f593e43 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -88,7 +88,7 @@ int configfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, static inline void set_default_inode_attr(struct inode * inode, umode_t mode) { inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); } static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) @@ -96,8 +96,8 @@ static inline void set_inode_attr(struct inode * inode, struct iattr * iattr) inode->i_mode = iattr->ia_mode; inode->i_uid = iattr->ia_uid; inode->i_gid = iattr->ia_gid; - inode->i_atime = iattr->ia_atime; - inode->i_mtime = iattr->ia_mtime; + inode_set_atime_to_ts(inode, iattr->ia_atime); + inode_set_mtime_to_ts(inode, iattr->ia_mtime); inode_set_ctime_to_ts(inode, iattr->ia_ctime); } @@ -171,7 +171,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 = inode_set_ctime_current(p_inode); + inode_set_mtime_to_ts(p_inode, inode_set_ctime_current(p_inode)); configfs_set_inode_lock_class(sd, inode); return inode; } From patchwork Wed Oct 4 18:52: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: 148507 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340865vqb; Wed, 4 Oct 2023 11:58:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IErxWQe36wy44Jpel8pGXUmw+oZpeYO+jnqcCb3jc3KyO6F0FhJjEt3vcH/v4z+pLa2DFDe X-Received: by 2002:a17:902:eb4c:b0:1bd:bbc3:c87b with SMTP id i12-20020a170902eb4c00b001bdbbc3c87bmr2863829pli.41.1696445892525; Wed, 04 Oct 2023 11:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445892; cv=none; d=google.com; s=arc-20160816; b=iRIlgaT41BG8/PmYLPmKqVJugNkQ1VQ1zrR5in9fm/b+gdkixaagcyjdMPz0/K/HSH 9sRT1XOQPmnTJ/K4l2toS/yBiV9euugDI6WmuMW4jQvA/HxM5cptqzBFIznTxPEGYMXr wpFc/yvQMt87lEnq/l/u9DKIr8Ao9to0XIaNV9lBeXIy4hHVozV1YSonOiFSfestkdOD fvr09MlEvkgfdPPrAU4LXEzr03spGpNu/NGV1NiAbD+VgMv17bkS1K/utYwZBEoHjtGK BYqmqQNY1lZllb4VBe1JTATYnN7uvD0w56wy4z1Qe3GyYwbrFu72d85qbfyNvrzQ1T2R FAmQ== 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:to:from :dkim-signature; bh=EZqu57Vw/zMIjYNamjLQRfk5Y3T3JiXR72Fdrr5PR+o=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=cBPa/IwmfEciWSxqviBVnkiGs+a+rmbwVzpoWCCpfbXF4bD4mcskIuNTcVbkiWzuHa kxNUMzJMh5bGAjgWRVeskUlnZpApa7GGhEhCx8LhKn5FsZlnty0fAJ78BQgEeH9oIAYC gJUhmGk8JAdQsczD68BFXWrJmmAtg8AFAPquX4EmUHTb9lIYbJrDSml8+9kXOxXH80sW 72ZWsHlQFkUN9zJJjbJ2tECX7x1cNbnB6ZPlXlOpU3bcySFhWCYPKTYirciXFuf/fblC vIr+U6Knx2PpoqirYS4kL7eCNdvmLQDHYwYfbFDRxboig+cuF8jZWeF5wVxhPSrxqftn eqUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TK6uZHH3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id d14-20020a170902cece00b001b864d88d85si4391208plg.636.2023.10.04.11.58.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TK6uZHH3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D431B83F02B6; Wed, 4 Oct 2023 11:57:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245044AbjJDS4I (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244777AbjJDSyl (ORCPT ); Wed, 4 Oct 2023 14:54:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36BE81BE4; Wed, 4 Oct 2023 11:54:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88108C433C8; Wed, 4 Oct 2023 18:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445657; bh=/UW/4oYqeLROuN+IeHSLI4LxkY5cLiAitabYGolkAO4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TK6uZHH3/dWRky4EpYJAO46sCCpL0usYO2CbmVlrDLQLC09ynkIurYaECv+m8Tefr 6N/dkkpriT7VMqX2sggy1PLKj4K3mv1yCqsNLWSGgXcd3BrzUP78+KrVk+GDMOoWVO hf1SiZqzEAHksI7t4A9I6m1nv2PcuhGXWR/VR+l4L736A34Pa6gRXY0sa1QJnC00BW 8Icev5qJwx416LmAfl2KOFIthjQv+DcKATTbPJu0H+GXJfIcw4orHOUOJxKW7YcROV kCmLDRRZdl+BrNHQGm+gjNJhCKjDMi2NifWIvEgNzdIaj0aTcTwY/kZM7RpTg8PPoh c5Cm5j/v5+SaQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 27/89] cramfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:12 -0400 Message-ID: <20231004185347.80880-25-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852447829577559 X-GMAIL-MSGID: 1778852447829577559 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/cramfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 2fbf97077ce9..60dbfa0f8805 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -133,8 +133,8 @@ static struct inode *get_cramfs_inode(struct super_block *sb, } /* Struct copy intentional */ - inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, - zerotime); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime_to_ts(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 Oct 4 18:52: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: 148504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340796vqb; Wed, 4 Oct 2023 11:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcaMteGd79ZESdV5T+77a233fOdIwXaRy0L7KgXtEFItmeRr3nHxJ/aHmFFsGkNDT33Qml X-Received: by 2002:a17:902:d490:b0:1c6:de7:add9 with SMTP id c16-20020a170902d49000b001c60de7add9mr749445plg.19.1696445884356; Wed, 04 Oct 2023 11:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445884; cv=none; d=google.com; s=arc-20160816; b=UNoh46xg91tmy1+XsdHrjoqej+VQyt+s9dfWt3NOQbFpJqnpYsdT+snvI4YXBMs1Mp eZy6dkbf36+COJZaTYKZLpEe7973qCC3v2iy6nW6xhDZU/Z6dh8nC3zNbVb+b0g1Vv8m wlAjWebxxSX1Tlzx5iNFCx84Qb8O92q3oQg10P5FvDxcgmPVus4tP5Qgd174nigzUr7X WQoVxe2PLS2u88tVWIUiXTdG7X6rcXCIScf8qGtgCqHmvB45HKW/UumrbwuoADhg24Fh jBxs7gI/zw1RKR4FDkj0UPHQzO9/QEc9FpzLfl+Ix/SvJtJCuaqLXJs9QOGcZ8parZq9 3CXg== 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=mNnuyOB1Y7CrT4vehDu+bflCoxw82wviLe4M1XqO1l4=; fh=x+1U+LJYd0/ljzTnC8XLOei3LVvo+3LKL7WiISSQ4P8=; b=UIxn5qfmkW6nlBeWyQN3m7kCO1uic1NHOTUmR+qfL/I3AMD0PmqDnJO6uEuYobpo5q yUYigiqSBrvgePUyiEdajetu9XZ/3KErBq+JM1L1Jp+pQnV1SmF6k+SdwoXWRVKOdJTz VYpnzoc+dyVmi/3Bg6DN6ndLRN8aOHIw1P+LGMlNPOWi3lFlguKKVUgeMMY7j3mVoh1g i0Mwcw3tQCPnuXvSUsexUk+YfkSn9EZ5TvhG2kYQNW1vZkNjtxRG4iPBHhqgO/t1TRfG kAQDCtG3P//is82Q/ezUspJrDksz4JyWE0pVRiSatYwjQY/WpvnK9y96jfBPrlNc4Dz3 0ILA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aDgeqyd0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id u7-20020a170902e5c700b001bf1973eaeasi4741140plf.577.2023.10.04.11.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aDgeqyd0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9E57E83F0290; Wed, 4 Oct 2023 11:56:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245117AbjJDS4h (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244790AbjJDSyp (ORCPT ); Wed, 4 Oct 2023 14:54:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CF231BE9; Wed, 4 Oct 2023 11:54:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D974C433CA; Wed, 4 Oct 2023 18:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445658; bh=v4JZ/Qz5VXfK/0x8Eh9nkHzGJciYxKKhvLE8zn0Xn7Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aDgeqyd0KqozhiZgYc9/omyN4u+x3TIH5SJxjs3IO+OzBZhBze4yTEFBHgDPaSEdZ BPDdamwaS9bAyTo7ZpZVD4Li0MD34J8MjaY8NPJzGrasb7pE+GX584STTE1q2aYTOk nr9Fe5XfVN9E88Sqj+v8kA3Qkf19LuRluTr5PHZufP2S+2pPTda5c/4XDo7W485IhW DLFMBb/SlkoGvcIjxIk78jLmdZ54O9vFDqmskvtUS9h4isYDQaeQq2sIgcZORiWc0u dUhgXOiMnUGjqe4UbEUBiQ6LRdyEMD1tvQn42JbxY1ZFvUGyngG1YdEzhAhd05ilvW A/datOwoFhEJQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" Subject: [PATCH v2 28/89] debugfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:13 -0400 Message-ID: <20231004185347.80880-26-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852439206148543 X-GMAIL-MSGID: 1778852439206148543 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- 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 83e57e9f9fa0..5d41765e0c77 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c @@ -72,7 +72,7 @@ static struct inode *debugfs_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_set_ctime_current(inode); + simple_inode_init_ts(inode); } return inode; } From patchwork Wed Oct 4 18:52: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: 148512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340930vqb; Wed, 4 Oct 2023 11:58:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGerul2rDYBUVrTPzYSo+39kMYKl9GV7t7oEOWZ/imTaePNIVzpYu/Ar1G+tEOiuDLFIEew X-Received: by 2002:a05:6808:3a7:b0:3ab:8e86:fc26 with SMTP id n7-20020a05680803a700b003ab8e86fc26mr3304246oie.46.1696445901744; Wed, 04 Oct 2023 11:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445901; cv=none; d=google.com; s=arc-20160816; b=cKlJXk1tfYrnWjpLdh3HJSonh41LRKpVAEde8r9lsDLtTfYO4iBnVizPoVXssJ2lx2 jy2V39Qv7ZyqGGSjPqqCwX+IUFcYTM9qpeVlNN+vN8y+1PzfHXnYVZKn4upcq/rvEKMX cckOoGtUIFBmwinbiyJnDiHs9K8lM8UWmhfMdHjpl4UfohnjLo5YNCEBfFKfyU89ly3D uSrYmoKUwD8LdliYqYQwhO6TUdvByN7vZwiC60WlkKjNOXaw3ZB+J6fDKSly8rBvN6hE o8G9QzvSPfiCrQAQn8sY/3UvY7ZYR8VLfKhvEpkqw4TSlWpYSqw4DR8kKX2zG7GhpTsb fbbg== 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:to:from :dkim-signature; bh=zrZ9CGTawAVnh7tAVenav+gbA3S8n0loyBvYv2jYrZY=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=vRcH2H1LZCWxJnpwFHBGnjdXFBCy3QxrrLcRyZJneVsRaIFCSCOYqSmsTuG/XE2w4m iIflaNebV5FFjkLA6zgHDbhXU6hf5zNDNrtLWjYyWb/yJIWo38ZinWslDXOL0ywLI8sP nkNj2GL7vsFpOZDXkZw47YrsL9djmwWm8JSliBSO14o+T+xyoZsFyjSbnNumt1dB9+kJ 3k3cc1K/Mzo80NT74z72L40DEyFsDQC4JvfxxK6bG5qYq20JqJOBj26k5k/goPrRJ1JR 3C1946c/7CtgL7O8/Xm6qMqmpXWflmiPhj00NnxvottA4bc9oCiJ4XbFRuvyt89QmXDW 7n/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LPs5Jbn4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id n68-20020a634047000000b00565eee2d0fesi4102971pga.324.2023.10.04.11.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LPs5Jbn4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 55FE081E5158; Wed, 4 Oct 2023 11:57:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245061AbjJDS4R (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244792AbjJDSyp (ORCPT ); Wed, 4 Oct 2023 14:54:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E9961BEB; Wed, 4 Oct 2023 11:54:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3E3DC433C8; Wed, 4 Oct 2023 18:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445659; bh=/XcvuMaQVt7b8rn6Ny+0hmNYyYpeJbw5vaphsCvLG8U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LPs5Jbn4EOPxDrbp0SNjKvpqQsZ5PFGs4lKBNa9P6plZ09G3Gqexa1ItjwwxZQKel Ncp/CqTEZUqC1CVQMdpb5OD8q5u7rYJtn73MvEQLNNPIpBHIIqYmSgDAGOehKtG2aX D3wGq0P+TkBjCkRTD/f5i87zHfas8n0VW0oGN0o6MBs5xeeRa8tJ8DPMaJfQr2gbYs 0aZwnnDDey/pUSa7+3XK4gbsQ1gwqyzLzRAH1YwmnAtM3Cuu3XHUCiguEaELNbM9WK 1Yuk7LKHlEhRXt9sgJKIQVtQAdvXDNBMmYHJUoZAQ/0jvhIOo/gEJaHooEhl9f4M2e Y4D+ZguTsqMOg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 29/89] devpts: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:14 -0400 Message-ID: <20231004185347.80880-27-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:49 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852457893755571 X-GMAIL-MSGID: 1778852457893755571 Convert to using the new inode timestamp accessor functions. 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 299c295a27a0..c830261aa883 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_set_ctime_current(inode); + simple_inode_init_ts(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_set_ctime_current(inode); + simple_inode_init_ts(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_set_ctime_current(inode); + simple_inode_init_ts(inode); init_special_inode(inode, S_IFCHR|opts->mode, MKDEV(UNIX98_PTY_SLAVE_MAJOR, index)); sprintf(s, "%d", index); From patchwork Wed Oct 4 18:52: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: 148505 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340797vqb; Wed, 4 Oct 2023 11:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTf851G1lGvE+3TIRampY+FrDlEYf/nMCmAhbYDvteBUMD0zMyIb/6BN0p8nPpysnwrHRK X-Received: by 2002:a17:902:ceca:b0:1c5:9c73:c91c with SMTP id d10-20020a170902ceca00b001c59c73c91cmr3866634plg.48.1696445884376; Wed, 04 Oct 2023 11:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445884; cv=none; d=google.com; s=arc-20160816; b=S5Ad0uXNbQrWSTKhC/xlheg/DGO5jFXi70usbzCWYKhTx9downu6D/CT0JQnfYPzWy eEbku62xxYFwN2AkHdPR4Ad5//jhR/jZ+8p5PTIGcUTd1PR+FV01Te4p5ch52MiGIzqd AkhWzGT9vdkTk9ITKSCotjnAmfdJ2f6CgDxOidNK5C0XJl1hRQ/5O+FRkQA37mZNPWlS qWRM+erQNRWtfvpjBqY44IePbPRH2093H68DhMHP+e0N1yIL+lRXPIw0NFWBZ8xnbFqd fAW1tnRT5v7C1sk9mXvtXxrK9GHoSHlIp6ET107N9fNdwFHnZDFAZh5K+BooEJFDy7BP VuIg== 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=IjOV3A85H/GlFnN2QdGy1q10WkfUstwXWjyEH9Sf66Y=; fh=orFn1WGA/+L3XOU5eysx2TNcnjC3zPbCOH52pqzS4vU=; b=0KYzKC1moZaZrfZ0ufZZVpZM8BleVKzBIWbqgzBW3nVjVOV61JGz8vNYwU6LcWnmz2 W5ByBKUucG/0Lq4weyJPiH0Fj4myIyh+/l8jB/hyUbRKdR8Hyg//fS4ca8yjB912bGZT tFKKKKqHoni1UD0/rog69+WqXPR7rNM38o23GpeBWidACK5rHmfdTM+kYpXGgLeS0QyD C/PtXq1qbCTfzzt9S/VxgoxceHj/tCLuDm2araVyaEorn4YgvKYtdUSk/nG0XV7HGs1h gT+eYfcJiXf2ruXyvBzNyt517erpYJqOmw+abnjPa5eFsZ75SdJnY6h5XD7UfS6BABcK l9tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bd8rjo0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id p7-20020a170902e74700b001c752da513asi4555590plf.405.2023.10.04.11.58.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Bd8rjo0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DB60C83F0293; Wed, 4 Oct 2023 11:56:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245065AbjJDS4W (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244739AbjJDSyp (ORCPT ); Wed, 4 Oct 2023 14:54:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F581BF1; Wed, 4 Oct 2023 11:54:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1C9FC433C9; Wed, 4 Oct 2023 18:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445660; bh=YEqq5TbDW6Icj/FoFvAK1JpXcDhyI6Wo7wQqM+3TX2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bd8rjo0AWU8SX0B55IRMQTx0py0nMGADHJYF2r+l4nDxPRDpG5g0f8XP3zHEyuoab n/eE5y6XuC1klvpu1n3fY/4V1G3AY0UQOMxq7omLXgA83THjM/UYPYRGjGR4mHGjDt uaSp1Yj8pc0m5k1CT5f6QGqvqVbxGVDWemc1h6999KeoJHsR1DFO4DynyNTXdH6tb6 PTTqYbZjgILcdVZf38aontmXCApzH12RxMdrrrIwy7e2ASWltaS4woF2s/zN2CgmD0 /MxfjScR6BaDGVLUvX0iDdZGZ6xcLgYPC8WDszhsu7gGKDYZ2xP238NVZrI4efHpGg 4Veq+mfxnz/Kg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-efi@vger.kernel.org Subject: [PATCH v2 30/89] efivarfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:15 -0400 Message-ID: <20231004185347.80880-28-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852439450017255 X-GMAIL-MSGID: 1778852439450017255 Convert to using the new inode timestamp accessor functions. 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 59b52718a3a2..7e9961639802 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); inode_unlock(inode); } diff --git a/fs/efivarfs/inode.c b/fs/efivarfs/inode.c index db9231f0e77b..76dd3c7295d9 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_flags = is_removable ? 0 : S_IMMUTABLE; switch (mode & S_IFMT) { case S_IFREG: From patchwork Wed Oct 4 18:52: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: 148514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340955vqb; Wed, 4 Oct 2023 11:58:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGTsdIs0fIeRUh+/cDD2o7tomLm2ywZaCYystwof0Pr3qf7iJ+qLWMnOycgvmVg1ei7R8PV X-Received: by 2002:a05:6808:b1c:b0:3ae:4cab:526a with SMTP id s28-20020a0568080b1c00b003ae4cab526amr3334130oij.14.1696445905013; Wed, 04 Oct 2023 11:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445904; cv=none; d=google.com; s=arc-20160816; b=qJm1oAw2Z2k/PddEJoqR/Khz4GtvH9N0DpJqyOOFyer8nG2vUO05BftuqNGCMIymgj 1f1YsMPOkDt8RUECUY1feER0wSIT/6F9nVEn2RIAyKAAzFNLbfYkZ5IM/a0dVA9pFUmV IDDL5fX9fHwFJ3PtfzlpOLCTaW30Dh+GDAlQfsXifTKU9o8BFCVxfVKbEUtnD5LSARmy zkc0I8y7ENZpa32J/jndqVR8f/UZ4hC8LEF3ZCNDOH7LmJpySeU+gy1lc2yBh/8KBi+y uxOShJ/12+FfwjgRXH/FURX+FBJLWb5B4+LwEsFChrMqFcKVJ/1QfdKVGZHacI3RzC1L pCgw== 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:to:from :dkim-signature; bh=qMuMu72Zkn1QyLDPQ3bo9Xq52/uC2nxkARbSp1Gxg5k=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=IxEXvdlenMdWZa6A90qPEljQ9yK2xncL6/jgqsjdpbK/wjALQ8/tzPKvHEuhJpfD8M ZQCmHouQh0oh2817LwR+6MdpTTrgdRzHYZeJPP0eR5tIdte8+qzphz7g4n1oE0Lu0CpX Y2VmJhKl1D6Cqg++yeHCh4gnpmMZboUABtYqYCcrIwzqBHH2zKy+N25/PSq4BE1ryqSE ZiMtfVnDqKqTFQTXBL0jpcCQkpRleWy/6uGj45zk+5BuwEpBGxO12eVz005JeoXHm/Kz mrVhvNo0R2URVDu2MNEGIA18BEWcAY6PLs9UHs2tePyZyf2bSPE3xCTxA+ThFl/NiF5Q WS1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Yu7Jho/i"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id z1-20020a63c041000000b005859a8ae4d3si4172243pgi.483.2023.10.04.11.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Yu7Jho/i"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D85C08303B20; Wed, 4 Oct 2023 11:57:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245055AbjJDS4N (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244791AbjJDSyp (ORCPT ); Wed, 4 Oct 2023 14:54:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A59A1BF5; Wed, 4 Oct 2023 11:54:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF999C433C7; Wed, 4 Oct 2023 18:54:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445661; bh=z2funOQvTD+nsh/eRCv4vA0TR68VHS1VOH+S/Cqeqoo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Yu7Jho/i94Dh+tD5G4TSUQIuySzOdLsquKYmzvv5YyW7+E8OHen8ClaA9MQbcvlBO a31Z32wcRiISih/yBaZwI2ivIrlnJw8WhjY/1mtskyHHwZKO/D2kDg0VIKQUip5pNd 7IIXf6mHQ2JUpFO4inlk1ocOJ++28zE6iA655JBWe0cAVuteD5oV9PETvU1cB/Jlny tJ0gF0YsvIM4/vBSjiT17H1ZgBVf1momTCDiXeZjfDzXabqgtG8QKYWH7Zvyq2pnOT Ncamd/sJwLZn+QArTKOLijTPMYE8RI0TO3EFBvJRxZpzOdG0dMIjnQ7KiZn7/P7xpo C/Dwpkhj4KTrA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 31/89] efs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:16 -0400 Message-ID: <20231004185347.80880-29-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:54 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852461178154253 X-GMAIL-MSGID: 1778852461178154253 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/efs/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/efs/inode.c b/fs/efs/inode.c index 3789d22ba501..7844ab24b813 100644 --- a/fs/efs/inode.c +++ b/fs/efs/inode.c @@ -103,10 +103,9 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino) i_uid_write(inode, (uid_t)be16_to_cpu(efs_inode->di_uid)); i_gid_write(inode, (gid_t)be16_to_cpu(efs_inode->di_gid)); 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_set_atime(inode, be32_to_cpu(efs_inode->di_atime), 0); + inode_set_mtime(inode, be32_to_cpu(efs_inode->di_mtime), 0); inode_set_ctime(inode, be32_to_cpu(efs_inode->di_ctime), 0); - inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = 0; /* this is the number of blocks in the file */ if (inode->i_size == 0) { From patchwork Wed Oct 4 18:52: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: 148510 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340919vqb; Wed, 4 Oct 2023 11:58:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFm+P0UJinEONLN0H9QeBt96SZMm853ipbB1vpuKq2bWhioAMGmTkGxWmBFQ3CEQX7En/F5 X-Received: by 2002:a05:6a20:1596:b0:15c:7223:7bb1 with SMTP id h22-20020a056a20159600b0015c72237bb1mr3481866pzj.20.1696445900774; Wed, 04 Oct 2023 11:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445900; cv=none; d=google.com; s=arc-20160816; b=NHw+bo+f2zF/QYfD6dKCMJZyZtyuTDkVkiCso0OFO+Q7Enohb6Lm98sCPjfAE6lTtY fmuDTjUiSr5oKbY+37IRQ/fPa3MwaTwMEQj6zLOoeVAXA6AUjp6zHmZ18GA2zCC09lWd iFygYDp+pCLne0fHIUJcOq7hxmZz7D8q48zJSN4oWBkqeH8PHSgAkB8Cv7QxYfdfC+NI bl2NniZAnQ2EB7vk31N01UEKsHx2wx8+4PR55A9dgl5o7bzhfnt20Jk5n+t996VFSyKJ QtLwxe1ybSvCJU1+5NCHu9SgdyN0459ZKNvAdBy/L6KcwQzt+m9u2eK9USyMKQq8poa2 SqNg== 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=djb4EE+iY2+MWSpPGuiSRgu6vQHVBbvn6iQ6TrWWdc0=; fh=saQy1qmSLuCOGrt+QoyBOB3OaXGklLJfNj6dMfZ9i24=; b=qAxm192WJbS3e5ShBFK9OHh5md1jQJ9kwjE/pxJASmWh+RWB1GkUX1/Xa5m/iluf+M IblZQ2mzwjacMFEGmdbz5bJEOVSwtnU5oVUV3xFHf2Qs1ycxIwULm7BL+T5GuaPEq9Z0 pPayRCbPfj/0PpCP7Q5DdEsn8N9rgQDxBG0HGVdzDjbpIh3BZWWceYctTt87LAxuKXL+ GeptP+ih4ySmmZ5XkdooVtxel5ttVFIUFG2crZC8noYYYIN6tdoPfCyZ1fCDt3732rho srUsgYpealQe8vQTi1V8fTd95Fs9ACsDcW2Cwf2G64Jo+7vjl88ziXMnaoVkEzjKJlI2 DrIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SYXkeAxA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ds8-20020a056a004ac800b0069339f19f93si4157788pfb.277.2023.10.04.11.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SYXkeAxA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 4CA2280AC443; Wed, 4 Oct 2023 11:57:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245071AbjJDS4Y (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244694AbjJDSyq (ORCPT ); Wed, 4 Oct 2023 14:54:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5F3B12A; Wed, 4 Oct 2023 11:54:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB20DC433CC; Wed, 4 Oct 2023 18:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445662; bh=NKCGSIQYRSxC2JawkYr7/YEsyOK3p0HchI8AY3G83h0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SYXkeAxA6GIsUxWdFXlhz0b1EoS94hY6W+5ZE496QCIGR6BNog3PmkPhDJUR+hf0F j94xjhCefWxR0P6uPlC/k3Dl2Tf/q4/w9SCwaLsjcO4KSdIuDi+f5MREUd9HpfyqN9 qfTlqAupj6ao/VhswuFB8CVLXK9n4XTZJEphvPMq+0SjUf481wKGqONpaozmOTHz1F Zy5OpfvyMzcIwNvid3b9NbGYc0dfw1p97dDsxv9ZPr4QPACKm9TjV2aPM+i6gGwLUP 1rYokv2LmDEv2qKfpNT1m7awfHwGPlaxpHCG2jVDxDzQvYe99QiwMJDIG/ujR7a91w XgxekVcEqySnA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yue Hu , Jeffle Xu , linux-erofs@lists.ozlabs.org Subject: [PATCH v2 32/89] erofs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:17 -0400 Message-ID: <20231004185347.80880-30-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:49 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852456746888391 X-GMAIL-MSGID: 1778852456746888391 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/erofs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index edc8ec7581b8..b8ad05b4509d 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -175,7 +175,8 @@ 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 = inode->i_atime = inode_get_ctime(inode); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_get_ctime(inode))); inode->i_flags &= ~S_DAX; if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) && From patchwork Wed Oct 4 18:52: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: 148569 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355803vqb; Wed, 4 Oct 2023 12:24:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXKWy8p7qyWoxsvfNBkrAnTVMZsZ5QHzVOePojaZLSxkf0NXQfSlORLjrbVBGDdReuy1kR X-Received: by 2002:a17:902:d4c4:b0:1c1:e7b2:27af with SMTP id o4-20020a170902d4c400b001c1e7b227afmr3491579plg.57.1696447469978; Wed, 04 Oct 2023 12:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447469; cv=none; d=google.com; s=arc-20160816; b=TLx8tZix0vAkyDKOIuWLfoLVa+fCrteuwQEXKEiF8rmE6JSYucweyp1oYat8s3kPVV w+kf5j4bFYjGdFi/aHzMZuc4TGUJptwfLnzYbzCStPZDXtDxtvg13eFUeShEZpQ+/lbj aGlwVNnfAFwVG102CfIkLFP5tyYQWpknuVnn3XNKmFrBemzL1ybO4qDPdEqPix4tUids nlh7UHMB9YAsc9Qsztb4Kb6NQ4+wo6xEFnuO/hloCH61GiGjQlKQaHSacj6ttURzYFe6 9DDOj4X8sEhZJZEdA0fbgOpCnHIMoHVqiTA1NUj4B2vZUzXlO/k9bgwhoCA9wAdZFuV/ 3Kyg== 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:to:from :dkim-signature; bh=8SA1J+pSRD9omwdMaL7l+I3Jh6EChsmrr1FwyJ4+egw=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=ExStkDNoUXUmdTbge2HgPV5HLmevYXgHTjyMUDxy/wUgUBzgeNfC+1LZPEoKObaCaD 0anTWFMz3egjtkLZrPYXjyFnaikI7JULbwyy0tUEo7C1nvpmqlW3W+itAZ53zFitlXDQ 5aLIwLlUZOOW3oLcJ8PbEikt4plPJ2zO3u3fLnxvxKxJdFeAyjhhUef9wMCQbWTtpJs+ dg28xaoMmFLqjj5HxFCZ5ck9zHWvRcl/NWKrs83KINwegbtMo6eyrU4Pd4SxyEDFH2mI MWeoW7vd89/zq+7KW0letUptZwbOoZfhgcGZ967xp/KxxI7NxTKm6kli2HsDQ72maOr3 yEzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AeoFQ1nO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d9-20020a170902cec900b001bc5a4f56fcsi4594746plg.554.2023.10.04.12.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:24:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AeoFQ1nO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 6612B81C70B8; Wed, 4 Oct 2023 12:24:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245104AbjJDS4e (ORCPT + 18 others); Wed, 4 Oct 2023 14:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244821AbjJDSyr (ORCPT ); Wed, 4 Oct 2023 14:54:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77494192; Wed, 4 Oct 2023 11:54:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7637DC433C8; Wed, 4 Oct 2023 18:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445663; bh=PdvRjpk7Uq2h9jWOsaIRpYPti7242OhJxoh6M5gZNDo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AeoFQ1nOYMJMiJwItTy8f1vsdT50nfGsKewjXG2dMxuRNEL2X+JnZX+0RTeuJS73C 8ZGVh8s4aXdKTRO6CiM8WUIwugiVBH/MEkPrzQ4x7bZPeX55ijUlG6PFMXMNH3GzpN p0VxNsewQXNkUhe1cb8Glh4C6did42Usd8ovfP6NLa3v4F2mRKEs6qMF/qlSS1D4Qx B9xsVTMR6v3P2/biD576G49USFvRj3JHBiCAbCDrAHSiCT+2xEgBU5/nUmLWCHeSUN n/Wyf7ja8Th97TrLvUJEQimtJtiNTRTOXm1+lZtyrtFKvVh78jcaBQxCH3BV61sS5M 1DOOVv73uMZWQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 33/89] exfat: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:18 -0400 Message-ID: <20231004185347.80880-31-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:24:19 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854101918032573 X-GMAIL-MSGID: 1778854101918032573 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/exfat/exfat_fs.h | 1 + fs/exfat/file.c | 7 +++---- fs/exfat/inode.c | 31 +++++++++++++++++-------------- fs/exfat/misc.c | 8 ++++++++ fs/exfat/namei.c | 31 ++++++++++++++++--------------- fs/exfat/super.c | 4 ++-- 6 files changed, 47 insertions(+), 35 deletions(-) diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index 219b1cf9d041..b4d3f791a2e0 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -557,6 +557,7 @@ void __exfat_fs_error(struct super_block *sb, int report, const char *fmt, ...) void exfat_get_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts, u8 tz, __le16 time, __le16 date, u8 time_cs); void exfat_truncate_atime(struct timespec64 *ts); +void exfat_truncate_inode_atime(struct inode *inode); void exfat_set_entry_time(struct exfat_sb_info *sbi, struct timespec64 *ts, u8 *tz, __le16 *time, __le16 *date, u8 *time_cs); u16 exfat_calc_chksum16(void *data, int len, u16 chksum, int type); diff --git a/fs/exfat/file.c b/fs/exfat/file.c index f47620eef71b..2a4ec907e42f 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -24,7 +24,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) if (err) return err; - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); if (!IS_SYNC(inode)) @@ -292,10 +292,9 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry, } if (attr->ia_valid & ATTR_SIZE) - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); - setattr_copy(&nop_mnt_idmap, inode, attr); - exfat_truncate_atime(&inode->i_atime); + exfat_truncate_inode_atime(inode); if (attr->ia_valid & ATTR_SIZE) { error = exfat_block_truncate_page(inode, attr->ia_size); diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c index 13329baeafbc..a2185e6f0548 100644 --- a/fs/exfat/inode.c +++ b/fs/exfat/inode.c @@ -26,6 +26,7 @@ int __exfat_write_inode(struct inode *inode, int sync) struct exfat_sb_info *sbi = EXFAT_SB(sb); struct exfat_inode_info *ei = EXFAT_I(inode); bool is_dir = (ei->type == TYPE_DIR) ? true : false; + struct timespec64 ts; if (inode->i_ino == EXFAT_ROOT_INO) return 0; @@ -55,16 +56,18 @@ int __exfat_write_inode(struct inode *inode, int sync) &ep->dentry.file.create_time, &ep->dentry.file.create_date, &ep->dentry.file.create_time_cs); - exfat_set_entry_time(sbi, &inode->i_mtime, - &ep->dentry.file.modify_tz, - &ep->dentry.file.modify_time, - &ep->dentry.file.modify_date, - &ep->dentry.file.modify_time_cs); - exfat_set_entry_time(sbi, &inode->i_atime, - &ep->dentry.file.access_tz, - &ep->dentry.file.access_time, - &ep->dentry.file.access_date, - NULL); + exfat_set_entry_time(sbi, &ts, + &ep->dentry.file.modify_tz, + &ep->dentry.file.modify_time, + &ep->dentry.file.modify_date, + &ep->dentry.file.modify_time_cs); + inode_set_mtime_to_ts(inode, ts); + exfat_set_entry_time(sbi, &ts, + &ep->dentry.file.access_tz, + &ep->dentry.file.access_time, + &ep->dentry.file.access_date, + NULL); + inode_set_atime_to_ts(inode, ts); /* File size should be zero if there is no cluster allocated */ on_disk_size = i_size_read(inode); @@ -355,7 +358,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); exfat_truncate(inode); } } @@ -398,7 +401,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); ei->attr |= ATTR_ARCHIVE; mark_inode_dirty(inode); } @@ -576,10 +579,10 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info) exfat_save_attr(inode, info->attr); inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9; - inode->i_mtime = info->mtime; + inode_set_mtime_to_ts(inode, info->mtime); inode_set_ctime_to_ts(inode, info->mtime); ei->i_crtime = info->crtime; - inode->i_atime = info->atime; + inode_set_atime_to_ts(inode, info->atime); return 0; } diff --git a/fs/exfat/misc.c b/fs/exfat/misc.c index 2e1a1a6b1021..fa8459828046 100644 --- a/fs/exfat/misc.c +++ b/fs/exfat/misc.c @@ -126,6 +126,14 @@ void exfat_truncate_atime(struct timespec64 *ts) ts->tv_nsec = 0; } +void exfat_truncate_inode_atime(struct inode *inode) +{ + struct timespec64 atime = inode_get_atime(inode); + + exfat_truncate_atime(&atime); + inode_set_atime_to_ts(inode, atime); +} + u16 exfat_calc_chksum16(void *data, int len, u16 chksum, int type) { int i; diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c index 1e1ffda279cf..59600cc251ba 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -583,7 +583,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -596,8 +596,9 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = inode_set_ctime_current(inode); - exfat_truncate_atime(&inode->i_atime); + EXFAT_I(inode)->i_crtime = simple_inode_init_ts(inode); + exfat_truncate_inode_atime(inode); + /* timestamp is already written, so mark_inode_dirty() is unneeded. */ d_instantiate(dentry, inode); @@ -830,16 +831,16 @@ 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 = inode_set_ctime_current(dir); - exfat_truncate_atime(&dir->i_atime); + simple_inode_init_ts(dir); + exfat_truncate_inode_atime(dir); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else mark_inode_dirty(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); - exfat_truncate_atime(&inode->i_atime); + simple_inode_init_ts(inode); + exfat_truncate_inode_atime(inode); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); unlock: @@ -865,7 +866,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -879,8 +880,8 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = EXFAT_I(inode)->i_crtime = inode_set_ctime_current(inode); - exfat_truncate_atime(&inode->i_atime); + EXFAT_I(inode)->i_crtime = simple_inode_init_ts(inode); + exfat_truncate_inode_atime(inode); /* timestamp is already written, so mark_inode_dirty() is unneeded. */ d_instantiate(dentry, inode); @@ -994,8 +995,8 @@ 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 = inode_set_ctime_current(dir); - exfat_truncate_atime(&dir->i_atime); + simple_inode_init_ts(dir); + exfat_truncate_inode_atime(dir); if (IS_DIRSYNC(dir)) exfat_sync_inode(dir); else @@ -1003,8 +1004,8 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); - exfat_truncate_atime(&inode->i_atime); + simple_inode_init_ts(inode); + exfat_truncate_inode_atime(inode); exfat_unhash_inode(inode); exfat_d_version_set(dentry, inode_query_iversion(dir)); unlock: @@ -1330,7 +1331,7 @@ static int exfat_rename(struct mnt_idmap *idmap, inode_inc_iversion(new_dir); simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); EXFAT_I(new_dir)->i_crtime = current_time(new_dir); - exfat_truncate_atime(&new_dir->i_atime); + exfat_truncate_inode_atime(new_dir); if (IS_DIRSYNC(new_dir)) exfat_sync_inode(new_dir); else diff --git a/fs/exfat/super.c b/fs/exfat/super.c index 17100b13dcdc..17d35107b850 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -377,8 +377,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 = ei->i_crtime = inode_set_ctime_current(inode); - exfat_truncate_atime(&inode->i_atime); + ei->i_crtime = simple_inode_init_ts(inode); + exfat_truncate_inode_atime(inode); return 0; } From patchwork Wed Oct 4 18:52: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: 148485 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340197vqb; Wed, 4 Oct 2023 11:56:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCAA04epamzvfScRN6/J6jwbyYmIjFIpabkTOpwZ23Be/RpOhXViKRECDmZJB6Bgexl/iD X-Received: by 2002:a17:90a:bc08:b0:279:9f8:790c with SMTP id w8-20020a17090abc0800b0027909f8790cmr3024534pjr.37.1696445810221; Wed, 04 Oct 2023 11:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445810; cv=none; d=google.com; s=arc-20160816; b=heHaChqI7aqpAOmHlNn60GgStXpZ7wv7PVzAmk6A6WHS2mVQOPBKrSGRZAj7WUD4VM PbYph4b+fI0io1EFZG8hYx6hbQnCVVOBwkBw6E744bszVcj8q5CPQP+t7sEo69EdVMxy RjBt3cnjCmf9cYrZJFdA+X5ljuAp11HcuXuobWvaF47rjLyaLBjS2PjsJxbz8MDZHYpB TWVJhj2hKXfYRMMnioTbXyTEFxVXMAnZm0QJzj9Ec/6O3baW74kKhR+u0H2hAlVpKMME cXOVsUosof0s63qrp6E1rA9/RuPzSmsf2BvTwk5H41kIrzfwXFrufVY/tMVGeH30Rt3f rJMw== 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=9fjsZ6DU71JquqePKS+1BYEetvD2Py2K3ZLM/N5yv0c=; fh=aD1RA/mx6kHR1Kdf3Qx+6NOt32D/zEAMDihfEgEurGQ=; b=EmyLihYLOpXBbhoK0XNct8/Ev/cmDGRW84xRbQ1u8G9ALWTeAoGIBDK989aB7Gm7jP Mf8ghw+zccJPt6glLPr2YccPdJ3uxkwBWmO7XikHc8M/fcqKOROEjFva3dZlJ+pcR+8e vPXlGY/e+WjKDNy6XfUdyXL97JHunfqfWiQdNdV7sXo9E5nVmIFXaDL3KXOTmARZZmAu Nx1lEyitG/D2nfxRaVMN5Impm/L8IkQkGLKJtflU9XaOq9p8sCDKxV5Qav/M6bSiig+0 CkmTDAEx1v2/bE9+onA/QLEtdnjw7jnISeBl0dxVCpDYzEcrItWy2aijaoYZIqXWxkz/ LYxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i1Gu5zmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id x8-20020a17090aca0800b00268278c51e3si2004159pjt.49.2023.10.04.11.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=i1Gu5zmr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 258C38239E97; Wed, 4 Oct 2023 11:56:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245084AbjJDS42 (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244503AbjJDSyt (ORCPT ); Wed, 4 Oct 2023 14:54:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 635B6111; Wed, 4 Oct 2023 11:54:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD8F3C433CA; Wed, 4 Oct 2023 18:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445665; bh=sIjp5C6pYgiPzOE+b0vYq4GXhTZpBRX3EHhM6qcx83A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1Gu5zmrWs41lpKk0MVqCZjGAejUIlHcaMof3kmm+E04kRfDMmFFxOEbOg4aXAn8/ jZ0GlZiUNfFp8LEUTpV+9NaCRJd74Im9tBY1w1yGDXWR0wXuflSDp7eTTAfd0MK5PL TeAIDaFTWM34MjgrGjqO60m37cFCRs2LD43Y1Zk/lyHT7w0PIFQ8ayHdw7jAeBr7Sp /3nGNZjbnsFzKt5ij89DPqNxC7nMbPQZypLrhkEkkKNhNAlDkB10dCWGX/xQHp6Ncf 9O0t7nxCdTkzsOLBffZh5LGUXid/wgfZTENS+I15GimJnIGa8CJbuBg5zUEOmdLVnf soX9BiW9ZTbjg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-ext4@vger.kernel.org Subject: [PATCH v2 34/89] ext2: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:19 -0400 Message-ID: <20231004185347.80880-32-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852362293723049 X-GMAIL-MSGID: 1778852362293723049 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ext2/dir.c | 6 +++--- fs/ext2/ialloc.c | 2 +- fs/ext2/inode.c | 13 ++++++------- fs/ext2/super.c | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index b335f17f682f..c7900868171b 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 c24d0de95a83..fdf63e9c6e7c 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c @@ -546,7 +546,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_set_ctime_current(inode); + simple_inode_init_ts(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 314b415ee518..464faf6c217e 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1291,7 +1291,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (inode_needs_sync(inode)) { sync_mapping_buffers(inode->i_mapping); sync_inode_metadata(inode, 1); @@ -1412,10 +1412,9 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino) i_gid_write(inode, i_gid); 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_set_atime(inode, (signed)le32_to_cpu(raw_inode->i_atime), 0); inode_set_ctime(inode, (signed)le32_to_cpu(raw_inode->i_ctime), 0); - inode->i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode->i_mtime); - inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = 0; + inode_set_mtime(inode, (signed)le32_to_cpu(raw_inode->i_mtime), 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 @@ -1544,9 +1543,9 @@ 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_get_ctime(inode).tv_sec); - raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); + raw_inode->i_atime = cpu_to_le32(inode_get_atime_sec(inode)); + raw_inode->i_ctime = cpu_to_le32(inode_get_ctime_sec(inode)); + raw_inode->i_mtime = cpu_to_le32(inode_get_mtime_sec(inode)); raw_inode->i_blocks = cpu_to_le32(inode->i_blocks); raw_inode->i_dtime = cpu_to_le32(ei->i_dtime); diff --git a/fs/ext2/super.c b/fs/ext2/super.c index aaf3e3e88cb2..645ee6142f69 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -1572,7 +1572,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); return len - towrite; } From patchwork Wed Oct 4 18:52: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: 148513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340932vqb; Wed, 4 Oct 2023 11:58:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+qK3cY1Ey57ueCYq5sz6gRc81u9vBP36A2W6AndqR8McP9fO2jq+LLAwJaUJrNXCvmG6Y X-Received: by 2002:a17:902:c286:b0:1c4:bc8:4b64 with SMTP id i6-20020a170902c28600b001c40bc84b64mr3279364pld.5.1696445901728; Wed, 04 Oct 2023 11:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445901; cv=none; d=google.com; s=arc-20160816; b=p1L0Tz7VlL5ADQevrbOjYfdrCpB5eMu7OZAKLBTh8X4dBfH5I5tbJ61h+EPJwPoXRK I1EAnrrxLFHvm5wgOzuujoDDwk+Ml4pKsE0YXbecj8XKfRmLIgcDuxxPoCcm2gfx63S4 6GSQzsV2ZEem3i7Y/WYdVM26oEoQb93zo4Sqr5kRk6Ufd8k0wTFN8HViLtcbC4M+qe1x k83WHIyBDwURxP17e2wWGNbGRZFIs72XSDBsKzOq+FN4jG/bZbalG/mleSPB+VlceGNS aINLtgxOxNzpEoK0sJ2B5NaecWfbcnwmkKHSo/3dEZOPVwRZ4+SSQTUZ60p7+2OHpRzF B4vw== 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=THlWJb4wuLO63XYjDYrO5yboqLMfgKu1la6f9Oh11i0=; fh=aD1RA/mx6kHR1Kdf3Qx+6NOt32D/zEAMDihfEgEurGQ=; b=z7TckXFgKoHAeYkMJUQyUm/tg8Me25NvgTRcPAq3pfiUhWTU6ORgQdB0dQiMn5oqoq 3IZ/eBFlNICUZoEtPGK/yrZdbFJbYBS9f3mbDSIPK5sdKDC+O09Cw2Rkx6EHtPgMwT0f X0sqogK8Dn0A2pIQ+sUsxbFv6QXJlzvcrl2ds2UUazsv1J3f5Lk6z/qnrM8EOZ2mW7p2 CdVzpXXFn+Z9F5ROv3MMsNpqHo5gBxUnEGcdr5cX5zni/J917pIKgfrN+B3c3+UKy8R9 aZYkBgOkOssdca2waqHCs6sbHeQC6Dk5Tazl4ccIaNDbw1m/NsSJvhZGsshMmGn/0g7e JqMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="k/bnXjIA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id km3-20020a17090327c300b001c413905d87si4093481plb.49.2023.10.04.11.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="k/bnXjIA"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0AD26802EAC0; Wed, 4 Oct 2023 11:57:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245199AbjJDS5d (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244830AbjJDSyw (ORCPT ); Wed, 4 Oct 2023 14:54:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6194B10D7; Wed, 4 Oct 2023 11:54:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78D4AC433C8; Wed, 4 Oct 2023 18:54:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445667; bh=kFTNQpEU+Pu8tNfESD938BnBRfFvEHWpO/AqQh7tvYo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k/bnXjIAGc5J+vGl6YIHLBdDLBGZ+K8FEuAOXJbv0299dxULTaQhJCI/D5bPKsO8R 4VN/f4ifF6L1l2xN5WjvvbcdMnyFvqvP+eTzMe5s0uZRAuTC7VR8pkMAqbYQRhd+AJ 2vUtTn+nvaulkjfqczhSbg7iME2sl99itUilBr3zltNdJjEIuWYu3bld6NZvOdy+p9 OCZwmvKHxPE7lulRghIYCdVgMBufMd1NqIqtoTslyN67wd0KkEUafWqLkTBg21Of4g xNZ7zYcljP/kN3imcElBURln+fXpGaVr4D9oIvjuUh6GQhw0uKfPywsAvxeThQr6Ud AVty2UjF6nIpQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-ext4@vger.kernel.org Subject: [PATCH v2 35/89] ext4: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:20 -0400 Message-ID: <20231004185347.80880-33-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852457707743628 X-GMAIL-MSGID: 1778852457707743628 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ext4/ext4.h | 20 +++++++++++++++----- fs/ext4/extents.c | 11 ++++++----- fs/ext4/ialloc.c | 4 ++-- fs/ext4/inline.c | 4 ++-- fs/ext4/inode.c | 19 ++++++++++--------- fs/ext4/ioctl.c | 13 +++++++++++-- fs/ext4/namei.c | 10 +++++----- fs/ext4/super.c | 2 +- fs/ext4/xattr.c | 8 ++++---- 9 files changed, 56 insertions(+), 35 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 380c5a267d27..180b8c5fe021 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -891,10 +891,13 @@ do { \ (raw_inode)->xtime = cpu_to_le32(clamp_t(int32_t, (ts).tv_sec, S32_MIN, S32_MAX)); \ } while (0) -#define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \ - EXT4_INODE_SET_XTIME_VAL(xtime, inode, raw_inode, (inode)->xtime) +#define EXT4_INODE_SET_ATIME(inode, raw_inode) \ + EXT4_INODE_SET_XTIME_VAL(i_atime, inode, raw_inode, inode_get_atime(inode)) -#define EXT4_INODE_SET_CTIME(inode, raw_inode) \ +#define EXT4_INODE_SET_MTIME(inode, raw_inode) \ + EXT4_INODE_SET_XTIME_VAL(i_mtime, inode, raw_inode, inode_get_mtime(inode)) + +#define EXT4_INODE_SET_CTIME(inode, raw_inode) \ EXT4_INODE_SET_XTIME_VAL(i_ctime, inode, raw_inode, inode_get_ctime(inode)) #define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \ @@ -910,9 +913,16 @@ do { \ .tv_sec = (signed)le32_to_cpu((raw_inode)->xtime) \ }) -#define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \ +#define EXT4_INODE_GET_ATIME(inode, raw_inode) \ +do { \ + inode_set_atime_to_ts(inode, \ + EXT4_INODE_GET_XTIME_VAL(i_atime, inode, raw_inode)); \ +} while (0) + +#define EXT4_INODE_GET_MTIME(inode, raw_inode) \ do { \ - (inode)->xtime = EXT4_INODE_GET_XTIME_VAL(xtime, inode, raw_inode); \ + inode_set_mtime_to_ts(inode, \ + EXT4_INODE_GET_XTIME_VAL(i_mtime, inode, raw_inode)); \ } while (0) #define EXT4_INODE_GET_CTIME(inode, raw_inode) \ diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 202c76996b62..4c4176ee1749 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4481,7 +4481,8 @@ static int ext4_alloc_file_blocks(struct file *file, ext4_lblk_t offset, if (epos > new_size) epos = new_size; if (ext4_update_inode_size(inode, epos) & 0x1) - inode->i_mtime = inode_get_ctime(inode); + inode_set_mtime_to_ts(inode, + inode_get_ctime(inode)); } ret2 = ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); @@ -4617,7 +4618,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); ret = ext4_alloc_file_blocks(file, lblk, max_blocks, new_size, flags); @@ -4642,7 +4643,7 @@ static long ext4_zero_range(struct file *file, loff_t offset, goto out_mutex; } - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (new_size) ext4_update_inode_size(inode, new_size); ret = ext4_mark_inode_dirty(handle, inode); @@ -5378,7 +5379,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); ret = ext4_mark_inode_dirty(handle, inode); ext4_update_inode_fsync_trans(handle, inode, 1); @@ -5488,7 +5489,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 b65058d972f9..e9bbb1da2d0a 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -1250,8 +1250,8 @@ 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_set_ctime_current(inode); - ei->i_crtime = inode->i_mtime; + simple_inode_init_ts(inode); + ei->i_crtime = inode_get_mtime(inode); memset(ei->i_data, 0, sizeof(ei->i_data)); ei->i_dir_start_lookup = 0; diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 012d9259ff53..9a84a5f9fef4 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 4ce35f1c8b0a..08cb5c0e0d51 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4020,7 +4020,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); ret2 = ext4_mark_inode_dirty(handle, inode); if (unlikely(ret2)) ret = ret2; @@ -4180,7 +4180,7 @@ int ext4_truncate(struct inode *inode) if (inode->i_nlink) ext4_orphan_del(handle, inode); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); err2 = ext4_mark_inode_dirty(handle, inode); if (unlikely(err2 && !err)) err = err2; @@ -4284,8 +4284,8 @@ 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_CTIME(inode, raw_inode); - EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); - EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode); + EXT4_INODE_SET_MTIME(inode, raw_inode); + EXT4_INODE_SET_ATIME(inode, raw_inode); EXT4_EINODE_SET_XTIME(i_crtime, ei, raw_inode); raw_inode->i_dtime = cpu_to_le32(ei->i_dtime); @@ -4893,8 +4893,8 @@ struct inode *__ext4_iget(struct super_block *sb, unsigned long ino, } 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_INODE_GET_ATIME(inode, raw_inode); + EXT4_INODE_GET_MTIME(inode, raw_inode); EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode); if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) { @@ -5019,8 +5019,8 @@ static void __ext4_update_other_inode_time(struct super_block *sb, spin_lock(&ei->i_raw_lock); 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_SET_MTIME(inode, raw_inode); + EXT4_INODE_SET_ATIME(inode, raw_inode); ext4_inode_csum_set(inode, raw_inode, ei); spin_unlock(&ei->i_raw_lock); trace_ext4_other_inode_update_time(inode, orig_ino); @@ -5413,7 +5413,8 @@ int ext4_setattr(struct mnt_idmap *idmap, struct dentry *dentry, * update c/mtime in shrink case below */ if (!shrink) - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); if (shrink) ext4_fc_track_range(handle, inode, diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 0bfe2ce589e2..4f931f80cb34 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c @@ -312,13 +312,22 @@ static void swap_inode_data(struct inode *inode1, struct inode *inode2) struct ext4_inode_info *ei1; struct ext4_inode_info *ei2; unsigned long tmp; + struct timespec64 ts1, ts2; ei1 = EXT4_I(inode1); ei2 = EXT4_I(inode2); swap(inode1->i_version, inode2->i_version); - swap(inode1->i_atime, inode2->i_atime); - swap(inode1->i_mtime, inode2->i_mtime); + + ts1 = inode_get_atime(inode1); + ts2 = inode_get_atime(inode2); + inode_set_atime_to_ts(inode1, ts2); + inode_set_atime_to_ts(inode2, ts1); + + ts1 = inode_get_mtime(inode1); + ts2 = inode_get_mtime(inode2); + inode_set_mtime_to_ts(inode1, ts2); + inode_set_mtime_to_ts(inode2, ts1); memswap(ei1->i_data, ei2->i_data, sizeof(ei1->i_data)); tmp = ei1->i_flags & EXT4_FL_SHOULD_SWAP; diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index bbda587f76b8..057d74467293 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2207,7 +2207,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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); ext4_update_dx_flag(dir); inode_inc_iversion(dir); err2 = ext4_mark_inode_dirty(handle, dir); @@ -3202,7 +3202,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) * recovery. */ inode->i_size = 0; ext4_orphan_add(handle, inode); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); inode_set_ctime_current(inode); retval = ext4_mark_inode_dirty(handle, inode); if (retval) @@ -3277,7 +3277,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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); ext4_update_dx_flag(dir); retval = ext4_mark_inode_dirty(handle, dir); if (retval) @@ -3648,7 +3648,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_mtime = inode_set_ctime_current(ent->dir); + inode_set_mtime_to_ts(ent->dir, inode_set_ctime_current(ent->dir)); retval = ext4_mark_inode_dirty(handle, ent->dir); BUFFER_TRACE(ent->bh, "call ext4_handle_dirty_metadata"); if (!ent->inlined) { @@ -3963,7 +3963,7 @@ static int ext4_rename(struct mnt_idmap *idmap, struct inode *old_dir, ext4_dec_count(new.inode); inode_set_ctime_current(new.inode); } - old.dir->i_mtime = inode_set_ctime_current(old.dir); + inode_set_mtime_to_ts(old.dir, inode_set_ctime_current(old.dir)); ext4_update_dx_flag(old.dir); if (old.dir_bh) { retval = ext4_rename_dir_finish(handle, &old, new.dir->i_ino); diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f37fb009bd99..3165426784a9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -7136,7 +7136,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 92ba28cebac6..b9467ff8d4e9 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -356,7 +356,7 @@ 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) inode_get_ctime(ea_inode).tv_sec << 32) | + return ((u64) inode_get_ctime_sec(ea_inode) << 32) | (u32) inode_peek_iversion_raw(ea_inode); } @@ -368,12 +368,12 @@ static void ext4_xattr_inode_set_ref(struct inode *ea_inode, u64 ref_count) static u32 ext4_xattr_inode_get_hash(struct inode *ea_inode) { - return (u32)ea_inode->i_atime.tv_sec; + return (u32) inode_get_atime_sec(ea_inode); } static void ext4_xattr_inode_set_hash(struct inode *ea_inode, u32 hash) { - ea_inode->i_atime.tv_sec = hash; + inode_set_atime(ea_inode, hash, 0); } /* @@ -418,7 +418,7 @@ static int ext4_xattr_inode_read(struct inode *ea_inode, void *buf, size_t size) return ret; } -#define EXT4_XATTR_INODE_GET_PARENT(inode) ((__u32)(inode)->i_mtime.tv_sec) +#define EXT4_XATTR_INODE_GET_PARENT(inode) ((__u32)(inode_get_mtime_sec(inode))) static int ext4_xattr_inode_iget(struct inode *parent, unsigned long ea_ino, u32 ea_inode_hash, struct inode **ea_inode) From patchwork Wed Oct 4 18:52: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: 148533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp343016vqb; Wed, 4 Oct 2023 12:01:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiBp3K2Z1+culi1bp8GN79Zsc4x4B8Lv2sX9j1S2yLS4gjP5X4ccS7BvpmmzuDqPMmKJeL X-Received: by 2002:a17:903:32cb:b0:1c3:2ee6:3811 with SMTP id i11-20020a17090332cb00b001c32ee63811mr3887082plr.8.1696446102817; Wed, 04 Oct 2023 12:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446102; cv=none; d=google.com; s=arc-20160816; b=lNAdYNHpEgHOXVLhKarViVw4gGb/PdkI9E1X13TD0XBSl8BRkLB7ve2JEGb/VoioKs jjTgSNgF2IGZI3omIDoGmhXFADy9tYVbHiCGAb2tjhtXkF6EjQoh8lHbBVBFdd3f8Xyi fgSDwWgljFCJDZPAa6PtK08yQfYw26zawb9HVhfOc4fQb0JAddonNWdOLMk5wgyaROKG QRpMVTzToU+QRR2HaUxBUVeQD+Jc/k+qbFcdbuGFyaqAmVjZ91x2viiCnhh/FV6p7mgH 6Pxm1rOCSeSRbe1nM0ZfgiKnnkaTO+13v9uM/GO+sh3deZelGQKMPx9wm6U68qI+pDxb IG7Q== 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=Y7KhhUN0d+/Gj27X+DKDid8KEN4cs5YtU5hsTPAOmls=; fh=tvWafCFc5Ppo5rQybla6n6b/r5mFKKQAGAEZsnRXV94=; b=yQ4u7POHObLbvtGCegepJLYgCkEj0wZ5NJCuE0b/LL95nJMuoKaGvxIa9VwONq7mEd p6n4if8uN+tZpwLFZSL63dJAebM7JVJ5kT6RgINVy/mDMRddwcbzbjgC3ysQ2Q57xwOE 5eU/ZSdy6gZZUOxMtm2jncOfzveY/Jtl69g43ceIDThcN/PG7tgERGWdrN/ha6mFgVUb I8cNZCm6B5glp5ypGifvOsmzjW5JiQgUNDP39C3aMYP/3zCxi2Pg+wmYI2X5sZgk4BMl WhsHKDDTA4mo0xGJj18gGmNIS1gx4cRfPziVBgEfnQztBppXFnYMLs+q2u9w22DXdcqv uUQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ICpZaDp8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id kl11-20020a170903074b00b001c747f47c9dsi3923375plb.526.2023.10.04.12.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ICpZaDp8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B9A138098433; Wed, 4 Oct 2023 12:00:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245180AbjJDS5X (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244844AbjJDSyy (ORCPT ); Wed, 4 Oct 2023 14:54:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2260410E6; Wed, 4 Oct 2023 11:54:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E217C433C9; Wed, 4 Oct 2023 18:54:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445668; bh=tCBISPWGGNokIp2mrKL+31cK3tG8P238OYYBHV60Bhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ICpZaDp8WPBHBzLqiwbH/Lg9p8LqbmsgAz7ulyJIv6dJOBISnqcve+wUh6Zcf2btx St/t/TMAZZ1NzxOSbq/KBJEHzjj+IrrJgbK5EoJpSCBYz20pcqPFS/mpAhSXCekEn9 cLmP/yWN514DmpRWQfmTtMv5JXd+KUMhb/0cyRUh6THVMjWhFO7Efk//qpPDMCd2hO VX9VWcObdPAQGh0AdWoogJCMRtZxsHlluAJC2quCjHtZZ63/wE2YrmKkO4taQM3hG3 ce6ddArmxDDgs2kzjMUNNAIUH6foN75SSkT14ADF2XtwEsR/2r8+YO8dm3SmjAZVX5 AAQ4C+I0Qm5Tw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v2 36/89] f2fs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:21 -0400 Message-ID: <20231004185347.80880-34-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:43 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852668927466763 X-GMAIL-MSGID: 1778852668927466763 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/f2fs/dir.c | 6 +++--- fs/f2fs/f2fs.h | 10 ++++++---- fs/f2fs/file.c | 14 +++++++------- fs/f2fs/inline.c | 2 +- fs/f2fs/inode.c | 24 ++++++++++++------------ fs/f2fs/namei.c | 4 ++-- fs/f2fs/recovery.c | 8 ++++---- fs/f2fs/super.c | 2 +- 8 files changed, 36 insertions(+), 34 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 8aa29fe2e87b..042593aed1ec 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); f2fs_mark_inode_dirty_sync(dir, false); if (F2FS_I(dir)->i_current_depth != current_depth) @@ -919,7 +919,7 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, } f2fs_put_page(page, 1); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); f2fs_mark_inode_dirty_sync(dir, false); if (inode) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 3878288122ee..9043cedfa12b 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3318,13 +3318,15 @@ static inline void clear_file(struct inode *inode, int type) static inline bool f2fs_is_time_consistent(struct inode *inode) { - struct timespec64 ctime = inode_get_ctime(inode); + struct timespec64 ts = inode_get_atime(inode); - if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime)) + if (!timespec64_equal(F2FS_I(inode)->i_disk_time, &ts)) return false; - if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &ctime)) + ts = inode_get_ctime(inode); + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 1, &ts)) return false; - if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) + ts = inode_get_mtime(inode); + if (!timespec64_equal(F2FS_I(inode)->i_disk_time + 2, &ts)) return false; return true; } diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 161826c6e200..5769c9879e79 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -798,7 +798,7 @@ int f2fs_truncate(struct inode *inode) if (err) return err; - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); f2fs_mark_inode_dirty_sync(inode, false); return 0; } @@ -905,9 +905,9 @@ static void __setattr_copy(struct mnt_idmap *idmap, 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) { @@ -1012,7 +1012,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); F2FS_I(inode)->last_disk_size = i_size_read(inode); spin_unlock(&F2FS_I(inode)->i_size_lock); } @@ -1840,7 +1840,7 @@ static long f2fs_fallocate(struct file *file, int mode, } if (!ret) { - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); f2fs_mark_inode_dirty_sync(inode, false); f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); } @@ -2888,10 +2888,10 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in, if (ret) goto out_unlock; - src->i_mtime = inode_set_ctime_current(src); + inode_set_mtime_to_ts(src, inode_set_ctime_current(src)); f2fs_mark_inode_dirty_sync(src, false); if (src != dst) { - dst->i_mtime = inode_set_ctime_current(dst); + inode_set_mtime_to_ts(dst, inode_set_ctime_current(dst)); f2fs_mark_inode_dirty_sync(dst, false); } f2fs_update_time(sbi, REQ_TIME); diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index 2fe25619ccb5..ac00423f117b 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -699,7 +699,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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); f2fs_mark_inode_dirty_sync(dir, false); if (inode) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index cde243840abd..5779c7edd49b 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -386,9 +386,9 @@ 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[0] = inode_get_atime(inode); fi->i_disk_time[1] = inode_get_ctime(inode); - fi->i_disk_time[2] = inode->i_mtime; + fi->i_disk_time[2] = inode_get_mtime(inode); } static int do_read_inode(struct inode *inode) @@ -417,12 +417,12 @@ static int do_read_inode(struct inode *inode) inode->i_size = le64_to_cpu(ri->i_size); 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_set_atime(inode, le64_to_cpu(ri->i_atime), + le32_to_cpu(ri->i_atime_nsec)); inode_set_ctime(inode, le64_to_cpu(ri->i_ctime), le32_to_cpu(ri->i_ctime_nsec)); - 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_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec); + inode_set_mtime(inode, le64_to_cpu(ri->i_mtime), + le32_to_cpu(ri->i_mtime_nsec)); inode->i_generation = le32_to_cpu(ri->i_generation); if (S_ISDIR(inode->i_mode)) fi->i_current_depth = le32_to_cpu(ri->i_current_depth); @@ -698,12 +698,12 @@ 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_get_ctime(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_get_ctime(inode).tv_nsec); - ri->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); + ri->i_atime = cpu_to_le64(inode_get_atime_sec(inode)); + ri->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + ri->i_mtime = cpu_to_le64(inode_get_mtime_sec(inode)); + ri->i_atime_nsec = cpu_to_le32(inode_get_atime_nsec(inode)); + ri->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); + ri->i_mtime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); if (S_ISDIR(inode->i_mode)) ri->i_current_depth = cpu_to_le32(F2FS_I(inode)->i_current_depth); diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 193b22a2d6bf..d0053b0284d8 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -243,8 +243,8 @@ 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_set_ctime_current(inode); - F2FS_I(inode)->i_crtime = inode->i_mtime; + simple_inode_init_ts(inode); + F2FS_I(inode)->i_crtime = inode_get_mtime(inode); inode->i_generation = get_random_u32(); if (S_ISDIR(inode->i_mode)) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 7be60df277a5..b56d0f1078a7 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -320,12 +320,12 @@ 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_set_atime(inode, le64_to_cpu(raw->i_atime), + le32_to_cpu(raw->i_atime_nsec)); inode_set_ctime(inode, le64_to_cpu(raw->i_ctime), le32_to_cpu(raw->i_ctime_nsec)); - 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_mtime.tv_nsec = le32_to_cpu(raw->i_mtime_nsec); + inode_set_mtime(inode, le64_to_cpu(raw->i_mtime), + le32_to_cpu(raw->i_mtime_nsec)); F2FS_I(inode)->i_advise = raw->i_advise; F2FS_I(inode)->i_flags = le32_to_cpu(raw->i_flags); diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index a61be3204c54..0118405467ce 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2758,7 +2758,7 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type, if (len == towrite) return err; - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); f2fs_mark_inode_dirty_sync(inode, false); return len - towrite; } From patchwork Wed Oct 4 18:52: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: 148501 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340582vqb; Wed, 4 Oct 2023 11:57:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrW5PFeULV85orFJz4SwgQyCT8HQO4/+CevjLhcNgovsQ3PZAomr2uOjF4hXIEvkCTysyj X-Received: by 2002:a05:6a00:2348:b0:693:3870:edea with SMTP id j8-20020a056a00234800b006933870edeamr3382804pfj.28.1696445854157; Wed, 04 Oct 2023 11:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445854; cv=none; d=google.com; s=arc-20160816; b=JAaq/PpwWYnjWlEDG3ffsK28o5ywLh3kFinmTGoKKX+ZbKQgla9bqhzzd78NOLISL3 r+bjH06jU9Hm6G85C6WTjMJjqLulqjV7Wh4AsOuZm0bR/8tdD9l7IQ6quSlc5IwTy68R Dp0CJxrIWHyFLOuF7r6IrKqwGtjdx8MVIiTrxguogDzTauzu5ruXr2XLNk5ibA36y4b/ jPkB5TyFdGM3SO9fRyD+e7/yd4h+b4ZKKSCXq8pT67hwUZwjJd4ZaSRKpBotPW2zCboI tgrp9Mltkcg+6J+9Bfme/9sLm2EPgDY92zRhXRc3ztaJl9shZ8x3+5qgNSaoDYtkPSCe rBeA== 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:to:from :dkim-signature; bh=DhOOT0leIxEM7rLq5n3xQoXmH61sBsqkkv4jRr2k9q4=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=hM9BFKQhp3imdfXQ6d+YPE9WzA4E6X96Bx5tRcEPhzTDadgsC87jRpbY0GS9n7meL/ MAvQbXmua2mOm5EopDwA/oEqjJBqYyUf+Gpia91ZmxTs4GUHDFroc2LDdo9rV1OM/6m7 bJ4Gtb0XeS2yRp06RKm3nPF8fL2c90hF/asM3KfpsRM3yJ4ZTTjZhbBjE5H7Wr+7EWgv b38w6ApJt6tN6ag8d6piG6i1YIxMw4JtmbklTLuVcF5imB9QC/Mg/S91NHzLcSXwFcWs GZOzfU4LF0y/ZEJVxA3zbVsq3nJoBMl6fIgtpBk3f/u4+62G9NtSgAsmB43/6N5IjMuf N++g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sQNNxDf3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b192-20020a6334c9000000b00573f6ee58fasi4173091pga.376.2023.10.04.11.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sQNNxDf3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 329AC827004E; Wed, 4 Oct 2023 11:57:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244709AbjJDS51 (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244845AbjJDSyy (ORCPT ); Wed, 4 Oct 2023 14:54:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3996F10EC; Wed, 4 Oct 2023 11:54:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 550FFC433CA; Wed, 4 Oct 2023 18:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445669; bh=F1w46M8uNPh8dz51qRijLO0+0UFVX+P0B4bmFxVHd34=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sQNNxDf3hAYMEpihh9arqCjkOyLgNsRjzSacYhqh9DV5Ll2zT5dPNrBqiatsTTgLN 6C2q+UexIKOqn+Oe3toL6RNtw69QewLLzivk2wk64y8k5EI0NwZ63PoE6TNmLYQ9UP WTeKEyKKYiyrv+UgPj8n1PE7fjfrNuRo6lNGcTcbtzPnG/0CD1Igs0dQwCzUOhpo73 NCRX5ycxcPVWFhU77cwpcBMyTGKaIj+WVxAAvJUZeArWVBTlZh9rNEAH+dK0wAI2MF e066QfpvLl3VVfa4mZdScCxhtRz5LjZBk0QLkPUPJC5KyvY9shgBP4Mu6m/d1YNS/E h4BvqcBVuYegQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 37/89] fat: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:22 -0400 Message-ID: <20231004185347.80880-35-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852407965264220 X-GMAIL-MSGID: 1778852407965264220 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/fat/inode.c | 25 +++++++++++++++++-------- fs/fat/misc.c | 6 +++--- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index cdd39b6020f3..aa87f323fd44 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -512,6 +512,7 @@ static int fat_validate_dir(struct inode *dir) int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) { struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); + struct timespec64 mtime; int error; MSDOS_I(inode)->i_pos = 0; @@ -561,14 +562,18 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) & ~((loff_t)sbi->cluster_size - 1)) >> 9; - fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); - inode_set_ctime_to_ts(inode, inode->i_mtime); + fat_time_fat2unix(sbi, &mtime, de->time, de->date, 0); + inode_set_mtime_to_ts(inode, mtime); + inode_set_ctime_to_ts(inode, mtime); if (sbi->options.isvfat) { - fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); + struct timespec64 atime; + + fat_time_fat2unix(sbi, &atime, 0, de->adate, 0); + inode_set_atime_to_ts(inode, atime); fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime, de->cdate, de->ctime_cs); } else - inode->i_atime = fat_truncate_atime(sbi, &inode->i_mtime); + inode_set_atime_to_ts(inode, fat_truncate_atime(sbi, &mtime)); return 0; } @@ -849,6 +854,7 @@ static int __fat_write_inode(struct inode *inode, int wait) struct msdos_sb_info *sbi = MSDOS_SB(sb); struct buffer_head *bh; struct msdos_dir_entry *raw_entry; + struct timespec64 mtime; loff_t i_pos; sector_t blocknr; int err, offset; @@ -882,12 +888,14 @@ static int __fat_write_inode(struct inode *inode, int wait) raw_entry->size = cpu_to_le32(inode->i_size); raw_entry->attr = fat_make_attrs(inode); fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); - fat_time_unix2fat(sbi, &inode->i_mtime, &raw_entry->time, + fat_time_unix2fat(sbi, &mtime, &raw_entry->time, &raw_entry->date, NULL); + inode_set_mtime_to_ts(inode, mtime); if (sbi->options.isvfat) { + struct timespec64 ts = inode_get_atime(inode); __le16 atime; - fat_time_unix2fat(sbi, &inode->i_atime, &atime, - &raw_entry->adate, NULL); + + fat_time_unix2fat(sbi, &ts, &atime, &raw_entry->adate, NULL); fat_time_unix2fat(sbi, &MSDOS_I(inode)->i_crtime, &raw_entry->ctime, &raw_entry->cdate, &raw_entry->ctime_cs); } @@ -1407,7 +1415,8 @@ 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 = inode->i_atime = inode_set_ctime(inode, 0, 0); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime(inode, 0, 0))); set_nlink(inode, fat_subdirs(inode)+2); return 0; diff --git a/fs/fat/misc.c b/fs/fat/misc.c index f2304a1054aa..c7a2d27120ba 100644 --- a/fs/fat/misc.c +++ b/fs/fat/misc.c @@ -325,15 +325,15 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags) } if (flags & S_ATIME) - inode->i_atime = fat_truncate_atime(sbi, now); + inode_set_atime_to_ts(inode, fat_truncate_atime(sbi, now)); /* * ctime and mtime share the same on-disk field, and should be * identical in memory. all mtime updates will be applied to ctime, * but ctime updates are ignored. */ if (flags & S_MTIME) - inode->i_mtime = inode_set_ctime_to_ts(inode, - fat_truncate_mtime(sbi, now)); + inode_set_mtime_to_ts(inode, + inode_set_ctime_to_ts(inode, fat_truncate_mtime(sbi, now))); return 0; } From patchwork Wed Oct 4 18:52: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: 148509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340909vqb; Wed, 4 Oct 2023 11:58:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWCpXYuHSmxp/5wsEvEhznfHPFNGOBTwFl+xM0HTvYLQs4oxPYaVL9sy5bf4iVcij78Rg1 X-Received: by 2002:a17:902:ed54:b0:1c2:eac:b99 with SMTP id y20-20020a170902ed5400b001c20eac0b99mr3287079plb.40.1696445899358; Wed, 04 Oct 2023 11:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445899; cv=none; d=google.com; s=arc-20160816; b=FMpa2Hq9K7+v5ZbXkZXnlbXcJiBIZ7bMnXH5PArivu5oUsUaZRAAT+/tMKqgSbBPrz oB6nt498YxQPUEizEF1T6WQ/q/zzWms3bj4/Bf7vG6ujR+OwhBDLK7l7HRPfV8xSm6ts 2O0phr0cxtnvh5Ek03+FUe8l5IwRjw0byxrnK59LrkQGQz1dOuHT51zAfZ8n41akBuRd nMDygg8AFN1DLc0YWDJ14U6wgNXfHEVPfsY2pjgL4AfKD1jzSgrAoWS6HL+aI7+8hniM 0DewvWUBoan27F3Mvqjft6qpBAGY9bLeLa74UYVWufbuRhjPis01ZL5xDw8fY/Ymro1R 0Yug== 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:to:from :dkim-signature; bh=StDM9x2HVB6x/TIF5vrw+NVpqrVjXA+hyBFBn5stQVM=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=PWxHziURXIQf6px5aCZgHokt9UebnqllVPzxC4w1AfvE4guOIyAbwnp/GJCl7NBpkv blFHcmeEUctIzs59oP2r5sMMCfNQrRT0yqqehzy1Ftjr7CUnaLhWmcWRqz08lQiLF90w WWOtuHo3EMZMUGMfmRA/V5OIJefY0z5RNko1kcLLO4JOJuYrG6b876WbYZuq3SBhIheH YM0rFZVCOZyppImQ6CNSRPyvtgURLxocC1cuhO/x1RO2+J8/D0Z3asedQTIFnRw8CjnW aNkLVsFLV9wuJwsR3GB9d19kzni8t84x2DVmLaiOQRjuwJJDYIaqycj1a/gbwagds6B7 Gd1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o05mbaN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w8-20020a170902e88800b001c746b986e2si4435218plg.346.2023.10.04.11.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o05mbaN0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E56ED83F4266; Wed, 4 Oct 2023 11:57:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245153AbjJDS5V (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244854AbjJDSyz (ORCPT ); Wed, 4 Oct 2023 14:54:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2770B10F2; Wed, 4 Oct 2023 11:54:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D425C433C8; Wed, 4 Oct 2023 18:54:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445670; bh=laqdLQX++bYwL/9FLlbUOBix7eTg/7aYzaxDd38931k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=o05mbaN0ZygPTpYgW1P7ybdN5amDbA8QO3l3HrUscPXYdmWLBn0vBmB7C+rxkJPfY l73lr5JqnGt3J+lErTPnyABVq8htzrJpZDnPLKka6x2+RMt3zUvOH4Qw5VLOw2mYbS P8fV+eyPGoih4Ny6rC14zoUL/BnS5VVu1KqOV6PCWKNry8qYM2wacI4Eq+n1Xp6Ex1 8TTANAUcQLXlQqzF4Hei1CbQUXJU1t64S4cQN3U24O/bCzlJga/KCdKd9woJW3KCBK M/9yAtx+dQAOYPplLYZV6zdVB2cuC/UuTlg0D4zWORyr4hhIZiz9mntiHIwEoAMwLQ g4/KQramMs3Lw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 38/89] freevxfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:23 -0400 Message-ID: <20231004185347.80880-36-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852455325840059 X-GMAIL-MSGID: 1778852455325840059 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/freevxfs/vxfs_inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/freevxfs/vxfs_inode.c b/fs/freevxfs/vxfs_inode.c index ac5d43b164b5..20600e9ea202 100644 --- a/fs/freevxfs/vxfs_inode.c +++ b/fs/freevxfs/vxfs_inode.c @@ -109,11 +109,9 @@ static inline void dip2vip_cpy(struct vxfs_sb_info *sbi, set_nlink(inode, vip->vii_nlink); inode->i_size = vip->vii_size; - inode->i_atime.tv_sec = vip->vii_atime; + inode_set_atime(inode, vip->vii_atime, 0); inode_set_ctime(inode, vip->vii_ctime, 0); - inode->i_mtime.tv_sec = vip->vii_mtime; - inode->i_atime.tv_nsec = 0; - inode->i_mtime.tv_nsec = 0; + inode_set_mtime(inode, vip->vii_mtime, 0); inode->i_blocks = vip->vii_blocks; inode->i_generation = vip->vii_gen; From patchwork Wed Oct 4 18:52: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: 148529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342680vqb; Wed, 4 Oct 2023 12:01:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXoi59jp+w2oT2XOQM3m0ALmMFOpgqmLSL8c+ZW0/GR7MB2LYlbJdMID4Z+Zc+WIElfv6g X-Received: by 2002:a17:902:f541:b0:1c4:13cd:b85f with SMTP id h1-20020a170902f54100b001c413cdb85fmr3807530plf.5.1696446080996; Wed, 04 Oct 2023 12:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446080; cv=none; d=google.com; s=arc-20160816; b=MIH6oLdMBN2O0JfAxerMXXkOzbt2F1DPUR6DK6Xwyl5PKRamyCS3BbP48BsY8+owhK rnCMEry+Kp/mlFOVOgHTwNJOJ/k3tzw0O3AX8B7RsQLayzQ7k5exS0pkFyJcmjdy38Xr dEF4bFURui7URWb5TOULwK756nIZhDAiU4sKzv5FCXMP0wzECj8ObDj/yLJhKWmbSozY T6YDLiMsiinBuhoR/XqZ5wnEN0ufGnymKuIKU0n9fY4Yr/Mhq/tliAjteECYFULnOG9f IJyS06o1mPcj7i909ltvsnIdzho6l+M7X/7ogkqf+E8HPo8opGqbPnfmx0ZKMPsWLb7x 1dlw== 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:to:from :dkim-signature; bh=/hjp2Kj6ev8V0es9ONPvM/KPFB0G1BNkleINL1xfBt0=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=yJ3vz8WMzyKldenWrjfWFGf6IvImiCEQ7Z5UKWuhqRkHBl6T0cYIpGWH/n4bC+DySJ yY8Mtj/YRcN7ZDh4X+FEoUx5L28aL6cK6iIFcFbL0i1GiIrhWtsG45ZavLWOSFuMSbd5 3Ss9KCCs5/fCw0VyksGO8NQBUJBspj3RzGeZEy+kgUik/UhH5qSjZBhOlSdOzKD/9t5O A+CqqIZKrloU+tbPL5gYdr6ay3vq33f2zqgsRwq3O0KEhvpgsJ31c5w53mApjh77zkG+ AZGjp6Zd5sUYdu80Uy/dE/FHo+UgoQsqxfD1ArgAaxJMZIkL+vYWJPZW7fQH3v9NM7uS UR6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ababVVuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id i5-20020a170902c94500b001c73732c1f2si4641775pla.223.2023.10.04.12.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ababVVuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 44E768083485; Wed, 4 Oct 2023 12:00:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245155AbjJDS4o (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244859AbjJDSy5 (ORCPT ); Wed, 4 Oct 2023 14:54:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F98210F5; Wed, 4 Oct 2023 11:54:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C4ECC433CB; Wed, 4 Oct 2023 18:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445672; bh=mIt3xm5fBtB7C7o3BbmHBu2+jSh68YUaxybdY+RBNwY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ababVVuAbuOD6AO5ssN4gmtB7Avu/tbCZyAkXwH0mfhhFmPYlpcLe3zqnXompBmle CXcRsiew5TNt+LGI2SUhbj4SKXijN5mZtMtKPeE/gSD/ZqfTAOnKVuwp5xdTWhi6mQ OrooJsatvOv6KGjnrGI81YS6GUGRlyjbdymB36M+6uzy6ZJJHS4QKopBcho3ncUuZT a2FJPJ/YGRYeXqSfhafpAywEWASpk1J5on036lqXFsTpzlrq3hY8m3n2PvDZeL8CvU 0PtBdNZiEYW/ytu/R5mRlpxy30mzb5UrChGPKLryYjvHIIgXUTOjdRw6/VoQrE5E4Q ZB7WVcJuKe5Bg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 39/89] fuse: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:24 -0400 Message-ID: <20231004185347.80880-37-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:18 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852645680620429 X-GMAIL-MSGID: 1778852645680620429 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/fuse/control.c | 2 +- fs/fuse/dir.c | 10 +++++----- fs/fuse/inode.c | 29 ++++++++++++++--------------- fs/fuse/readdir.c | 6 ++++-- 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/fs/fuse/control.c b/fs/fuse/control.c index ab62e4624256..284a35006462 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_set_ctime_current(inode); + simple_inode_init_ts(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 d707e6987da9..d19cbf34c634 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1812,12 +1812,12 @@ int fuse_flush_times(struct inode *inode, struct fuse_file *ff) memset(&outarg, 0, sizeof(outarg)); inarg.valid = FATTR_MTIME; - inarg.mtime = inode->i_mtime.tv_sec; - inarg.mtimensec = inode->i_mtime.tv_nsec; + inarg.mtime = inode_get_mtime_sec(inode); + inarg.mtimensec = inode_get_mtime_nsec(inode); if (fm->fc->minor >= 23) { inarg.valid |= FATTR_CTIME; - inarg.ctime = inode_get_ctime(inode).tv_sec; - inarg.ctimensec = inode_get_ctime(inode).tv_nsec; + inarg.ctime = inode_get_ctime_sec(inode); + inarg.ctimensec = inode_get_ctime_nsec(inode); } if (ff) { inarg.valid |= FATTR_FH; @@ -1956,7 +1956,7 @@ int fuse_do_setattr(struct dentry *dentry, struct iattr *attr, /* the kernel maintains i_mtime locally */ if (trust_local_cmtime) { if (attr->ia_valid & ATTR_MTIME) - inode->i_mtime = attr->ia_mtime; + inode_set_mtime_to_ts(inode, attr->ia_mtime); if (attr->ia_valid & ATTR_CTIME) inode_set_ctime_to_ts(inode, attr->ia_ctime); /* FIXME: clear I_DIRTY_SYNC? */ diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 444418e240c8..f78fbf33f8a0 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -188,12 +188,10 @@ void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, attr->mtimensec = min_t(u32, attr->mtimensec, NSEC_PER_SEC - 1); attr->ctimensec = min_t(u32, attr->ctimensec, NSEC_PER_SEC - 1); - inode->i_atime.tv_sec = attr->atime; - inode->i_atime.tv_nsec = attr->atimensec; + inode_set_atime(inode, attr->atime, attr->atimensec); /* mtime from server may be stale due to local buffered write */ if (!(cache_mask & STATX_MTIME)) { - inode->i_mtime.tv_sec = attr->mtime; - inode->i_mtime.tv_nsec = attr->mtimensec; + inode_set_mtime(inode, attr->mtime, attr->mtimensec); } if (!(cache_mask & STATX_CTIME)) { inode_set_ctime(inode, attr->ctime, attr->ctimensec); @@ -276,12 +274,12 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, attr->size = i_size_read(inode); if (cache_mask & STATX_MTIME) { - attr->mtime = inode->i_mtime.tv_sec; - attr->mtimensec = inode->i_mtime.tv_nsec; + attr->mtime = inode_get_mtime_sec(inode); + attr->mtimensec = inode_get_mtime_nsec(inode); } if (cache_mask & STATX_CTIME) { - attr->ctime = inode_get_ctime(inode).tv_sec; - attr->ctimensec = inode_get_ctime(inode).tv_nsec; + attr->ctime = inode_get_ctime_sec(inode); + attr->ctimensec = inode_get_ctime_nsec(inode); } if ((attr_version != 0 && fi->attr_version > attr_version) || @@ -290,7 +288,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, return; } - old_mtime = inode->i_mtime; + old_mtime = inode_get_mtime(inode); fuse_change_attributes_common(inode, attr, sx, attr_valid, cache_mask); oldsize = inode->i_size; @@ -337,8 +335,7 @@ static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr, { inode->i_mode = attr->mode & S_IFMT; inode->i_size = attr->size; - inode->i_mtime.tv_sec = attr->mtime; - inode->i_mtime.tv_nsec = attr->mtimensec; + inode_set_mtime(inode, attr->mtime, attr->mtimensec); inode_set_ctime(inode, attr->ctime, attr->ctimensec); if (S_ISREG(inode->i_mode)) { fuse_init_common(inode); @@ -1423,17 +1420,19 @@ EXPORT_SYMBOL_GPL(fuse_dev_free); static void fuse_fill_attr_from_inode(struct fuse_attr *attr, const struct fuse_inode *fi) { + struct timespec64 atime = inode_get_atime(&fi->inode); + struct timespec64 mtime = inode_get_mtime(&fi->inode); struct timespec64 ctime = inode_get_ctime(&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, + .atime = atime.tv_sec, + .mtime = mtime.tv_sec, .ctime = ctime.tv_sec, - .atimensec = fi->inode.i_atime.tv_nsec, - .mtimensec = fi->inode.i_mtime.tv_nsec, + .atimensec = atime.tv_nsec, + .mtimensec = mtime.tv_nsec, .ctimensec = ctime.tv_nsec, .mode = fi->inode.i_mode, .nlink = fi->inode.i_nlink, diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c index 9e6d587b3e67..c66a54d6c7d3 100644 --- a/fs/fuse/readdir.c +++ b/fs/fuse/readdir.c @@ -476,7 +476,7 @@ static int fuse_readdir_cached(struct file *file, struct dir_context *ctx) if (!fi->rdc.cached) { /* Starting cache? Set cache mtime. */ if (!ctx->pos && !fi->rdc.size) { - fi->rdc.mtime = inode->i_mtime; + fi->rdc.mtime = inode_get_mtime(inode); fi->rdc.iversion = inode_query_iversion(inode); } spin_unlock(&fi->rdc.lock); @@ -488,8 +488,10 @@ static int fuse_readdir_cached(struct file *file, struct dir_context *ctx) * changed, and reset the cache if so. */ if (!ctx->pos) { + struct timespec64 mtime = inode_get_mtime(inode); + if (inode_peek_iversion(inode) != fi->rdc.iversion || - !timespec64_equal(&fi->rdc.mtime, &inode->i_mtime)) { + !timespec64_equal(&fi->rdc.mtime, &mtime)) { fuse_rdc_reset(inode); goto retry_locked; } From patchwork Wed Oct 4 18:52: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: 148488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340261vqb; Wed, 4 Oct 2023 11:56:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBSq5+MyqSG5yICe7YTUbRU0m8s9j6HfXXQlMkwtW2BrPj/dbS2m3ZHUt7SpoGBQl78dn4 X-Received: by 2002:a17:902:c449:b0:1c7:5dcf:1131 with SMTP id m9-20020a170902c44900b001c75dcf1131mr2687700plm.59.1696445817181; Wed, 04 Oct 2023 11:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445817; cv=none; d=google.com; s=arc-20160816; b=BjrCrzKROQ67A5Y3NqL9cVQJ+r5OUGXGzFsFqem6IKwxGd1YMdOge6VXlPJyTxuY94 RSgQHkp+KGlhr5uKJuFZVr4hp+LjzmZ9AzCDeVRxIq3GV5pKin2bPgkHBmAANCtMaS+f ST88iKPnTyf6dv36T2LHOPOzINuUINXEVqJvRDn70rKKNLLM8vUxIvT5c2F0OIpoLDY1 QrUIeY6M6EarjYuKCPX7woUMSAVIFBeCPFPzK2H+tUs+l/4Vl8vUasgUOYYy8tnIOjeG E01swokBV1kd3ZRBttQ4MSZtUUz6mmvHi0giCeG7d8Q2HICNPO6Wg2S21K/QG5zARzU5 rKIA== 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=l9aDe+YYx5QkHH5J+oHSwzAi4z+blFG4MVaPU21kNBw=; fh=FKPwUxQbxQ40NykdiXptwFfRjdCLRVbmEKOVvcUlADM=; b=Du3q1LO8w8P1i0Wf+9wudXCcTtXQ+aekiaPaVhHig4vD7pUcdhhZHttq1wXnzNYu3L Ubg89Q6N6oqkGJXDfddctY0j6acmVx8dUnQOZ9XBAbcNyWaseEukOw9IYzaRVXM/W+U8 /WbJLcPKNPQLpbFGuMR3iESuYjKvCrnV4i7fC075Tb/zIgHOlSwfOrSv5xZTRBbkFvr9 dgV7Xk8oPNdibNj5P7IxYMi5Q1lU+uhGZ4efLdbD4mHYlKsmz9SkmzX619R8TLZQLChz tE/xM+zXvy7kZmGdTAULg0BTCx09QDi9MJjRmy8TDipG5uhtMxPYc6ZzLKA/6keygKwI 5bXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aej94gwh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id o2-20020a170903210200b001c78345f376si3981389ple.241.2023.10.04.11.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aej94gwh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7223A823CE8D; Wed, 4 Oct 2023 11:56:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245142AbjJDS4m (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244866AbjJDSy5 (ORCPT ); Wed, 4 Oct 2023 14:54:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6A6710FC; Wed, 4 Oct 2023 11:54:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0390BC433C7; Wed, 4 Oct 2023 18:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445673; bh=szLxx1onUpXpeweGJ+3pwgwVyXyeCBKZsaCQ1HGXKzM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aej94gwhxY1gZUx5nVtIP5apaac8f5xtsUwK3p7LbWXU1RYLowz/QVQaTBeN9hjiW NLh8iBKwrymMtokqY0dPysJwu5+uVHSRztjKsX5Jcnl6p4V5JSb/SBn8QBUXpgqtL2 pFysoSsUsjBuVxsM1V5Ll9K3P4t2cPbk/iNOHZH2rA/fruuUhsQPyaps81iEdL0qxR uk4nlVDTn6A5Q4qM8p32VA9BZ8k51lCOWHzJFIIUbwdTV7KF9L9oyebcopyGJhrMZm tRbhD8jAzYq/K4+S7/vuOVENViZAA1BFENkrEFRvaX+WWK4Xe07ivuBfdPy4FufC+V 38wglxWhhiTcQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gfs2@lists.linux.dev Subject: [PATCH v2 40/89] gfs2: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:25 -0400 Message-ID: <20231004185347.80880-38-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852368846327871 X-GMAIL-MSGID: 1778852368846327871 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/gfs2/bmap.c | 10 +++++----- fs/gfs2/dir.c | 10 +++++----- fs/gfs2/glops.c | 11 ++++++----- fs/gfs2/inode.c | 7 ++++--- fs/gfs2/quota.c | 2 +- fs/gfs2/super.c | 12 ++++++------ 6 files changed, 27 insertions(+), 25 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 47d0f39feeb1..f1d92e4d1538 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1385,7 +1385,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 = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode)); gfs2_dinode_out(ip, dibh->b_data); if (journaled) @@ -1582,7 +1582,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 = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode)); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); brelse(dibh); @@ -1948,7 +1948,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 = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_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); @@ -1991,7 +1991,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 = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode)); ip->i_diskflags &= ~GFS2_DIF_TRUNC_IN_PROG; gfs2_trans_add_meta(ip->i_gl, dibh); @@ -2092,7 +2092,7 @@ static int do_grow(struct inode *inode, u64 size) goto do_end_trans; truncate_setsize(inode, size); - ip->i_inode.i_mtime = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_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 1a2afa88f8be..61ddd03ea111 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 = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_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 = inode_set_ctime_current(&ip->i_inode); + inode_set_mtime_to_ts(&ip->i_inode, inode_set_ctime_current(&ip->i_inode)); gfs2_trans_add_meta(ip->i_gl, dibh); gfs2_dinode_out(ip, dibh->b_data); @@ -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 = tv; + inode_set_mtime_to_ts(&ip->i_inode, tv); if (S_ISDIR(nip->i_inode.i_mode)) inc_nlink(&ip->i_inode); mark_inode_dirty(inode); @@ -1911,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 = tv; + inode_set_mtime_to_ts(&dip->i_inode, tv); if (d_is_dir(dentry)) drop_nlink(&dip->i_inode); mark_inode_dirty(&dip->i_inode); @@ -1952,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 = inode_set_ctime_current(&dip->i_inode); + inode_set_mtime_to_ts(&dip->i_inode, inode_set_ctime_current(&dip->i_inode)); mark_inode_dirty_sync(&dip->i_inode); return 0; } diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 5f845fd9f13a..b41c78bd2cc0 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -403,7 +403,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) { struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); const struct gfs2_dinode *str = buf; - struct timespec64 atime; + struct timespec64 atime, iatime; u16 height, depth; umode_t mode = be32_to_cpu(str->di_mode); struct inode *inode = &ip->i_inode; @@ -433,10 +433,11 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) gfs2_set_inode_blocks(inode, be64_to_cpu(str->di_blocks)); atime.tv_sec = be64_to_cpu(str->di_atime); atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); - if (timespec64_compare(&inode->i_atime, &atime) < 0) - 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); + iatime = inode_get_atime(inode); + if (timespec64_compare(&iatime, &atime) < 0) + inode_set_atime_to_ts(inode, atime); + inode_set_mtime(inode, be64_to_cpu(str->di_mtime), + be32_to_cpu(str->di_mtime_nsec)); inode_set_ctime(inode, be64_to_cpu(str->di_ctime), be32_to_cpu(str->di_ctime_nsec)); diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 697f95047033..1547ee2f7c21 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c @@ -185,8 +185,9 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, set_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags); /* Lowest possible timestamp; will be overwritten in gfs2_dinode_in. */ - inode->i_atime.tv_sec = 1LL << (8 * sizeof(inode->i_atime.tv_sec) - 1); - inode->i_atime.tv_nsec = 0; + inode_set_atime(inode, + 1LL << (8 * sizeof(inode_get_atime_sec(inode)) - 1), + 0); glock_set_object(ip->i_gl, ip); @@ -696,7 +697,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_set_ctime_current(inode); + simple_inode_init_ts(inode); munge_mode_uid_gid(dip, inode); check_and_update_goal(dip); ip->i_goal = dip->i_goal; diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index ef2da4bd66c2..6affd261a754 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -910,7 +910,7 @@ static int gfs2_adjust_quota(struct gfs2_sbd *sdp, loff_t loc, size = loc + sizeof(struct gfs2_quota); if (size > inode->i_size) i_size_write(inode, size); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); set_bit(QDF_REFRESH, &qd->qd_flags); } diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index dd2720a5ca62..a96e37dc0d73 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -410,9 +410,9 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str->di_nlink = cpu_to_be32(inode->i_nlink); str->di_size = cpu_to_be64(i_size_read(inode)); 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_get_ctime(inode).tv_sec); + str->di_atime = cpu_to_be64(inode_get_atime_sec(inode)); + str->di_mtime = cpu_to_be64(inode_get_mtime_sec(inode)); + str->di_ctime = cpu_to_be64(inode_get_ctime_sec(inode)); str->di_goal_meta = cpu_to_be64(ip->i_goal); str->di_goal_data = cpu_to_be64(ip->i_goal); @@ -427,9 +427,9 @@ void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf) str->di_entries = cpu_to_be32(ip->i_entries); 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_get_ctime(inode).tv_nsec); + str->di_atime_nsec = cpu_to_be32(inode_get_atime_nsec(inode)); + str->di_mtime_nsec = cpu_to_be32(inode_get_mtime_nsec(inode)); + str->di_ctime_nsec = cpu_to_be32(inode_get_ctime_nsec(inode)); } /** From patchwork Wed Oct 4 18:52: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: 148489 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340274vqb; Wed, 4 Oct 2023 11:56:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpq4mySihgkWREp3ps9SQ1AIe0qPuAptdYwfhhXwBONyen4B5oIErEszUIfZ5yU8TuKWKe X-Received: by 2002:a17:902:c94f:b0:1c3:8464:cabd with SMTP id i15-20020a170902c94f00b001c38464cabdmr3668431pla.12.1696445818472; Wed, 04 Oct 2023 11:56:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445818; cv=none; d=google.com; s=arc-20160816; b=NDyIHq1EH4EOa2sVQjXXQ69UPfXZI0STLi9jeB8i2yI+MlyO/j/s19eOXpRwBSP/Gd jfEO2TZKNv7V/X1aw4rOsYz5wLaiTjHhWZNd4M9jdnxhzHYjzafYuV/YHW+FcdJgAGkB 9tr3iD6QqEmnPcJQfBYK4xMQlORrkJ1D5RBJLkbxvZb2EoUh5Tbroucl6xzU0+D3p4V6 XQbnv6IlZzKKtKlFNm3Xsn0eKtxImjuaTVctNW4r9It14wjqDP9M4Xy3OOBUQO0yQyoY okDFwt/LrHrQj513bnIuzdft0tZ0HwY5vWUXby8HfT0jWrAjcqOClp/tqlnoPsPN/xsA 9zOw== 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:to:from :dkim-signature; bh=8BN6cLuV/LJRm8AXhGo196yY6IvB+oe7IeSJwrmICrk=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=kI8nTa/P4hcD0ulrqMwTonfClvEyXxvzHm84q1/bPj1e0IMMRQ4LOP7r3NKcQNmOdG Tg+glBB6s8O+/f3huXSBWVMsL02XAzMFolVMLMCYvJhqd9W0uOuqRBLzKaocSKVwaTIo hXPRRQuDUZe/KDDyO2C4an7PnKuJ7FRFx3ZrfTSTz2AhOmqPWmY05xr0avb8xdevGwMp vB5mQCahSuAwotNqjQxZ9yFonUcVeMODq1sgJMucYamU/ZOd9RVwxy64p5yqtuCRZlGO T0oeaeh0aUXQCW3hdne5I98s+8TD0E8dS8TmSPHVTysJstZWaH2dygjhEkCwBWR4C2xH DttQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T1pCbYN/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id q6-20020a170902dac600b001b9ffda161esi4362240plx.451.2023.10.04.11.56.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T1pCbYN/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B4521823CE8D; Wed, 4 Oct 2023 11:56:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244503AbjJDS4t (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244698AbjJDSzN (ORCPT ); Wed, 4 Oct 2023 14:55:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D780E10FF; Wed, 4 Oct 2023 11:54:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45323C433C8; Wed, 4 Oct 2023 18:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445674; bh=AwVSe+YCjFU8ncYXppmknLhdNscyXimQ4Be6LzuJIQc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=T1pCbYN/8vhOAJ9uNjYpEt7CwCaaKqNlJDze20Nbcvurdu1X9+AXRUpzTzTt6ag++ necfkzOWFWalq/Gv5ykNTe+fqJCQFgQqzF4IywlrZcF5N3dvP4MG+69/gSyG+ZZaTd WuLCu4egh3Qj9XOXGhNc2JD8UkAwoOn6tf2Fkmy6vJEgLcMWEsNCVrcTOiQE6zBOqU FcZoev6YoKCy0UWjayxHI+8b8nI4mJj9M5HtVwmMD1zp5/5Oy+8LYmwn9HRKbCBcuE fNLvZku+OOwCy/fq7VUJNBlWej4whPFsGIEu9Fgj+GR1fIos4JusghqOq/ysIhFCy0 jPvPLxQfmFMYA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 41/89] hfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:26 -0400 Message-ID: <20231004185347.80880-39-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852370461551201 X-GMAIL-MSGID: 1778852370461551201 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/hfs/catalog.c | 8 ++++---- fs/hfs/inode.c | 16 ++++++++-------- fs/hfs/sysdep.c | 10 ++++++---- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c index 632c226a3972..d63880e7d9d6 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dst_dir); + inode_set_mtime_to_ts(dst_dir, inode_set_ctime_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 = inode_set_ctime_current(src_dir); + inode_set_mtime_to_ts(src_dir, inode_set_ctime_current(src_dir)); mark_inode_dirty(src_dir); type = entry.type; diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index ee349b72cfb3..a7bc4690a780 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_set_ctime_current(inode); + simple_inode_init_ts(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_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, - hfs_m_to_utime(rec->file.MdDat)); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime_to_ts(inode, hfs_m_to_utime(rec->file.MdDat)))); 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_atime = inode->i_mtime = inode_set_ctime_to_ts(inode, - hfs_m_to_utime(rec->dir.MdDat)); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime_to_ts(inode, hfs_m_to_utime(rec->dir.MdDat)))); inode->i_op = &hfs_dir_inode_operations; inode->i_fop = &hfs_dir_operations; break; @@ -474,7 +474,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) be32_to_cpu(rec.dir.DirID) != inode->i_ino) { } - rec.dir.MdDat = hfs_u_to_mtime(inode->i_mtime); + rec.dir.MdDat = hfs_u_to_mtime(inode_get_mtime(inode)); rec.dir.Val = cpu_to_be16(inode->i_size - 2); hfs_bnode_write(fd.bnode, &rec, fd.entryoffset, @@ -502,7 +502,7 @@ int hfs_write_inode(struct inode *inode, struct writeback_control *wbc) else rec.file.Flags |= HFS_FIL_LOCK; hfs_inode_write_fork(inode, rec.file.ExtRec, &rec.file.LgLen, &rec.file.PyLen); - rec.file.MdDat = hfs_u_to_mtime(inode->i_mtime); + rec.file.MdDat = hfs_u_to_mtime(inode_get_mtime(inode)); hfs_bnode_write(fd.bnode, &rec, fd.entryoffset, sizeof(struct hfs_cat_file)); @@ -654,7 +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_set_ctime_current(inode); + simple_inode_init_ts(inode); } setattr_copy(&nop_mnt_idmap, inode, attr); diff --git a/fs/hfs/sysdep.c b/fs/hfs/sysdep.c index dc27d418fbcd..76fa02e3835b 100644 --- a/fs/hfs/sysdep.c +++ b/fs/hfs/sysdep.c @@ -28,11 +28,13 @@ 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) { - struct timespec64 ctime = inode_get_ctime(inode); + struct timespec64 ts = inode_get_ctime(inode); - inode_set_ctime(inode, ctime.tv_sec + diff, ctime.tv_nsec); - inode->i_atime.tv_sec += diff; - inode->i_mtime.tv_sec += diff; + inode_set_ctime(inode, ts.tv_sec + diff, ts.tv_nsec); + ts = inode_get_atime(inode); + inode_set_atime(inode, ts.tv_sec + diff, ts.tv_nsec); + ts = inode_get_mtime(inode); + inode_set_mtime(inode, ts.tv_sec + diff, ts.tv_nsec); HFS_I(inode)->tz_secondswest += diff; } return 1; From patchwork Wed Oct 4 18:52: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: 148492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340321vqb; Wed, 4 Oct 2023 11:57:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBe/eFq7JLvE6CQkq6/ZmLHJgd2YTRASBedlrSNHDlhwMrjdUdfw1HcQh11Uy3zl97KsDF X-Received: by 2002:a17:90a:dc0c:b0:268:5c3b:6f37 with SMTP id i12-20020a17090adc0c00b002685c3b6f37mr3036453pjv.0.1696445823657; Wed, 04 Oct 2023 11:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445823; cv=none; d=google.com; s=arc-20160816; b=AMT9L0ihVvCHsSjUoPuVOA8BA9o+zX1yGKV691vkjU4JWjKm7CWS/fyNdPOAFuEGX6 Km5vSOW/mK5k3UP/PMJ+Hz+CuTNuL9AXpf8DmBx+XRnejJOow8kf7GzDVRpJ+kgK5FBZ DEf/cv2qJLGQ8OmXnuqRr9tnvKygtXzEiTsHD9ZjzUzO0TnsOUWD2Tik/nU5ztCijUuy mDBR8V/gok+RDExQxnYD0/Kp3LJ6GIjvDUyCwci0vxH1icCxx3Lt7hC9WYMCeVbI5wVp aKNFxVMItPKlP0mQCtG+UsPPo6aVA9VuqXVQU1M+r33RcEDBIZvsrgmvF1GsV89H4SpH 9IpA== 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:to:from :dkim-signature; bh=DMHPZNoYVqwioN6fbP6ZulscgFICSSCjdmI3432pn/I=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=CUCR1LN5ivCBIDP/JtGfkjY3Sg6oZuRDrPvRHhbzRl+EQbFWUNZuBHFE9vgO9jze88 NZKxPlrQDqrhzfMxirjPkFY+h94qtdMxDSYEHQKcVrhOKMb7LUDXrgx6/AEOsUkLIrvY WbQq3vAMr+8lUXEUB3xt+sKp4Z0hK5GnLIIHAvA7alB7zyLbm8Mkl5VhdWjRg34REppE 89a65c1Q8n48O9UQbB6o5ThQTDnPQP/aKhkex7jQ9+OExyW1lG0bAq7LYWlslPSvCsSa 9UBe26/Idr7OoxJawoTcI+tDjZaFBbTVFAg9kGcdS4B59cpAla+1BuRaqx/v6QRNzH8f Fbgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFtKkyn6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j15-20020a17090a31cf00b00268178130a2si1998779pjf.60.2023.10.04.11.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFtKkyn6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7C8298251387; Wed, 4 Oct 2023 11:57:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244696AbjJDS44 (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244710AbjJDSzN (ORCPT ); Wed, 4 Oct 2023 14:55:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E551700; Wed, 4 Oct 2023 11:54:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58CC9C433C9; Wed, 4 Oct 2023 18:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445675; bh=/kKgNf3hiywveCMaNEhTJVWgpunI2TCWSMxTobQT/no=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aFtKkyn6j6x9UKSY+HeZ3Qhfc5ZbHtPRsdCXLU2B2m0lEYN2dCcvZxh0pbGM97BTJ 6VgTn5nD7IfDM+MOl6gwYRkD/+Yysf3z6pF2zIm4JWvnwrQVtb8Whp+0OSodZ6FUFF oxXaYNo4w0RMYHZuZcDkEGXBClzo4UWx7dAxbvnc0foMlrGrZMfgZci2+kYhYmDUiC eiYGg2Cb7lPEpxA1Nc6LcGA5WhWcRVozm1aBM6il+1rqPVpGJEeTNGaDWVXVvMBoFJ v/VtQLhnRV3hooJUie08JSyDu3ublJJaDzLjylivrAQtGWfgyuVQnLMFwZhII1B5gO P/ZmV/qtPAexA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 42/89] hfsplus: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:27 -0400 Message-ID: <20231004185347.80880-40-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852376320618339 X-GMAIL-MSGID: 1778852376320618339 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/hfsplus/catalog.c | 8 ++++---- fs/hfsplus/inode.c | 22 ++++++++++++---------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index e71ae2537eaa..1995bafee839 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dst_dir); + inode_set_mtime_to_ts(dst_dir, inode_set_ctime_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 = inode_set_ctime_current(src_dir); + inode_set_mtime_to_ts(src_dir, inode_set_ctime_current(src_dir)); /* remove old thread entry */ hfsplus_cat_build_key_with_cnid(sb, src_fd.search_key, cnid); diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index c65c8c4b03dd..702a0663b1d8 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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_set_ctime_current(inode); + simple_inode_init_ts(inode); hip = HFSPLUS_I(inode); INIT_LIST_HEAD(&hip->open_dir_list); @@ -521,8 +521,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) hfsplus_get_perms(inode, &folder->permissions, 1); set_nlink(inode, 1); 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_set_atime_to_ts(inode, hfsp_mt2ut(folder->access_date)); + inode_set_mtime_to_ts(inode, + hfsp_mt2ut(folder->content_mod_date)); inode_set_ctime_to_ts(inode, hfsp_mt2ut(folder->attribute_mod_date)); HFSPLUS_I(inode)->create_date = folder->create_date; @@ -563,8 +564,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) init_special_inode(inode, inode->i_mode, be32_to_cpu(file->permissions.dev)); } - inode->i_atime = hfsp_mt2ut(file->access_date); - inode->i_mtime = hfsp_mt2ut(file->content_mod_date); + inode_set_atime_to_ts(inode, hfsp_mt2ut(file->access_date)); + inode_set_mtime_to_ts(inode, + hfsp_mt2ut(file->content_mod_date)); inode_set_ctime_to_ts(inode, hfsp_mt2ut(file->attribute_mod_date)); HFSPLUS_I(inode)->create_date = file->create_date; @@ -609,8 +611,8 @@ int hfsplus_cat_write_inode(struct inode *inode) sizeof(struct hfsplus_cat_folder)); /* simple node checks? */ 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->access_date = hfsp_ut2mt(inode_get_atime(inode)); + folder->content_mod_date = hfsp_ut2mt(inode_get_mtime(inode)); folder->attribute_mod_date = hfsp_ut2mt(inode_get_ctime(inode)); folder->valence = cpu_to_be32(inode->i_size - 2); if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { @@ -644,8 +646,8 @@ int hfsplus_cat_write_inode(struct inode *inode) file->flags |= cpu_to_be16(HFSPLUS_FILE_LOCKED); else 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->access_date = hfsp_ut2mt(inode_get_atime(inode)); + file->content_mod_date = hfsp_ut2mt(inode_get_mtime(inode)); file->attribute_mod_date = hfsp_ut2mt(inode_get_ctime(inode)); hfs_bnode_write(fd.bnode, &entry, fd.entryoffset, sizeof(struct hfsplus_cat_file)); From patchwork Wed Oct 4 18:52: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: 148487 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340262vqb; Wed, 4 Oct 2023 11:56:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEtDzZ25v/6AsgGLmiwlXFHv/TbNiykfQUvw5mM+VyJvegJotvmr34vNjYkScsmj9Q0vQcc X-Received: by 2002:a05:6358:999f:b0:140:f6ab:b11e with SMTP id j31-20020a056358999f00b00140f6abb11emr3242958rwb.28.1696445817193; Wed, 04 Oct 2023 11:56:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445817; cv=none; d=google.com; s=arc-20160816; b=pyv3SthKs4fSEnDSOc3ERjFGL4ys7q3PC5HhFtr1UvIIf4oq3J0iFzYy7hJ7zEHJzI x5VfEJjWrkz9lCMDpyZE7dvT5AEH5Cog2HR9eIYrl3N8GvwPmfd6e+q3koxoXi9fKXWn xByU2BLic+mwxie4nbS/Yu/CIhGx5yNkGMDQl/SAZDO+ojQvWKRTCV5pXb1z96Edm3/s X1ZsvZbDE126AoVCDQDmIh0VpgDDXVLmEQm9qojSKTfQxBSTcgfkefNxIhZ3uub2Oxg1 +vkBS5GSoLVrrO+ZHy6U5JFs7fvSkcbbKdRbEf1RKqkWBu7+6FQpgUE2diEM5ePuI0pd yv1g== 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=vM4FpmqVo4CKvNXF+xbfo+zCvHeTF/E3+MrQjNIG37E=; fh=70aaKBzl/J7Fv9lk1MDJ485OMLrwSYhU+Uf1I70AYak=; b=QESXyxkJmS4Tv02qYPMrnJic3CMw6pKYR00RHVkJfGUZfF1A6xOXDe2boZfjHobY5N aUjZDFNMcXlTzaYmZY0A+qKcQRTm12ZwvVvjkJPCmmYvUzfs8j3HvMz+kWkky8NfQM3m chFlL24H/CrF5igskaUOyVyUBoXC4xTTrtz4zQwPgX6FmL12i7SFZJ7ZCKATBGpSzYoi venrcRJ8ZKStGjDjxu1ZwPHVR+/VW8Sy4ziY/jzTNSp8I4N+wLZcxSo0fY2etkLA5T95 s6tCbf0P6tcjtNCqc4ClUrqB1EuX7AhaWiFM743Oe7kQURlZxkmABvj7Lo4KmEQ2hGPp u3ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZWi31j1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id ep4-20020a17090ae64400b002773b2dd112si1978223pjb.54.2023.10.04.11.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:56:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZWi31j1j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 3BA93823CE9B; Wed, 4 Oct 2023 11:56:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245171AbjJDS4r (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244889AbjJDSzN (ORCPT ); Wed, 4 Oct 2023 14:55:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03C8E1703; Wed, 4 Oct 2023 11:54:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53314C433CA; Wed, 4 Oct 2023 18:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445676; bh=wyvNElsQFY/wD3VfgQOB/p8jSKpTCN3KRbRtfrvrqrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZWi31j1jUlgmDJkHPPyOFkz0C/QfZm5d49XioZxpJyhP8DyIOttETytNY39PK56W5 IuD3/BaYV68xTWkyv1GzhxiqtqQIR0q0Uz6NUGhmS6uAWx6d3aSmKhnAinEDw9se9u DyG/Eecn1IPpkAkJcPdA80ZrxQWID5H9A3omWWXFXi9KxJq0Aec4BBg41YB+8UZsgF o+/mCrLuEZ+33CrEGfZnaRjeyBde09bW87tvr8+Vul5mLEE4IGZuYVCiPXJ3vQQb4J qaWGhTshUsAAutavZ980pdGkNSOjnci6gt/dG/0Nn4CMcPqu7XJWm9gDCWNjG/X0PB fG0ZHVUaGTxLw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-um@lists.infradead.org Subject: [PATCH v2 43/89] hostfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:28 -0400 Message-ID: <20231004185347.80880-41-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:56:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852369315535012 X-GMAIL-MSGID: 1778852369315535012 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/hostfs/hostfs_kern.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index dc5a5cea5fae..ea87f24c6c3f 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -513,10 +513,14 @@ static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st) set_nlink(ino, st->nlink); i_uid_write(ino, st->uid); i_gid_write(ino, st->gid); - ino->i_atime = - (struct timespec64){ st->atime.tv_sec, st->atime.tv_nsec }; - ino->i_mtime = - (struct timespec64){ st->mtime.tv_sec, st->mtime.tv_nsec }; + inode_set_atime_to_ts(ino, (struct timespec64){ + st->atime.tv_sec, + st->atime.tv_nsec, + }); + inode_set_mtime_to_ts(ino, (struct timespec64){ + st->mtime.tv_sec, + st->mtime.tv_nsec, + }); inode_set_ctime(ino, st->ctime.tv_sec, st->ctime.tv_nsec); ino->i_size = st->size; ino->i_blocks = st->blocks; From patchwork Wed Oct 4 18:52: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: 148497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340408vqb; Wed, 4 Oct 2023 11:57:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs38LmVV99E0xue+p/chIvHWySrZKrMSiY4SPVAXDncvzU+IvQ58nEDN2B15jF2x7g4qBp X-Received: by 2002:a17:90a:d998:b0:274:1bb1:415a with SMTP id d24-20020a17090ad99800b002741bb1415amr2906585pjv.41.1696445831934; Wed, 04 Oct 2023 11:57:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445831; cv=none; d=google.com; s=arc-20160816; b=tMbBUaGuAQhsiNZ2GP034E9813UWtYUEQheNcubDMWG+sZHOMWZ7yI8o/+OFK2x+2g ooPHHgGrAFho1srdl9aq9AXAw+PbQXHpYDouPTTJXu9xMj9yObvecY9iHDf13OpHDhz1 RK31skmkH/R8gAA3skxL86ooE9AeiRgK/T9dMI2b4KAyq0nGuQ6Mc2QNsb2Kv6xzrTJU eOKURMjWdWExaB/xafHXpIHiaWMNv+EB8xBOstqNaeEQrwfXAF9rcQzT0an6ZF1dzfJ6 VQXH9dIq35ux4gybk8U3vNH+I7JaGSs4S7eizJNv8ZzVbmxMrW3EvfErTc8m6sGjWjaA 1XQA== 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:to:from :dkim-signature; bh=k8ZBLRg5ciU21cSXGao/Dg9vm1TZ2Vbk1IPSIETuPPc=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=gEo/gH8dyMCg4F3A16Obp9YdiS6DrzZPWLPa6BW/JVZU3Y18hLupTpEFcmF0Wuc5iR gUvEhpmYeUa/8xnu3UfnSQEpWqrE+J8qvyeVvF7onBmW1ormlFf0dUxfdKH68Rw6/v0/ gqNkEHaTbrhtPAOJW5PFfjmesXrbmYshoFsaxeyEGQO5szk+OJRCE0c0LXd5g8WEE7r1 Ji/ZDjDME1DXHfrUU27l3V0zBqPmVKkegcenM0Cf8ETjfH35JxO4DVxvcrMmv+JKb6vY 0enZY8MZGzzhV+3tK3GBndPmzA3VUzWUydmwMnysf9yQO6C0QQZ5p+oriYw1BDiDxYP3 sCzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IJswiSnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id cx14-20020a17090afd8e00b0027766994586si2021481pjb.71.2023.10.04.11.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IJswiSnH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BED25825E519; Wed, 4 Oct 2023 11:57:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244809AbjJDS5F (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244894AbjJDSzO (ORCPT ); Wed, 4 Oct 2023 14:55:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EF8C1705; Wed, 4 Oct 2023 11:54:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A257CC433C7; Wed, 4 Oct 2023 18:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445678; bh=bLOrGme+RocfazPEaVBFlntuWpbBmOjToSJmxl7XT9g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IJswiSnHIepUEQ2yQhrZdxCpsZgeDuSPwEzgVpqjE7kxYeWuWBxq3xV43pnyJ0Qwk HqAt1+isGv5RlPitoJptpGyeIagVq/C/2rM+TQRpGOqGPwrxbVRz7/TB1zwtGD5fof xSSUBqcrWwqOudPk21zRel/WG4a5wr699rtJW4qRFVgePNhhQ0hqSnoB81kK17p2Zb so821YrSS3LLudTKJTJSVDfRAPsL+9y3hvTcxqF/UVtS+Ak9EiIJR2MQQehSQS4smW 6HgFTPLmhg5o+FMIpoUO2LXHdBOo80kXGPqLPU0aP5lrdlv/RlOzxKDptOCUPvBPoi 5Us7cwpiKLu4w== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 44/89] hpfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:29 -0400 Message-ID: <20231004185347.80880-42-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852384853301388 X-GMAIL-MSGID: 1778852384853301388 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/hpfs/dir.c | 12 +++++++----- fs/hpfs/inode.c | 16 ++++++++-------- fs/hpfs/namei.c | 22 +++++++++++----------- fs/hpfs/super.c | 10 ++++++---- 4 files changed, 32 insertions(+), 28 deletions(-) diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index f36566d61215..49dd585c2b17 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -277,14 +277,16 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned in * inode. */ - if (!inode_get_ctime(result).tv_sec) { + if (!inode_get_ctime_sec(result)) { time64_t csec = local_to_gmt(dir->i_sb, le32_to_cpu(de->creation_date)); inode_set_ctime(result, csec ? csec : 1, 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)); - result->i_atime.tv_nsec = 0; + inode_set_mtime(result, + local_to_gmt(dir->i_sb, le32_to_cpu(de->write_date)), + 0); + inode_set_atime(result, + local_to_gmt(dir->i_sb, le32_to_cpu(de->read_date)), + 0); hpfs_result->i_ea_size = le32_to_cpu(de->ea_size); if (!hpfs_result->i_ea_mode && de->read_only) result->i_mode &= ~0222; diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 479166378bae..a59e8fa630db 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -37,8 +37,8 @@ void hpfs_init_inode(struct inode *i) hpfs_inode->i_dirty = 0; inode_set_ctime(i, 0, 0); - i->i_mtime.tv_sec = i->i_mtime.tv_nsec = 0; - i->i_atime.tv_sec = i->i_atime.tv_nsec = 0; + inode_set_mtime(i, 0, 0); + inode_set_atime(i, 0, 0); } void hpfs_read_inode(struct inode *i) @@ -230,9 +230,9 @@ void hpfs_write_inode_nolock(struct inode *i) } hpfs_write_inode_ea(i, fnode); 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, inode_get_ctime(i).tv_sec)); + de->write_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_mtime_sec(i))); + de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_atime_sec(i))); + de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_ctime_sec(i))); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(hpfs_inode->i_ea_size); hpfs_mark_4buffers_dirty(&qbh); @@ -240,9 +240,9 @@ void hpfs_write_inode_nolock(struct inode *i) } if (S_ISDIR(i->i_mode)) { 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, inode_get_ctime(i).tv_sec)); + de->write_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_mtime_sec(i))); + de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_atime_sec(i))); + de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_ctime_sec(i))); 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 f4eb8d6f5989..9184b4584b01 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c @@ -12,10 +12,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 == inode_get_ctime(dir).tv_sec) + if (t == inode_get_mtime_sec(dir) && + t == inode_get_ctime_sec(dir)) return; - dir->i_mtime = inode_set_ctime(dir, t, 0); + inode_set_mtime_to_ts(dir, inode_set_ctime(dir, t, 0)); hpfs_write_inode_nolock(dir); } @@ -58,8 +58,8 @@ 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_mtime = result->i_atime = - inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0); + inode_set_mtime_to_ts(result, + inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0))); hpfs_i(result)->i_ea_size = 0; result->i_mode |= S_IFDIR; result->i_op = &hpfs_dir_iops; @@ -164,8 +164,8 @@ 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_mtime = result->i_atime = - inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0); + inode_set_mtime_to_ts(result, + inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0))); hpfs_i(result)->i_ea_size = 0; if (dee.read_only) result->i_mode &= ~0222; @@ -245,8 +245,8 @@ 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_mtime = result->i_atime = - inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0); + inode_set_mtime_to_ts(result, + inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0))); hpfs_i(result)->i_ea_size = 0; result->i_uid = current_fsuid(); result->i_gid = current_fsgid(); @@ -319,8 +319,8 @@ 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_mtime = result->i_atime = - inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0); + inode_set_mtime_to_ts(result, + inode_set_atime_to_ts(result, inode_set_ctime(result, local_to_gmt(dir->i_sb, le32_to_cpu(dee.creation_date)), 0))); hpfs_i(result)->i_ea_size = 0; result->i_mode = S_IFLNK | 0777; result->i_uid = current_fsuid(); diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index 758a51564124..6b0ba3c1efba 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -725,10 +725,12 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent) if (!de) hpfs_error(s, "unable to find root dir"); else { - root->i_atime.tv_sec = local_to_gmt(s, le32_to_cpu(de->read_date)); - 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; + inode_set_atime(root, + local_to_gmt(s, le32_to_cpu(de->read_date)), + 0); + inode_set_mtime(root, + local_to_gmt(s, le32_to_cpu(de->write_date)), + 0); inode_set_ctime(root, local_to_gmt(s, le32_to_cpu(de->creation_date)), 0); 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: 148496 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340377vqb; Wed, 4 Oct 2023 11:57:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG2tNTWXUOSGXOrCnnEJaXwlGWgS+p4ejz5+W+lAsCM+tW+lPVeovFPLIkNb/F5k0UlF1x4 X-Received: by 2002:a17:902:ab82:b0:1c7:443d:7419 with SMTP id f2-20020a170902ab8200b001c7443d7419mr3284657plr.29.1696445828267; Wed, 04 Oct 2023 11:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445828; cv=none; d=google.com; s=arc-20160816; b=Rs7QKsX8zKMTNWenctXhwHm+CeLjERWAChzolGszMFewZw6pL0nYakjEYZ+QZX+aO8 4GGM6rU+e38n/6p9Qo/IzWiIY7YjJsu/EH87MtDhIrehe34CBYxbPyN2ij+uMl23Tr5r 85RRaEc8X3jwFYtwcOdaLobmnRPVwAXKY96z2wDCmQUq42lMgIDYmNdxMZftJgh/jGX3 d0FVWaOnL2//kQsIWw+a2I9fRQVPSfVaT89z/kckEpa0xuCBQ8YwFcG3idJUnW+7qLeX 5m2fm7ZwhCHxfuEfUchNwpVKSGrHmvjp6QGv98Xr+ijxFlPE4o+wpQGLOmPhXUjn7nPV bAIA== 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=V6+qe6AGparTSOjauaKonsVYwrcp/k0IaLgG1CC3Ipw=; fh=YcvKTfjdELTIgtVvxDx+GI7Jag3KQiPyLLfYV96J/gA=; b=tqE5am9QG0tKXFcHT4ZDVLRx4DVyjjqyyPg2MfNl4UMyXbNwuSO7c69HHVCuikTiXz aSxrz5F6Qt+xuS6EgG4W7U+NDNjobCErWqlouU4qbO2Ahl7fcrwGxutktBjKHQyTWHq2 Avzg/vCcgcByYJgxApady0te9DNEl9A5DHEIlrz9QeYX/JS3MNQN1pKyoPUjQnrhs31p T6dc17357s4Apm/l+phPVGnux7zhwAHmjuLIL89w8Vl5n8KBDoc4ZrgkURQuTQP0+fBN s8mSD4cJERvpgORxJYiNPjFz1ig02LBVUXqC/YjDCG1KcYL3RA5+kEtcIf5LWG6z2wGl wSDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JjCLMHa9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c4-20020a170903234400b001c5844a4db7si4475965plh.562.2023.10.04.11.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JjCLMHa9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 6FF9A82513A6; Wed, 4 Oct 2023 11:57:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244945AbjJDS5D (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244896AbjJDSzO (ORCPT ); Wed, 4 Oct 2023 14:55:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84CB0BF; Wed, 4 Oct 2023 11:54:39 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852380949926749 X-GMAIL-MSGID: 1778852380949926749 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:52: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: 148490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340299vqb; Wed, 4 Oct 2023 11:57:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeM52nBCGIQVbjYPWowoBLxIJIOAm4warGxo4D4UoL1HmAVA1vBVWgjlrbclUKIbzpHdYd X-Received: by 2002:a05:6a00:b95:b0:68f:dfea:9100 with SMTP id g21-20020a056a000b9500b0068fdfea9100mr4426923pfj.21.1696445822436; Wed, 04 Oct 2023 11:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445822; cv=none; d=google.com; s=arc-20160816; b=dLTOEAH5Z237GKyAqASDf1XQZQuQZ4gyg5E8ZmffKjO+p8u7bzJhz7WWtF5mYENMpj ztni4MwMHsKGpSxv0BbWflSzj+DJZv3xy037/zmoht4AkKv5Pmfdblodbd7srWlM4J2e EH+G5SsV1aaFOsZcuCGmA5c6Jr+Zfnlq8fo+LbMEUFhRstTxer3QpQIBruYU9H/SqoAk jtYV5ZgUFTPF2R9YUXenNBAPdHbVhLqGFsMQ8rWYdmK/gmhvglMk09rJ+G/Xv4nIKhgP zM98uKFbU3H/ySyJMAJCC+kUNULK1YQ+NgW3zN1eRk2kC3WRFgUQhsFm1B+3UUTWlyES ABcA== 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:to:from :dkim-signature; bh=diRvL/7VCDobDS7GDFfS164nAOLj7ghUrO3lr0gBHqU=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=DpoFE27s8P8f1Kg7+Oe4zE7ZVOd2p4iykSwDMK2X5LuaZZkCC2L7QvAuixZaESLV7N UMvBDphWnszuRNlETYWiRtc3v7RaMexmjDf6bTgpIqX3bzu2vClBJ0sBsQCnRxuyx8GC hIK2yaKbl3bliUHoVq/2TBXcKQLZbfjhThddZl7rOI7xnIjaFkTCgm4DOwpDkT8Ni7WD dveAg0MIe4r9m6zLUWXOAKbI4erPOkIwFXD28IZwLwtrfWmNb7apz0xBCe35g1hG1XD0 t1Y4/jYUN5hKlUbVd9XUxw+VkZpObsHtNY9oAx+n4TnkOkHAxf24on1esBjam9j0oWiE M2hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QF+ZtPgJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l65-20020a639144000000b00578acf1e8a4si4453833pge.573.2023.10.04.11.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QF+ZtPgJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9FDA68251382; Wed, 4 Oct 2023 11:57:01 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244810AbjJDS47 (ORCPT + 19 others); Wed, 4 Oct 2023 14:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244899AbjJDSzO (ORCPT ); Wed, 4 Oct 2023 14:55:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A247C1AC; Wed, 4 Oct 2023 11:54:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6951C433C7; Wed, 4 Oct 2023 18:54:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445680; bh=k4ZUpa6J1BuoVYWAGoQizbF/tb9dzfYDbjoaj3H865A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QF+ZtPgJltvkZ4wRlkydlrJjExkxPnb8w2VS8k2wz7RTDqIUo3j0UfEKsNWAjMFjw thFbyy6TvHMMJGOu02xNjKYxXFg+DXpGKuCTVou4Zr1OKeiwwEHg40N4Jp+/37ohon gRy7sFEP/UmyWoxws7W3m9gVQxYPpIf9f9R360tW1jLjR0RoCHmHke3E6RadBIUsWJ ogb8CCIR1Nvyb/EwlTwyTxN4a4EzP+CsC/m59vk8Bq3Kk4svptI/RhrQpNJ0sTqJ28 pq70nbhxdWY9OFp667eFyJVYtxtZWcYyayR82+gwo7IjUPZ0NNC4o8msKiMzozNwFb Bc41YRa6vHtPw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 46/89] isofs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:31 -0400 Message-ID: <20231004185347.80880-44-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852374541367220 X-GMAIL-MSGID: 1778852374541367220 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/isofs/inode.c | 4 ++-- fs/isofs/rock.c | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 2ee21286ac8f..3e4d53e26f94 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -1422,8 +1422,8 @@ static int isofs_read_inode(struct inode *inode, int relocated) inode->i_ino, de->flags[-high_sierra]); } #endif - inode->i_mtime = inode->i_atime = - inode_set_ctime(inode, iso_date(de->date, high_sierra), 0); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime(inode, iso_date(de->date, high_sierra), 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 348783a70f57..d6c17ad69dee 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c @@ -426,16 +426,14 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, 0); } if (rr->u.TF.flags & TF_MODIFY) { - inode->i_mtime.tv_sec = - iso_date(rr->u.TF.times[cnt++].time, - 0); - inode->i_mtime.tv_nsec = 0; + inode_set_mtime(inode, + iso_date(rr->u.TF.times[cnt++].time, 0), + 0); } if (rr->u.TF.flags & TF_ACCESS) { - inode->i_atime.tv_sec = - iso_date(rr->u.TF.times[cnt++].time, - 0); - inode->i_atime.tv_nsec = 0; + inode_set_atime(inode, + iso_date(rr->u.TF.times[cnt++].time, 0), + 0); } if (rr->u.TF.flags & TF_ATTRIBUTES) { inode_set_ctime(inode, @@ -531,9 +529,9 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de, inode->i_rdev = reloc->i_rdev; inode->i_size = reloc->i_size; inode->i_blocks = reloc->i_blocks; - inode->i_atime = reloc->i_atime; + inode_set_atime_to_ts(inode, inode_get_atime(reloc)); inode_set_ctime_to_ts(inode, inode_get_ctime(reloc)); - inode->i_mtime = reloc->i_mtime; + inode_set_mtime_to_ts(inode, inode_get_mtime(reloc)); iput(reloc); break; #ifdef CONFIG_ZISOFS From patchwork Wed Oct 4 18:52: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: 148500 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340480vqb; Wed, 4 Oct 2023 11:57:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHnhs/kKJ61Nrn+jcNbbAAfuaNU9sJSoRNEq19XDee+vcR2W5TQkrJ+dPe61Pu/A880p5pR X-Received: by 2002:a05:6a00:181d:b0:68a:48e7:9deb with SMTP id y29-20020a056a00181d00b0068a48e79debmr824607pfa.2.1696445841015; Wed, 04 Oct 2023 11:57:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445841; cv=none; d=google.com; s=arc-20160816; b=BmaTab/1Aq86WtLveLliM7EBhDmRzgKVldu9XdrQdFvXABKy0sRdXLLlFMFtI10jtK HWhTRKvKv6YcnX/XUpcGXbvkH7Huw0f1QXN0AUTq8oRWXoXw637rcIiIkA2pUrCeqgfp oObjuarG/al3bcV/0g+eiwXfrYOZs+L1JLdgVj98/jTCwO+weCJ8F6JkFr8NK99WpOfY +4VB0rwSsTv89kDmOGNemGzfIxMagYPDBn2Fx8upEOG23vIkwfq3jqJfV0sWqED0SNod 2E0O+awTIKxWyLLIhZtE95xrVgsA0hLmCP0cqHfB/BoSvOJ6uyJY1AvWkiYjOjGFeXXV AZ5A== 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=A68aRUzNoibNhImqSRQ1jeDIrnanD0D0gXyweGckKa8=; fh=9dbp+PVfJHvhQ2T/xAbsquROFmtfn3Q6xzmielwCmS0=; b=CwyLU8U1poEQVpl/Hsw3OPAvGRfQF1D+mGPmjBcqD7Toprg5x8b2h49dWrdBlYzUP0 bhpyWUqe8B0n/i2AbPtikDQUbWW+uoqT/AxP7gx2GQn0iI/u1EMvcuiMiNYp3FtvpRAG itbH0Q/acHlWYp046brSEdrP+Ft+4QrOw+/qfMdLmG5X4muzN0ip75w4jTsG5k4T57em 5mUS0DE8r4bC/dT9+rBTPDyD0N7GRgZ/bo1t95thHEFI3efU7H7bZZ9gs2zqb7xof6OH iNwuXlvG+MmdDI9vslySmJUt9XjdqyUdCf7YtindiXRXd3AIZuh0OFTxCtoDvw5nNazm yJaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dz5y9z/d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f10-20020a056a0022ca00b00690c0055246si4608964pfj.294.2023.10.04.11.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="dz5y9z/d"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4929E82663F3; Wed, 4 Oct 2023 11:57:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244956AbjJDS5Q (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244640AbjJDSzQ (ORCPT ); Wed, 4 Oct 2023 14:55:16 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2A401707; Wed, 4 Oct 2023 11:54:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DD64C433C9; Wed, 4 Oct 2023 18:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445681; bh=UrgOTQfdAQfTXCIGdLyLVXk74Vsq/u0kOo6JBPecsbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dz5y9z/dURP8JbmbdbIuLCJ1v0wYxlOO0MPn4plc3dTP73t0/oOQu9uVGwDYNh1AT Jd4gsxxCsNelkWLVnGN4nSUt01/7rzUNbMkj7D04XgyWdbS1yBQRw60zmLLnnEcMfd YnRNDegv7aCYHeuDpofZ0Ks9poOFTowlpfh9KsMjfDUfGEGlOVr5QoKXIWz+58lj02 M21V+QG5rZVPLr11HhGLtlB/0ZBMu4bLCYQAjRllUZxORlr84CXREivqpCnBNNYHY5 qFMBahH44QvvY+RjbZdHCAAfHJH9fMmlC27vbHcylr3KXJROQBRLniTb4/tb0LYm/A 3DVrghFIYEfcA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-mtd@lists.infradead.org Subject: [PATCH v2 47/89] jffs2: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:32 -0400 Message-ID: <20231004185347.80880-45-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852394443671665 X-GMAIL-MSGID: 1778852394443671665 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/jffs2/dir.c | 35 ++++++++++++++++++++--------------- fs/jffs2/file.c | 4 ++-- fs/jffs2/fs.c | 20 ++++++++++---------- fs/jffs2/os-linux.h | 4 ++-- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 091ab0eaabbe..2b2938970da3 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -204,8 +204,8 @@ static int jffs2_create(struct mnt_idmap *idmap, struct inode *dir_i, if (ret) goto fail; - dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, - ITIME(je32_to_cpu(ri->ctime))); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(ri->ctime)))); jffs2_free_raw_inode(ri); @@ -238,7 +238,8 @@ 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 = inode_set_ctime_to_ts(dir_i, ITIME(now)); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(now))); return ret; } /***********************************************************************/ @@ -272,7 +273,8 @@ 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 = inode_set_ctime_to_ts(dir_i, ITIME(now)); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(now))); ihold(d_inode(old_dentry)); } return ret; @@ -423,8 +425,8 @@ static int jffs2_symlink (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, - ITIME(je32_to_cpu(rd->mctime))); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(rd->mctime)))); jffs2_free_raw_dirent(rd); @@ -568,8 +570,8 @@ static int jffs2_mkdir (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, - ITIME(je32_to_cpu(rd->mctime))); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(rd->mctime)))); inc_nlink(dir_i); jffs2_free_raw_dirent(rd); @@ -610,7 +612,8 @@ 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 = inode_set_ctime_to_ts(dir_i, ITIME(now)); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(now))); clear_nlink(d_inode(dentry)); drop_nlink(dir_i); } @@ -746,8 +749,8 @@ static int jffs2_mknod (struct mnt_idmap *idmap, struct inode *dir_i, goto fail; } - dir_i->i_mtime = inode_set_ctime_to_ts(dir_i, - ITIME(je32_to_cpu(rd->mctime))); + inode_set_mtime_to_ts(dir_i, + inode_set_ctime_to_ts(dir_i, ITIME(je32_to_cpu(rd->mctime)))); jffs2_free_raw_dirent(rd); @@ -868,16 +871,18 @@ 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 = inode_set_ctime_to_ts(new_dir_i, - ITIME(now)); + inode_set_mtime_to_ts(new_dir_i, + inode_set_ctime_to_ts(new_dir_i, ITIME(now))); return ret; } if (d_is_dir(old_dentry)) drop_nlink(old_dir_i); - old_dir_i->i_mtime = inode_set_ctime_to_ts(old_dir_i, ITIME(now)); - new_dir_i->i_mtime = inode_set_ctime_to_ts(new_dir_i, ITIME(now)); + inode_set_mtime_to_ts(old_dir_i, + inode_set_ctime_to_ts(old_dir_i, ITIME(now))); + inode_set_mtime_to_ts(new_dir_i, + inode_set_ctime_to_ts(new_dir_i, ITIME(now))); return 0; } diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 11c66793960e..62ea76da7fdf 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -317,8 +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_mtime = inode_set_ctime_to_ts(inode, - ITIME(je32_to_cpu(ri->ctime))); + inode_set_mtime_to_ts(inode, + inode_set_ctime_to_ts(inode, ITIME(je32_to_cpu(ri->ctime)))); } } diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 0403efab4089..d175cccb7c55 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -113,8 +113,8 @@ 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->atime = cpu_to_je32(I_SEC((ivalid & ATTR_ATIME)?iattr->ia_atime:inode_get_atime(inode))); + ri->mtime = cpu_to_je32(I_SEC((ivalid & ATTR_MTIME)?iattr->ia_mtime:inode_get_mtime(inode))); ri->ctime = cpu_to_je32(I_SEC((ivalid & ATTR_CTIME)?iattr->ia_ctime:inode_get_ctime(inode))); ri->offset = cpu_to_je32(0); @@ -147,9 +147,9 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) return PTR_ERR(new_metadata); } /* It worked. Update the inode */ - inode->i_atime = ITIME(je32_to_cpu(ri->atime)); + inode_set_atime_to_ts(inode, ITIME(je32_to_cpu(ri->atime))); inode_set_ctime_to_ts(inode, ITIME(je32_to_cpu(ri->ctime))); - inode->i_mtime = ITIME(je32_to_cpu(ri->mtime)); + inode_set_mtime_to_ts(inode, ITIME(je32_to_cpu(ri->mtime))); inode->i_mode = jemode_to_cpu(ri->mode); i_uid_write(inode, je16_to_cpu(ri->uid)); i_gid_write(inode, je16_to_cpu(ri->gid)); @@ -282,8 +282,8 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) i_uid_write(inode, je16_to_cpu(latest_node.uid)); i_gid_write(inode, je16_to_cpu(latest_node.gid)); 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_set_atime_to_ts(inode, ITIME(je32_to_cpu(latest_node.atime))); + inode_set_mtime_to_ts(inode, ITIME(je32_to_cpu(latest_node.mtime))); inode_set_ctime_to_ts(inode, ITIME(je32_to_cpu(latest_node.ctime))); set_nlink(inode, f->inocache->pino_nlink); @@ -386,8 +386,8 @@ void jffs2_dirty_inode(struct inode *inode, int flags) iattr.ia_mode = inode->i_mode; iattr.ia_uid = inode->i_uid; iattr.ia_gid = inode->i_gid; - iattr.ia_atime = inode->i_atime; - iattr.ia_mtime = inode->i_mtime; + iattr.ia_atime = inode_get_atime(inode); + iattr.ia_mtime = inode_get_mtime(inode); iattr.ia_ctime = inode_get_ctime(inode); jffs2_do_setattr(inode, &iattr); @@ -475,8 +475,8 @@ 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_mtime = inode_set_ctime_current(inode); - ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode->i_mtime)); + simple_inode_init_ts(inode); + ri->atime = ri->mtime = ri->ctime = cpu_to_je32(I_SEC(inode_get_mtime(inode))); inode->i_blocks = 0; inode->i_size = 0; diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 50727a1ff931..86ab014a349c 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -36,8 +36,8 @@ struct kvec; #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(inode_get_ctime(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 JFFS2_F_I_MTIME(f) I_SEC(inode_get_mtime(OFNI_EDONI_2SFFJ(f))) +#define JFFS2_F_I_ATIME(f) I_SEC(inode_get_atime(OFNI_EDONI_2SFFJ(f))) #define sleep_on_spinunlock(wq, s) \ do { \ DECLARE_WAITQUEUE(__wait, current); \ From patchwork Wed Oct 4 18:52: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: 148499 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340448vqb; Wed, 4 Oct 2023 11:57:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtuVyZTzJX/PMqj0ThHfnIRbpMfkIJZWeU4qT+tKiD0W49zD9x+SAvPmwM3SIkpTyECDaH X-Received: by 2002:a17:902:e809:b0:1c0:6e92:8cc5 with SMTP id u9-20020a170902e80900b001c06e928cc5mr2894424plg.17.1696445836939; Wed, 04 Oct 2023 11:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445836; cv=none; d=google.com; s=arc-20160816; b=PhzzAirHv1v94wv5LXgHS6wYVvr/FiaUd9IjoPYW6iWj2eK8IKBwqQRKmZwcOf36FS 5yJ8j5LPmFM6IcAsXnvxjDwr/0SLnCh1az2lBIqQ6pkIbRsBQkEEdM3wrXaJ+6qHRZLR A/ftVjS0hkcQQjOL2DpBoMdjf+S3qlwCv2bJUVPrhpJWHiKNwAj4IYbFRtDJQvw8ybhc 6Dgxltr/HxfCOlnv8m75C+6snhi/gVE/69l85i/LxmlrAwRh3rwrTWofKhM+6H7o2d4Z cLfzAvH2pzWgUvwuTsRPmwhXpl4uIbXb9BHS5MsLwjLoUKhjlGjPlyU2Huae4PmxQ5/m 2FSA== 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=5QxOloj6BArMCi4yFIow5/z8rSDYBuGO+2o+/PRK4R8=; fh=LNBNj1LtKPAaxe3o/0Raobx+1w4wFFW4PHq/vjNQkH0=; b=AFEjQfwt3ip25ZyNAb9kUuwiCt0BqipX2HlUQdUgrFJ5EdC7ch6hfFXPAi9KzxDU4K ohnD/OYq9E/sQAuJ46I56O2V+C/fNfUmssejao7r3bLyBGx6rnugrNvTpl+Nd9ZE5Mku G2sjB8GJEMccaGQBa0dmFrMJP9/laiDv/d66KZRZllTXHSGZSvjhJRt1BB9OwCyPCc34 zFx0w9VHsewGkpDKfbBLMcKPNEXtWRpEw1thpZsPZ34+qOO6Ix8VOZuL44Blr7m0DOgV u+g4ZKsvgAE6Sfct7ybuAkKkccKa8v0ZctfCtvzVWMAQzb8n1OF76tGivF5vjyP2JeVw P4qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KKugYXni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t12-20020a1709028c8c00b001c46467a211si4169692plo.193.2023.10.04.11.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KKugYXni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 2CA3082663E0; Wed, 4 Oct 2023 11:57:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244677AbjJDS5M (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244909AbjJDSzR (ORCPT ); Wed, 4 Oct 2023 14:55:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76026CE; Wed, 4 Oct 2023 11:54:43 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81EBAC433C8; Wed, 4 Oct 2023 18:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445683; bh=SZ6GtxYWFG+m2uoVVjthnxknAjsmUPNY0GAnxe0VeKA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KKugYXnikd3HwfhR6ajopt70yBFBNSfQlCCIN3HLz2BN3rTEAOBJXCh9w6FU8EukJ 000cFbpFkl7BL0P63siq51N1YXXWrgyFul+D1l8VC2Km/qNTRPZRhLenka4PtFyl5M K8cko9eH8fIA2B3xrrSRs2nOJvHY9wwsIc+GNPlzs83mljqVaLvJ9EGJpc5sC0++8O YiWpzpBlNxqWygDdKVF+FW03ePk/fAeiN1wmtoKktIKYu3hU34yEsVDKQoVtZlMIKt twRTi5+WAaeGDL8gd8rmY/RwBEpMlJAACZ/RG36Gt7iwJLca+awDhwC+0zrj4Fy+DW zzdzA81Z6s6/Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net Subject: [PATCH v2 48/89] jfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:33 -0400 Message-ID: <20231004185347.80880-46-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852390073502424 X-GMAIL-MSGID: 1778852390073502424 Convert to using the new inode timestamp accessor functions. Acked-by: Dave Kleikamp Signed-off-by: Jeff Layton --- fs/jfs/inode.c | 2 +- fs/jfs/jfs_imap.c | 20 ++++++++++---------- fs/jfs/jfs_inode.c | 4 ++-- fs/jfs/namei.c | 20 +++++++++++--------- fs/jfs/super.c | 2 +- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 920d58a1566b..1a6b5921d17a 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 = inode_set_ctime_current(ip); + inode_set_mtime_to_ts(ip, inode_set_ctime_current(ip)); mark_inode_dirty(ip); txCommit(tid, 1, &ip, 0); diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index 923a58422c46..8e87264e56ce 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c @@ -3061,10 +3061,10 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip) } ip->i_size = le64_to_cpu(dip->di_size); - ip->i_atime.tv_sec = le32_to_cpu(dip->di_atime.tv_sec); - 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); + inode_set_atime(ip, le32_to_cpu(dip->di_atime.tv_sec), + le32_to_cpu(dip->di_atime.tv_nsec)); + inode_set_mtime(ip, le32_to_cpu(dip->di_mtime.tv_sec), + le32_to_cpu(dip->di_mtime.tv_nsec)); inode_set_ctime(ip, le32_to_cpu(dip->di_ctime.tv_sec), le32_to_cpu(dip->di_ctime.tv_nsec)); ip->i_blocks = LBLK2PBLK(ip->i_sb, le64_to_cpu(dip->di_nblocks)); @@ -3138,12 +3138,12 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip) else /* Leave the original permissions alone */ dip->di_mode = cpu_to_le32(jfs_ip->mode2); - 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(inode_get_ctime(ip).tv_sec); - dip->di_ctime.tv_nsec = cpu_to_le32(inode_get_ctime(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_atime.tv_sec = cpu_to_le32(inode_get_atime_sec(ip)); + dip->di_atime.tv_nsec = cpu_to_le32(inode_get_atime_nsec(ip)); + dip->di_ctime.tv_sec = cpu_to_le32(inode_get_ctime_sec(ip)); + dip->di_ctime.tv_nsec = cpu_to_le32(inode_get_ctime_nsec(ip)); + dip->di_mtime.tv_sec = cpu_to_le32(inode_get_mtime_sec(ip)); + dip->di_mtime.tv_nsec = cpu_to_le32(inode_get_mtime_nsec(ip)); dip->di_ixpxd = jfs_ip->ixpxd; /* in-memory pxd's are little-endian */ dip->di_acl = jfs_ip->acl; /* as are dxd's */ dip->di_ea = jfs_ip->ea; diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c index 87594efa7f7c..f10f295d1502 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_set_ctime_current(inode); - jfs_inode->otime = inode_get_ctime(inode).tv_sec; + simple_inode_init_ts(inode); + jfs_inode->otime = inode_get_ctime_sec(inode); inode->i_generation = JFS_SBI(sb)->gengen++; jfs_inode->cflag = 0; diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index 57d7a4300210..d68a4e6ac345 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_mtime = inode_set_ctime_current(dip); + inode_set_mtime_to_ts(dip, inode_set_ctime_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_mtime = inode_set_ctime_current(dip); + inode_set_mtime_to_ts(dip, inode_set_ctime_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_mtime = inode_set_ctime_current(dip); + inode_set_mtime_to_ts(dip, inode_set_ctime_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); - dip->i_mtime = inode_set_ctime_to_ts(dip, inode_set_ctime_current(ip)); + inode_set_mtime_to_ts(dip, + inode_set_ctime_to_ts(dip, inode_set_ctime_current(ip))); mark_inode_dirty(dip); /* update target's inode */ @@ -828,7 +829,7 @@ static int jfs_link(struct dentry *old_dentry, /* update object inode */ inc_nlink(ip); /* for new link */ inode_set_ctime_current(ip); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); ihold(ip); @@ -1028,7 +1029,7 @@ static int jfs_symlink(struct mnt_idmap *idmap, struct inode *dip, mark_inode_dirty(ip); - dip->i_mtime = inode_set_ctime_current(dip); + inode_set_mtime_to_ts(dip, inode_set_ctime_current(dip)); mark_inode_dirty(dip); /* * commit update of parent directory and link object @@ -1271,7 +1272,7 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, inode_set_ctime_current(old_ip); mark_inode_dirty(old_ip); - new_dir->i_mtime = inode_set_ctime_current(new_dir); + inode_set_mtime_to_ts(new_dir, inode_set_ctime_current(new_dir)); mark_inode_dirty(new_dir); /* Build list of inodes modified by this transaction */ @@ -1283,7 +1284,8 @@ static int jfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, if (old_dir != new_dir) { iplist[ipcount++] = new_dir; - old_dir->i_mtime = inode_set_ctime_current(old_dir); + inode_set_mtime_to_ts(old_dir, + inode_set_ctime_current(old_dir)); mark_inode_dirty(old_dir); } @@ -1416,7 +1418,7 @@ static int jfs_mknod(struct mnt_idmap *idmap, struct inode *dir, mark_inode_dirty(ip); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 2e2f7f6d36a0..966826c394ee 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); inode_unlock(inode); return len - towrite; From patchwork Wed Oct 4 18:52: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: 148508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340905vqb; Wed, 4 Oct 2023 11:58:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHToJw5zoZ+WJK7XqN/iYOnuHjPRlJvDlWWyS9zImCzvKQmPYh2/vK68+FjhIp7m3Lc0pfN X-Received: by 2002:a17:902:e80f:b0:1c4:152a:496c with SMTP id u15-20020a170902e80f00b001c4152a496cmr3817644plg.19.1696445899212; Wed, 04 Oct 2023 11:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445899; cv=none; d=google.com; s=arc-20160816; b=GaHmBSF+BvO2+HJf5Ra/m4SfDRMTGlezw+k4IwXRFJhr0+Tl5UtsOjDvj60Rhz8P06 Cr2Olu2qVRiOJUS0v2/e+xLbleur0ZKo5zJncPZiEsq+zKJYOFNt94Q66jkcvYYYGQkk f0Qx1l+jFwZJtgg4sO/4xfydeUwn8Yiq2oGZVtzx2pWHBClPcBIQk704rJ2iraF2TBL1 7o9au70lIEWyXgdP2U997MIvytTmeYi4fd2AH/jNcIRAQD/sLE8o6RxtR7DTb3OBwsqV rjngX2clJ/3mPBJ5h8IoGeGa2gCPgvPL4+L90P3GCAJunr++6523ClzQw709eS59DZkY kf5Q== 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:to:from :dkim-signature; bh=w9ShxkAFrQlKT3Ydsih3/SquFq3ZCwlb55D3Cims59I=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=ouV9zmDe0ORT09sY8A4r7TpcydK5BYkyrsFcayiXFAM7OYrmSfdP6T4RaDUqpxVAxb ky1GxZwx64AP/YiwHmCjPzytyS+3IyShrsMjvC8VxsZA9HcJGaaqgcxdcCQar+qb6eak pekvJUufdGIPfs9SoReoCTJnLFLk1pOkit4/m85ZgWDrghox4m4ZUsCYGBjaA4/N7HwA cgdegtxTlYJlmHsPkvXJf0z4bOt35m6w82yFGtHLYg89Z/zdzxYfYs1s5FA4rUY6Qoo9 nYHS3bFGEkGM96Zcz8PePgNVR1T6JbGv2J55SJc7005YEJPCFM8/JACvBslEli6WvEYg sBhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I0bV7/jt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id o11-20020a170903210b00b001b9736814b6si3787311ple.309.2023.10.04.11.58.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="I0bV7/jt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8DB1D83F4245; Wed, 4 Oct 2023 11:57:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244802AbjJDS5J (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244910AbjJDSzR (ORCPT ); Wed, 4 Oct 2023 14:55:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42D941B1; Wed, 4 Oct 2023 11:54:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2D32C433C7; Wed, 4 Oct 2023 18:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445684; bh=eBRJgq4pYENd3lA/W3dIxqsi+Z0ZXzS6MLhi4HYXHRk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=I0bV7/jtFNVwLNCrFGhCnbya4CmI3f4uLC41x/r0r7htllVHrzHDii16a6fY8/Sxs NBbaAvZa0q4m75QEoBA3HfKTItSJIP66n7OZZgGYeGfo98d0zgz6xr+dzRlYoh4Oqf n1JrVP0yOW85NU9c6twujKqcU/yYI8+KcxQhAYsjCZR3PEuDEhox9SEwI3JnZoGrRL TMZoZlBjQ8wnsB2WIjsjK1GxNYG9UYVcvpwpEvv1hF9YCLpvSYllzb/fiHYVJl14I9 ADtvyGCDRnOLWl0e1tuh5gHE8QrJBycr4Bf8jyFC4s5xd9kvqpIrIcZfAbWiI+3CSb +KvSNijR0BTPg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 49/89] kernfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:34 -0400 Message-ID: <20231004185347.80880-47-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852455265018305 X-GMAIL-MSGID: 1778852455265018305 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/kernfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index 922719a343a7..401c084300ed 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c @@ -151,7 +151,7 @@ ssize_t kernfs_iop_listxattr(struct dentry *dentry, char *buf, size_t size) static inline void set_default_inode_attr(struct inode *inode, umode_t mode) { inode->i_mode = mode; - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); } static inline void set_inode_attr(struct inode *inode, @@ -159,8 +159,8 @@ static inline void set_inode_attr(struct inode *inode, { inode->i_uid = attrs->ia_uid; inode->i_gid = attrs->ia_gid; - inode->i_atime = attrs->ia_atime; - inode->i_mtime = attrs->ia_mtime; + inode_set_atime_to_ts(inode, attrs->ia_atime); + inode_set_mtime_to_ts(inode, attrs->ia_mtime); inode_set_ctime_to_ts(inode, attrs->ia_ctime); } From patchwork Wed Oct 4 18:52: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: 148511 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340928vqb; Wed, 4 Oct 2023 11:58:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFmvK008VjbuceXmfRrwTbf60i+aCCctZQDCOgEN+zzY+SyHKR46Jl5MZN0Yqq5MUgKL4SX X-Received: by 2002:a9d:6a0a:0:b0:6c4:b0fa:12c2 with SMTP id g10-20020a9d6a0a000000b006c4b0fa12c2mr2846712otn.19.1696445901632; Wed, 04 Oct 2023 11:58:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445901; cv=none; d=google.com; s=arc-20160816; b=Mq8X4n9cLxpvW0hOIkOzMiikI9K9q5iLakjU36eKWPFmjlzwMpBTPZ6jtSegmKzDY2 sSlkP4vT2b/uTlA6jQf4sy6m3Ed7PitfpDLwZwzgIADBb0Rm7vXGS8P6GWL5PeDplABr 4bRsduuTJw0LDc//D12vKtByIw6FyxrZQTqRByygkW58kPV1UIVRwqCUjFTKN3GHw9SX BPJD6yrALvLPoE66T1XoP32FSauIDDd/IEaKL7S9r4+ex19UjHeg85iixFTybSwUA/vJ r3kc/dctkphfOej3+Qt7bPsLAORCGr9LhGSNh6XbYljopHe+7HnmqIr3f2fe4vPX1nKD aYIQ== 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:to:from :dkim-signature; bh=TuOvTA+1S3Eefi01hqmYviaQfart3iP2wrBD1QRsQmI=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=y+PIyapl5yGJjNRfYhIx/xEuASVo6jKgZGpa/tbKLOJrzvcc0hTQHGDGzZUiBXHfDF u24MyFKhmgtXafJdRhD1AW7xj7B174rX2qx6bdsT9gXiTqtqDubIAtuHaNrel5XCqE5a 5ZO0wvM2kC8dGTqSLTWqNJ9dQPZ8vOLrMzqDbd4zLCPAqZKIZtRtoIpY7BnOiR2pAbc8 QsnZRVveXKuyQzunljin6NkV202W365HKycE2uu5ngPYPiInRY4IAh2wpMBIizcgLDx8 LZgMoUWrd6a6WQPNhdQEE4F6MaQMqLjXmaZU4AD41pKiCJsfNx5PAxv4eN2AXiBTS+7n 4AEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hDpc2bRR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s69-20020a637748000000b00579ab302fd2si4230610pgc.814.2023.10.04.11.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hDpc2bRR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5FDCD83F5316; Wed, 4 Oct 2023 11:57:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244892AbjJDS5i (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244921AbjJDSzS (ORCPT ); Wed, 4 Oct 2023 14:55:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77B0BE4; Wed, 4 Oct 2023 11:54:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBA89C43391; Wed, 4 Oct 2023 18:54:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445685; bh=H9Lg9euMGZuxmMKeqAIzK2Cek3hrbdgrjDGHylOx0vA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=hDpc2bRReKUCHbe39dGQf3XZktLcVOaGC9VjQhy1EbJAphkT6ujmAva0TjOI2sjve CY8tFlErQqv8n7h+5HElp3jPjbymz7h28rnvMFrjeRyba6NFt9K7aZiZU31C0pTBKF 05Py0YNrYH0TtXJCJFzirogMPjSw3G3yogTqe1FHTHOZpXDSGQ1sEmYZdgw43f1Yen Ebzqcd45YiBuoXwAu/lNJV/aGmSThKfgpLiKpPzN9CNR7t5HHQB+GxNi4tqEabYjHF dpqAFZuSK4jxJ7vt8fvATBh/ugzRUrxGIsv4Bw2SATVmNBKmEKILxsqB88sbkSq0NW UyBpl0evE+yWg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 50/89] minix: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:35 -0400 Message-ID: <20231004185347.80880-48-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:57:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852457814950361 X-GMAIL-MSGID: 1778852457814950361 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/minix/bitmap.c | 2 +- fs/minix/dir.c | 6 +++--- fs/minix/inode.c | 17 ++++++++--------- fs/minix/itree_common.c | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c index 25c08fbfcb9d..7da66ca184f4 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_set_ctime_current(inode); + simple_inode_init_ts(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 20f23e6e58ad..62c313fc9a49 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); return minix_handle_dirsync(dir); } diff --git a/fs/minix/inode.c b/fs/minix/inode.c index df575473c1cc..f8af6c3ae336 100644 --- a/fs/minix/inode.c +++ b/fs/minix/inode.c @@ -501,7 +501,8 @@ 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 = inode->i_atime = inode_set_ctime(inode, raw_inode->i_time, 0); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime(inode, raw_inode->i_time, 0))); inode->i_blocks = 0; for (i = 0; i < 9; i++) minix_inode->u.i1_data[i] = raw_inode->i_zone[i]; @@ -538,11 +539,9 @@ static struct inode *V2_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 = raw_inode->i_mtime; - inode->i_atime.tv_sec = raw_inode->i_atime; + inode_set_mtime(inode, raw_inode->i_mtime, 0); + inode_set_atime(inode, raw_inode->i_atime, 0); inode_set_ctime(inode, raw_inode->i_ctime, 0); - inode->i_mtime.tv_nsec = 0; - inode->i_atime.tv_nsec = 0; inode->i_blocks = 0; for (i = 0; i < 10; i++) minix_inode->u.i2_data[i] = raw_inode->i_zone[i]; @@ -589,7 +588,7 @@ static struct buffer_head * V1_minix_update_inode(struct inode * inode) raw_inode->i_gid = fs_high2lowgid(i_gid_read(inode)); raw_inode->i_nlinks = inode->i_nlink; raw_inode->i_size = inode->i_size; - raw_inode->i_time = inode->i_mtime.tv_sec; + raw_inode->i_time = inode_get_mtime_sec(inode); 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 < 9; i++) @@ -616,9 +615,9 @@ static struct buffer_head * V2_minix_update_inode(struct inode * inode) raw_inode->i_gid = fs_high2lowgid(i_gid_read(inode)); raw_inode->i_nlinks = inode->i_nlink; 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_get_ctime(inode).tv_sec; + raw_inode->i_mtime = inode_get_mtime_sec(inode); + raw_inode->i_atime = inode_get_atime_sec(inode); + raw_inode->i_ctime = inode_get_ctime_sec(inode); 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 ce18ae37c29d..dad131e30c05 100644 --- a/fs/minix/itree_common.c +++ b/fs/minix/itree_common.c @@ -350,7 +350,7 @@ static inline void truncate (struct inode * inode) } first_whole++; } - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); } From patchwork Wed Oct 4 18:52: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: 148566 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355458vqb; Wed, 4 Oct 2023 12:23:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECY5gPQa19sUWxHMHv8d2ROF06LqClVALtZhZk/ogaRyM/qODmMkETaPFT7bNSNIddgsG0 X-Received: by 2002:a17:902:f688:b0:1c6:3228:c2ca with SMTP id l8-20020a170902f68800b001c63228c2camr4167353plg.29.1696447423403; Wed, 04 Oct 2023 12:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447423; cv=none; d=google.com; s=arc-20160816; b=RnuFFnpXXOLbGRlgsh9iP97Y0UQ1G6GlOzkOQpRcU3BnRTORLZJyXfwkC0JlFOc4Ac I7iQtoyczaRCXzbxMYUBKSgx8pp6jVLkftFa6kmu8KDwVbBnVhXHS2sqCRouWY8cuU3B V9Cj8FIF2UI232VTsXebz0qBiO65cfC/2I/JI9XM3prP8bptYMz4cbV6kMY4VwCu3Ipj gEq9c3gqsVfVL/frgRp/3a68HdcoOEk61B0UF9xFky29q9h6TWPUMHV8fuK1yfaeoN9I uzOxNO2Uwrq+3XrZKBjrvsHCpU2nbGeFo2x1BgmVaXbGmkU/P5CChKkSZSQg9SN3xOum bwNQ== 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=SaeUQ0CnLrH8d421Vhm8Iwq/cVAb5elzF5NbsdlVVgU=; fh=qCI+HJ8TstD4v8SgD5hrnhvawRZlJViQU3F/YAS3GuE=; b=kCqnaQKJIH6V5dBbaR6g+LNsXie4d+i0Dsh7C5tNdypQ+zgBKcL8qqlnqOHPSvM64E 7+HVxPqa6SgUHri1gEA8BXAD4z/CI3azpge+OOg/GoI+YyC1zdjq+1FitgfuwS3xit1a VU0XZQzhF7g8lLw3zPrAKQI6NbC9kKpc/bOmcfafC2rPei/feH/G3QRTwdZ5mZMoCFur X7njlTw3BWTWZVoOfkjsnrNSIUOeDfaQw1w5lTo6/2u5f9z/0y/NUvxuR5EahANFYydb 70Dh7/gMLMvZa7XxnhAH7tAKP2LUyI9Dtbo2TGdv/4Oysz9PEUOPZsUi6u+AkL+KI14B cnyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fdOKof/h"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id i1-20020a17090332c100b001b7f4696a2csi4527149plr.347.2023.10.04.12.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="fdOKof/h"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 86E0B8271771; Wed, 4 Oct 2023 12:23:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244869AbjJDS5n (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244925AbjJDSzS (ORCPT ); Wed, 4 Oct 2023 14:55:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BABE51711; Wed, 4 Oct 2023 11:54:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16428C433C8; Wed, 4 Oct 2023 18:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445686; bh=zFinb0jqT2nU3IpA2qqCTdAgq+MXSMvzuDI0JD/rfC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fdOKof/hta+WL7Le8kp6liOGDBUAUHO+PDB1a1m7UpyiyhJnb7I8BogRyE+N43si8 xmcRgGamJoXwFLXv1ksQ7P1B7GfpY+uSweV6RNRK5m2ybK37fnxmJVfBXqzYJhs5rb UWjN5x5ULx2nw8iPmjRaBzNqptv1xGf1N9nLekClo/lyOTHLfUV2YTfXA2v41qZYBe snQIx0RnyTh6KHJP78q//coD/F1gY6VDBGQ68RnNQULwLEoaLSGnnQC95dNo6PEamL kIgjg7l7/C2qp/RiS05aHGkBTH6wMAxZmydfAi4qZpt1qdPtdFuDE/ySjQ4g8ry0Zf doWzMYmCiqlGQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v2 51/89] nfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:36 -0400 Message-ID: <20231004185347.80880-49-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854053442915835 X-GMAIL-MSGID: 1778854053442915835 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/nfs/callback_proc.c | 2 +- fs/nfs/fscache.h | 4 ++-- fs/nfs/inode.c | 30 +++++++++++++++--------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 6bed1394d748..96a4923080ae 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -60,7 +60,7 @@ __be32 nfs4_callback_getattr(void *argp, void *resp, if (nfs_have_writebacks(inode)) res->change_attr++; res->ctime = inode_get_ctime(inode); - res->mtime = inode->i_mtime; + res->mtime = inode_get_mtime(inode); res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & args->bitmap[0]; res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index 2dc64454492b..5407ab8c8783 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h @@ -114,8 +114,8 @@ static inline void nfs_fscache_update_auxdata(struct nfs_fscache_inode_auxdata * struct inode *inode) { memset(auxdata, 0, sizeof(*auxdata)); - auxdata->mtime_sec = inode->i_mtime.tv_sec; - auxdata->mtime_nsec = inode->i_mtime.tv_nsec; + auxdata->mtime_sec = inode_get_mtime(inode).tv_sec; + auxdata->mtime_nsec = inode_get_mtime(inode).tv_nsec; auxdata->ctime_sec = inode_get_ctime(inode).tv_sec; auxdata->ctime_nsec = inode_get_ctime(inode).tv_nsec; diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index e21c073158e5..ebb8d60e1152 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -512,8 +512,8 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) } else init_special_inode(inode, inode->i_mode, fattr->rdev); - memset(&inode->i_atime, 0, sizeof(inode->i_atime)); - memset(&inode->i_mtime, 0, sizeof(inode->i_mtime)); + inode_set_atime(inode, 0, 0); + inode_set_mtime(inode, 0, 0); inode_set_ctime(inode, 0, 0); inode_set_iversion_raw(inode, 0); inode->i_size = 0; @@ -527,11 +527,11 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) nfsi->read_cache_jiffies = fattr->time_start; nfsi->attr_gencount = fattr->gencount; if (fattr->valid & NFS_ATTR_FATTR_ATIME) - inode->i_atime = fattr->atime; + inode_set_atime_to_ts(inode, fattr->atime); else if (fattr_supported & NFS_ATTR_FATTR_ATIME) nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); if (fattr->valid & NFS_ATTR_FATTR_MTIME) - inode->i_mtime = fattr->mtime; + inode_set_mtime_to_ts(inode, fattr->mtime); else if (fattr_supported & NFS_ATTR_FATTR_MTIME) nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); if (fattr->valid & NFS_ATTR_FATTR_CTIME) @@ -742,9 +742,9 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_ATIME | NFS_INO_INVALID_CTIME); if (fattr->valid & NFS_ATTR_FATTR_ATIME) - inode->i_atime = fattr->atime; + inode_set_atime_to_ts(inode, fattr->atime); else if (attr->ia_valid & ATTR_ATIME_SET) - inode->i_atime = attr->ia_atime; + inode_set_atime_to_ts(inode, attr->ia_atime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); @@ -758,9 +758,9 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_MTIME | NFS_INO_INVALID_CTIME); if (fattr->valid & NFS_ATTR_FATTR_MTIME) - inode->i_mtime = fattr->mtime; + inode_set_mtime_to_ts(inode, fattr->mtime); else if (attr->ia_valid & ATTR_MTIME_SET) - inode->i_mtime = attr->ia_mtime; + inode_set_mtime_to_ts(inode, attr->ia_mtime); else nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); @@ -1451,11 +1451,11 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) inode_set_ctime_to_ts(inode, fattr->ctime); } - ts = inode->i_mtime; + ts = inode_get_mtime(inode); if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME) && (fattr->valid & NFS_ATTR_FATTR_MTIME) && timespec64_equal(&ts, &fattr->pre_mtime)) { - inode->i_mtime = fattr->mtime; + inode_set_mtime_to_ts(inode, fattr->mtime); } if ((fattr->valid & NFS_ATTR_FATTR_PRESIZE) && (fattr->valid & NFS_ATTR_FATTR_SIZE) @@ -1506,7 +1506,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat if ((fattr->valid & NFS_ATTR_FATTR_CHANGE) != 0 && !inode_eq_iversion_raw(inode, fattr->change_attr)) invalid |= NFS_INO_INVALID_CHANGE; - ts = inode->i_mtime; + ts = inode_get_mtime(inode); if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec64_equal(&ts, &fattr->mtime)) invalid |= NFS_INO_INVALID_MTIME; @@ -1534,7 +1534,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink) invalid |= NFS_INO_INVALID_NLINK; - ts = inode->i_atime; + ts = inode_get_atime(inode); if ((fattr->valid & NFS_ATTR_FATTR_ATIME) && !timespec64_equal(&ts, &fattr->atime)) invalid |= NFS_INO_INVALID_ATIME; @@ -2002,7 +2002,7 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa } if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && (fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) { - fattr->pre_mtime = inode->i_mtime; + fattr->pre_mtime = inode_get_mtime(inode); fattr->valid |= NFS_ATTR_FATTR_PREMTIME; } if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 && @@ -2184,7 +2184,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) } if (fattr->valid & NFS_ATTR_FATTR_MTIME) - inode->i_mtime = fattr->mtime; + inode_set_mtime_to_ts(inode, fattr->mtime); else if (fattr_supported & NFS_ATTR_FATTR_MTIME) nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_MTIME; @@ -2220,7 +2220,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) save_cache_validity & NFS_INO_INVALID_SIZE; if (fattr->valid & NFS_ATTR_FATTR_ATIME) - inode->i_atime = fattr->atime; + inode_set_atime_to_ts(inode, fattr->atime); else if (fattr_supported & NFS_ATTR_FATTR_ATIME) nfsi->cache_validity |= save_cache_validity & NFS_INO_INVALID_ATIME; 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: 148515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp340980vqb; Wed, 4 Oct 2023 11:58:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLH79ECNBQURcrQTL8qRHWbiCLWJf05J/Vrqm2R037P5qDZPt6e24aPzrLip9r5r0B/8Cf X-Received: by 2002:a05:6a20:100c:b0:163:57ba:2ae3 with SMTP id gs12-20020a056a20100c00b0016357ba2ae3mr3100557pzc.53.1696445908154; Wed, 04 Oct 2023 11:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445908; cv=none; d=google.com; s=arc-20160816; b=YH3AHaJxawW9l33E8+XbWMKuU6t9hJBm7dvz1u5tDE3WbKx3XalDd6Kx0Fo9+JGuy5 9RWy74A2Pwmbn9LaUyf9MEtlwlOaWTnqZwE7T7UGGwQ2zlaiB7ri1YreHTKs3bBrWi/T HLb7ZqMZ8HZ2MmFEQFgUVJYXIDrNiX+hXH9W1zw+E3rTzwOxXR739RVSk8GsbUOKNCrr Hwe/50FYvYql3ZZrX5R36l2BEjjSjVbyAomf+Zj/mX1Bx0/Q3XhzmP8iI3U0pCm5vsdf k2quNdvveMJmVXSQpy31cIz8sTpig93cCyMeGYwOU9sn+97B5lqP4eJZyIhtLKdU3+j+ 3ZJg== 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=XJwpW6EsCHxsBmGUnsrUeqs/xBY4ZwqYgaQlT3oDnTY=; fh=5DM+f8QbZjQfJ9YZvXfjL+erGmfU1TzZ2/he2Dg+EUY=; b=ntCjPjWQ9W+3pPOtx3ta6T3ZbrQBs8l4Zl/dqLE3bP8r8oyFQmFX9gm5rMTj6CSyqM PpY1UmXnZpdLoLpK5Q06oIU87U6iHXjDzEmeqqOsrF2nCOrSzb3k/mW1uapM/skvVheE vKtRNa9Z/nSW8pmYVhVlZM9mPX5NjaMg7+BEync/hAODLhn5e+31I+fjhC8KJgtOIHuS gN67oGzeKPxjW3ntnx+MsX2DW9q/WItZeuxRFjzA6PlDquQ6IUiUN8yNWvJ/vc3TswnR CbSxz/KsbLk8pe6KyrReWgGHnWJKlxJWy3srzx/9zsGlAxnEa/kmg4vH8dHYloPX/YTN QDxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KJtutZg6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w6-20020a170902e88600b001c56ede4c97si4724228plg.239.2023.10.04.11.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KJtutZg6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0B2698083AF3; Wed, 4 Oct 2023 11:58:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244906AbjJDS5u (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244905AbjJDSza (ORCPT ); Wed, 4 Oct 2023 14:55:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F310FC; Wed, 4 Oct 2023 11:54:48 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73DB4C433CB; Wed, 4 Oct 2023 18:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445688; bh=pJnNsdencvKwZRbSlZ+blXLwAqnsIPx1YNtPzl1LJFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KJtutZg6tWNN340g/jXrAr3pX1klt2TNzrwNNaZGsYnQZ2/AdEb9lrows+NaO0Ljp 6BSgQvsxpy8XQaPXgF1rbbvZqWEwDh2qYf50j7GwKawcQjsV8erPMGtEYwxh3vfosw ncP9fAs06sjCz2F/bf+dY6Z1mqdt5zb5Dcmw5LcJqLfUtdm8GlMQs1wBzQRyCwPGrf yiofC9Er7trtM+j6CcRKV3ow7JcBofI3Wz8z0KqtPBjJe3r5SrsGWWmhke9oJzZ7qZ MlhtUs407eONSRPCDXndt//RA+GVh8wWZtRPJYfZqZ18NPqRm7CBrTnZViahx+yPeV 0j3QTsuS83mCA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org Subject: [PATCH v2 52/89] nfsd: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:37 -0400 Message-ID: <20231004185347.80880-50-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:17 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852464886198020 X-GMAIL-MSGID: 1778852464886198020 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/nfsd/blocklayout.c | 3 ++- fs/nfsd/nfs3proc.c | 4 ++-- fs/nfsd/nfs4proc.c | 8 ++++---- fs/nfsd/nfsctl.c | 2 +- fs/nfsd/vfs.c | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 01d7fd108cf3..46fd74d91ea9 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -117,12 +117,13 @@ static __be32 nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp, struct iomap *iomaps, int nr_iomaps) { + struct timespec64 mtime = inode_get_mtime(inode); loff_t new_size = lcp->lc_last_wr + 1; struct iattr iattr = { .ia_valid = 0 }; int error; if (lcp->lc_mtime.tv_nsec == UTIME_NOW || - timespec64_compare(&lcp->lc_mtime, &inode->i_mtime) < 0) + timespec64_compare(&lcp->lc_mtime, &mtime) < 0) lcp->lc_mtime = current_time(inode); iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime; diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c index 9571141701ff..b78eceebd945 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c @@ -295,8 +295,8 @@ nfsd3_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp, status = nfserr_exist; break; case NFS3_CREATE_EXCLUSIVE: - if (d_inode(child)->i_mtime.tv_sec == v_mtime && - d_inode(child)->i_atime.tv_sec == v_atime && + if (inode_get_mtime_sec(d_inode(child)) == v_mtime && + inode_get_atime_sec(d_inode(child)) == v_atime && d_inode(child)->i_size == 0) { break; } diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 60262fd27b15..2863ca530677 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -322,8 +322,8 @@ nfsd4_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp, status = nfserr_exist; break; case NFS4_CREATE_EXCLUSIVE: - if (d_inode(child)->i_mtime.tv_sec == v_mtime && - d_inode(child)->i_atime.tv_sec == v_atime && + if (inode_get_mtime_sec(d_inode(child)) == v_mtime && + inode_get_atime_sec(d_inode(child)) == v_atime && d_inode(child)->i_size == 0) { open->op_created = true; break; /* subtle */ @@ -331,8 +331,8 @@ nfsd4_create_file(struct svc_rqst *rqstp, struct svc_fh *fhp, status = nfserr_exist; break; case NFS4_CREATE_EXCLUSIVE4_1: - if (d_inode(child)->i_mtime.tv_sec == v_mtime && - d_inode(child)->i_atime.tv_sec == v_atime && + if (inode_get_mtime_sec(d_inode(child)) == v_mtime && + inode_get_atime_sec(d_inode(child)) == v_atime && d_inode(child)->i_size == 0) { open->op_created = true; goto set_attr; /* subtle */ diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index b71744e355a8..2509b95d33d3 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1133,7 +1133,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_set_ctime_current(inode); + simple_inode_init_ts(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 5bf3cffde831..9483c72ffbbd 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -538,7 +538,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, nfsd_sanitize_attrs(inode, iap); - if (check_guard && guardtime != inode_get_ctime(inode).tv_sec) + if (check_guard && guardtime != inode_get_ctime_sec(inode)) return nfserr_notsync; /* 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: 148516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341005vqb; Wed, 4 Oct 2023 11:58:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJTLdXmU/mndx7GV/11PqyJO7TGdusavcFpKRFD5Id/2BW4CR1hO1SnNpQnD5A3eyX4Vwv X-Received: by 2002:a05:6e02:1d03:b0:351:5d30:4777 with SMTP id i3-20020a056e021d0300b003515d304777mr3829314ila.28.1696445910706; Wed, 04 Oct 2023 11:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445910; cv=none; d=google.com; s=arc-20160816; b=m7YL95dobsQxWHLbhfNqMDImyaDCTvB1k5UC/DBpKyK4ScofLptRDnP0gbb19NBjNX 9NgsXGlS1b9PmMc/ybVp4Y29XKNCQG3Z3406Fq+PFdcojodrZEj6WVc1pFZb8yGJiSpc WLHnWYtwRf/PX8LXnPOgnz7iraig0g16EZArcGMX6K8tRoQ59IPP6rCNY6Y7RfIBta5M L8IWi05stgQSL1gtoZlgNz5hboG0fOuY9+ptleZayopt3UdJg6K1La6DAQ4yfpGBj72Q wFhdeOpiyuLWNwCZLOhAdXTONB87RdRCUovzzKAQFmBrI6Rst/TowD64u4nIE+mwszcV laAw== 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=gzT9dpuBqD6fvGO0uDZE3aqHl8bUWPuK2VosfIrQJpk=; fh=8qCKqn6BYkGuQTCNhe8+upUWuYLHCe1OqceJ45ksEvw=; b=mH9J+L+Y9yfDPzyVTPKAM8P/hsNO6Ja2c0X9f7Xm3H6KM6A8CGzeV0ReyXVWZAZI+c 8OMzeb5tatmLhWwsMLOusEjr1T4fx+tDG1WQT1wo1jdVEQ1b4q9rMxFmcGofqRzhsdN5 GWCjNAlzJ1HBdqzuWgP21waTQSfU+BAgCICuSOTRzllNyp9XLZQBK40EFUcNOkLuD24p uqxe2Vrh2UvWALmI4mi/NJFPparnivVG/J5PUSYx0c7xzh9vtVRHOOrenmtbjrAyJrSp op6xB2muOpjEQZp3bx4f0+UX07bbxyT20eRmqjsigBUuaHDRXi6l0Hw9MOx4knUOLiT3 I46Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bL7wuzDQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id q26-20020a631f5a000000b00565e39e7b80si4215583pgm.678.2023.10.04.11.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bL7wuzDQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B2E0783F4265; Wed, 4 Oct 2023 11:58:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245024AbjJDS5y (ORCPT + 19 others); Wed, 4 Oct 2023 14:57:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244953AbjJDSzb (ORCPT ); Wed, 4 Oct 2023 14:55:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED7F0171F; Wed, 4 Oct 2023 11:54:49 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D99C433CA; Wed, 4 Oct 2023 18:54:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445689; bh=BzmHHAJz6lYHHZHZoa6zewaRspqSDICvIyQA0NDXkSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bL7wuzDQWPALt/93IkyyQc+LFc/NemtrEXf/xfciiaEjZ3f6RElycysodrnL8RyrI m6jPMzcT+lZ2Aj/nEfVAMOZR7o0GqN+Q4jjW9/K/1JGhxqQVlrpHSeKr6jPPEDndvw ci/icWTpE8PwBpkb88gfDoa8kASYMwsP11NUavrmZDZJUFuLTtLSIBVY8xmKbJDgDj R9DhK/i5qP5rBJBQwkaeXPe17CPwu2GkEq8FkOsnuwdD5/1zpAvnLt1w/SChqbLR8k UUmuAYbZuC1O4XoFvjHjBcC2ZLboqCHepAJCWNLthmuFOYC8PuFfjclO27zDUyPVZV JN7VV2G01Vwug== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-nilfs@vger.kernel.org Subject: [PATCH v2 53/89] nilfs2: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:38 -0400 Message-ID: <20231004185347.80880-51-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852467318315287 X-GMAIL-MSGID: 1778852467318315287 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c index bce734b68f08..de2073c47651 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); out: nilfs_put_page(page); return err; diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 1a8bd5993476..f861f3a0bf5c 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_set_ctime_current(inode); + simple_inode_init_ts(inode); if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) { err = nilfs_bmap_read(ii->i_bmap, NULL); @@ -449,12 +449,12 @@ int nilfs_read_inode_common(struct inode *inode, i_gid_write(inode, le32_to_cpu(raw_inode->i_gid)); 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_set_atime(inode, le64_to_cpu(raw_inode->i_mtime), + le32_to_cpu(raw_inode->i_mtime_nsec)); inode_set_ctime(inode, le64_to_cpu(raw_inode->i_ctime), le32_to_cpu(raw_inode->i_ctime_nsec)); - 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_mtime.tv_nsec = le32_to_cpu(raw_inode->i_mtime_nsec); + inode_set_mtime(inode, le64_to_cpu(raw_inode->i_mtime), + 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 */ if (inode->i_nlink == 0) @@ -768,10 +768,10 @@ 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_get_ctime(inode).tv_sec); - raw_inode->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); - raw_inode->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); - raw_inode->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); + raw_inode->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + raw_inode->i_mtime = cpu_to_le64(inode_get_mtime_sec(inode)); + raw_inode->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); + raw_inode->i_mtime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); raw_inode->i_blocks = cpu_to_le64(inode->i_blocks); raw_inode->i_flags = cpu_to_le32(ii->i_flags); @@ -875,7 +875,7 @@ void nilfs_truncate(struct inode *inode) nilfs_truncate_bmap(ii, blkoff); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (IS_SYNC(inode)) nilfs_set_transaction_flag(NILFS_TI_SYNC); From patchwork Wed Oct 4 18:52: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: 148517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341018vqb; Wed, 4 Oct 2023 11:58:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFslEoGWmxAkhcsTQXRDjc1AVBMOf95gHVHrr8hRXTn+Ljxdzzii/9P1dS6DgbYKNodSCqy X-Received: by 2002:a05:6a20:2447:b0:154:3f13:1bb7 with SMTP id t7-20020a056a20244700b001543f131bb7mr2990747pzc.49.1696445912018; Wed, 04 Oct 2023 11:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445912; cv=none; d=google.com; s=arc-20160816; b=YmUcBzfPnVrMzUSCZa9c8vl1efPlBICjINLQdxXxIdahYWMfpMqvHKJ8PMCzCntW6W h9WppJUn9pnuy/D1cREo2ivDYCK4ywua0Jrh91hPQevnk8EkmfNVazKO+O6S9A0oOBPc kgRyhQ9YbtcXfHbeU4/UQ1anmMtVgu1RFg5xdRcFr0avUickhIf+9Q2dXWQArSKZJjsi aeaJQP+S1TEMJUiyONxhK3gM5CovI2eH1yttCZlOmEafjZymjSMa/29m3U/UCR0vhjz/ xnB9aE5LugPS4Aky0sbOH59XSdIKRTS9BvIP41w4WUyQCZIxZkCV2mRdpYqU+OARRH4v WHhQ== 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=RTEnheyFv9iDuEkvqBYnekqg0aEWjvVLUA/Jo1FQ4YI=; fh=/ddc8nBougnx9J9Jk+aiWj+G5DT4bYxfFV1UnmdJ16E=; b=GQy3iYOtO5tk5SeJ4uWTDk03Pjl/QBmdR+H5xpKKQOKDLR/M8rGBUbFunARxVOXx7P jQZjilgGQWj9ZtAmNXQRMt7fHDMcTzkB+hu5FeCuxBLjGSd1aFJ4IpAJ6a6mPxlk6Dpk Rx1sFa+EazMNax2Eh32pm0xdl8CcBWI4DAn+pb6zjNc+e6aRjBax4mPMnHv1ZrbmxGYi C3DdUVnS4YGrhWQSua5PO+Z31Zb6sSOhjQVY6kIrOH+Z/tTpvtbVpfFYg7oSrRRX6u8z Xcz+NPbvCoFRMrMzcsy1WtAU5kT9SwL2ENtsxMH112CI0jy2CgF+q3L4dlXtY8zQPyu8 HnSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=INItqUqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id bq25-20020a056a000e1900b00690f9e835d8si4203072pfb.132.2023.10.04.11.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=INItqUqa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C1F1C83EE9EA; Wed, 4 Oct 2023 11:58:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245039AbjJDS6C (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244856AbjJDSzd (ORCPT ); Wed, 4 Oct 2023 14:55:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C5F91725; Wed, 4 Oct 2023 11:54:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D90DC433CC; Wed, 4 Oct 2023 18:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445690; bh=vmHegbrB1oSokmePb7JoVPLdiAExigQLg7wn3ynfsJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=INItqUqaI27NvvvE5+f2tZOATG7etmaMQ+tvY1oJvHuuW4o8Y2c87saqn55UH9C6A l59gMO03/odl8au7XqZQiOVHe+bDbIn+ysKo01RdRJCpfFdoxXMr2SdUUramm+2B5j JyYL5mEpRvzVvSP8Qp2ViY3eozbrGuEvkbSBiKP8oQRRLXX2V7RubNokI/9gZ0GvpJ ES7lzuheQGCSyr73HqNRYcFJrpW00+J+RTlHzy9rQSsWGmmlXpPZIlclvIL3aOOMxR s0tSNH7enRmElEjPevyv4/bLnPvO2QWgNQ8domQBbkelfvDma3qkGiWUzWnojgJjeH RAx1HYi9WE9Yw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Namjae Jeon , linux-ntfs-dev@lists.sourceforge.net Subject: [PATCH v2 54/89] ntfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:39 -0400 Message-ID: <20231004185347.80880-52-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852468366551847 X-GMAIL-MSGID: 1778852468366551847 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ntfs/inode.c | 25 +++++++++++++------------ fs/ntfs/mft.c | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 99ac6ea277c4..aba1e22db4e9 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c @@ -648,7 +648,7 @@ static int ntfs_read_locked_inode(struct inode *vi) * mtime is the last change of the data within the file. Not changed * when only metadata is changed, e.g. a rename doesn't affect mtime. */ - vi->i_mtime = ntfs2utc(si->last_data_change_time); + inode_set_mtime_to_ts(vi, ntfs2utc(si->last_data_change_time)); /* * ctime is the last change of the metadata of the file. This obviously * always changes, when mtime is changed. ctime can be changed on its @@ -659,7 +659,7 @@ static int ntfs_read_locked_inode(struct inode *vi) * Last access to the data within the file. Not changed during a rename * for example but changed whenever the file is written to. */ - vi->i_atime = ntfs2utc(si->last_access_time); + inode_set_atime_to_ts(vi, ntfs2utc(si->last_access_time)); /* Find the attribute list attribute if present. */ ntfs_attr_reinit_search_ctx(ctx); @@ -1217,9 +1217,9 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi) vi->i_uid = base_vi->i_uid; vi->i_gid = base_vi->i_gid; set_nlink(vi, base_vi->i_nlink); - vi->i_mtime = base_vi->i_mtime; + inode_set_mtime_to_ts(vi, inode_get_mtime(base_vi)); inode_set_ctime_to_ts(vi, inode_get_ctime(base_vi)); - vi->i_atime = base_vi->i_atime; + inode_set_atime_to_ts(vi, inode_get_atime(base_vi)); vi->i_generation = ni->seq_no = base_ni->seq_no; /* Set inode type to zero but preserve permissions. */ @@ -1483,9 +1483,9 @@ static int ntfs_read_locked_index_inode(struct inode *base_vi, struct inode *vi) vi->i_uid = base_vi->i_uid; vi->i_gid = base_vi->i_gid; set_nlink(vi, base_vi->i_nlink); - vi->i_mtime = base_vi->i_mtime; + inode_set_mtime_to_ts(vi, inode_get_mtime(base_vi)); inode_set_ctime_to_ts(vi, inode_get_ctime(base_vi)); - vi->i_atime = base_vi->i_atime; + inode_set_atime_to_ts(vi, inode_get_atime(base_vi)); vi->i_generation = ni->seq_no = base_ni->seq_no; /* Set inode type to zero but preserve permissions. */ vi->i_mode = base_vi->i_mode & ~S_IFMT; @@ -2805,13 +2805,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_get_ctime(VFS_I(base_ni)); + struct timespec64 mtime = inode_get_mtime(VFS_I(base_ni)); int sync_it = 0; - if (!timespec64_equal(&VFS_I(base_ni)->i_mtime, &now) || + if (!timespec64_equal(&mtime, &now) || !timespec64_equal(&ctime, &now)) sync_it = 1; inode_set_ctime_to_ts(VFS_I(base_ni), now); - VFS_I(base_ni)->i_mtime = now; + inode_set_mtime_to_ts(VFS_I(base_ni), now); if (sync_it) mark_inode_dirty_sync(VFS_I(base_ni)); @@ -2925,9 +2926,9 @@ int ntfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, } } if (ia_valid & ATTR_ATIME) - vi->i_atime = attr->ia_atime; + inode_set_atime_to_ts(vi, attr->ia_atime); if (ia_valid & ATTR_MTIME) - vi->i_mtime = attr->ia_mtime; + inode_set_mtime_to_ts(vi, attr->ia_mtime); if (ia_valid & ATTR_CTIME) inode_set_ctime_to_ts(vi, attr->ia_ctime); mark_inode_dirty(vi); @@ -2996,7 +2997,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) si = (STANDARD_INFORMATION*)((u8*)ctx->attr + le16_to_cpu(ctx->attr->data.resident.value_offset)); /* Update the access times if they have changed. */ - nt = utc2ntfs(vi->i_mtime); + nt = utc2ntfs(inode_get_mtime(vi)); if (si->last_data_change_time != nt) { ntfs_debug("Updating mtime for inode 0x%lx: old = 0x%llx, " "new = 0x%llx", vi->i_ino, (long long) @@ -3014,7 +3015,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) si->last_mft_change_time = nt; modified = true; } - nt = utc2ntfs(vi->i_atime); + nt = utc2ntfs(inode_get_atime(vi)); if (si->last_access_time != nt) { ntfs_debug("Updating atime for inode 0x%lx: old = 0x%llx, " "new = 0x%llx", vi->i_ino, diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index ad1a8f72da22..6fd1dc4b08c8 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -2682,7 +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 = inode_set_ctime_current(vi); + simple_inode_init_ts(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 Oct 4 18:52: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: 148520 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341045vqb; Wed, 4 Oct 2023 11:58:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVvl7GmtvXbJaZlpf2LTtwF4Arj07gDzVrzFC9hzQ8e9sXVAb94hav6U4MHQFkOFvSu9yK X-Received: by 2002:a05:6358:988d:b0:13c:a9c9:c04a with SMTP id q13-20020a056358988d00b0013ca9c9c04amr3501883rwa.20.1696445915658; Wed, 04 Oct 2023 11:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445915; cv=none; d=google.com; s=arc-20160816; b=wvCthUm6SlEM5++ZJvNG/M1SmM4ADaH0lDqg/AOw5byI3CX78eHD2wVWrgzShnqMtk Cykyeujb3H8AxUG06B6ESgj29Z5lOdBPbpE76/IQRmT6NixuGJakuA4suJll4/jBLMKd kj1XbAvLcfnYUzGTweVrs9aB051WHeVXYvkS9mbQbiZRa73RS1SfYcgSyrM25h4es/7N O4HuPrj8oR2tkiNOanFn5KFaoi3CCOW2CWZ++w0JAaqne5AzVtTg89dRgQx3NdzGa+f0 o7QCcfwtgdxaDdzhYiZvXdeg31ZTgp6m2Z15fCxkYyDUQnk77ko+J804BJOTiRpBHB4p GTFw== 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=h/c7tsELezOwvZUwY+JhLyZsNTRxRPio7C5m3QKtq/8=; fh=yUK3CqCU6lAVbXF9XT5sjbVfFmo5kh4eCUTV5vy97+I=; b=DMERXsfzZFCj+5Uokp6MufvhXlcPY5WIIJRHqxmuJdD7fJO/lHtVdYWyX5igAEzKie iJAS0YzSIqUdE9fvCzHEYlDQX5d3slE3xIlxBxHUXcylw20SmwoI4/ja+6Z9swjdLBtC 88iWqMcMsR5mFXjtqaDsxZaFoPYb91cRvchG7U3CyzakBhWIvEa184vzz2nN3GhopDKy 2K+/60ZaD4u6cohZb9Ok6o3wX07XktrFAds9dWrMHvIHYHD7tIr8X1hcoxg1fQb6Chrz yiJ6e2wEqCSY+sJEhiGTKLa6/Blo1D09ZZOYekUpAOurS+jskfcavYcko8eKBr8TZBbo 0Hlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Et7cLkKB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cu11-20020a056a00448b00b0068bf4e83dd8si4023588pfb.313.2023.10.04.11.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Et7cLkKB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3143A83F5315; Wed, 4 Oct 2023 11:58:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245147AbjJDS6N (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244868AbjJDSze (ORCPT ); Wed, 4 Oct 2023 14:55:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABDFC11C; Wed, 4 Oct 2023 11:54:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87ACDC433C7; Wed, 4 Oct 2023 18:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445692; bh=Mlu83hY0TA0SLWkTa1E2exWbT45LagfXuubQHrGjCyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Et7cLkKBjBGX5glVGBenmgupLEcBZ+Q1K0VDSOEsB8bG+xPxOCiGpeNwhgArqtX1+ cFS5mLxR7pCEhakR+u4udX35gIKJCPwcfGXJUcF6p19xNA3Ad1grlFgs3yf+8rNHvc y16B/B8sZRfFWZh+i97JB99XvihBtDRUBVQoXnjqToWgD/XqRHFQFQw/sZJadkvoyj Hdb6j1Otw51cITIueiiICqhg8EKlsQ0X93u/TuQNsVkBrY++bce9Ff79fhXo42bi6A JIIAx9GWV0lDmVoHTZsFHNj1eUuKfQQOK4q9zq911tTmcPcEY3ocvIE1vSRmiv+qCI 7TV+A1zO8POEg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ntfs3@lists.linux.dev Subject: [PATCH v2 55/89] ntfs3: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:40 -0400 Message-ID: <20231004185347.80880-53-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852471964871390 X-GMAIL-MSGID: 1778852471964871390 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ntfs3/file.c | 6 +++--- fs/ntfs3/frecord.c | 11 +++++++---- fs/ntfs3/inode.c | 25 +++++++++++++++---------- fs/ntfs3/namei.c | 4 ++-- 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 1f7a194983c5..ad4a70b5d432 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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); } diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c index dad976a68985..3df2d9e34b91 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -3271,7 +3271,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) { bool modified = false; - struct timespec64 ctime = inode_get_ctime(inode); + struct timespec64 ts; /* Update times in standard attribute. */ std = ni_std(ni); @@ -3281,19 +3281,22 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint) } /* Update the access times if they have changed. */ - dup.m_time = kernel2nt(&inode->i_mtime); + ts = inode_get_mtime(inode); + dup.m_time = kernel2nt(&ts); if (std->m_time != dup.m_time) { std->m_time = dup.m_time; modified = true; } - dup.c_time = kernel2nt(&ctime); + ts = inode_get_mtime(inode); + dup.c_time = kernel2nt(&ts); if (std->c_time != dup.c_time) { std->c_time = dup.c_time; modified = true; } - dup.a_time = kernel2nt(&inode->i_atime); + ts = inode_get_atime(inode); + dup.a_time = kernel2nt(&ts); if (std->a_time != dup.a_time) { std->a_time = dup.a_time; modified = true; diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index d6d021e19aaa..5e3d71374918 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -44,7 +44,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, u64 t64; struct MFT_REC *rec; struct runs_tree *run; - struct timespec64 ctime; + struct timespec64 ts; inode->i_op = NULL; /* Setup 'uid' and 'gid' */ @@ -169,10 +169,12 @@ static struct inode *ntfs_read_mft(struct inode *inode, #ifdef STATX_BTIME nt2kernel(std5->cr_time, &ni->i_crtime); #endif - nt2kernel(std5->a_time, &inode->i_atime); - nt2kernel(std5->c_time, &ctime); - inode_set_ctime_to_ts(inode, ctime); - nt2kernel(std5->m_time, &inode->i_mtime); + nt2kernel(std5->a_time, &ts); + inode_set_atime_to_ts(inode, ts); + nt2kernel(std5->c_time, &ts); + inode_set_ctime_to_ts(inode, ts); + nt2kernel(std5->m_time, &ts); + inode_set_mtime_to_ts(inode, ts); ni->std_fa = std5->fa; @@ -960,7 +962,8 @@ 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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); ni->std_fa |= FILE_ATTRIBUTE_ARCHIVE; dirty = true; } @@ -1660,9 +1663,11 @@ 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_set_ctime_to_ts(inode, ni->i_crtime); - dir->i_mtime = inode_set_ctime_to_ts(dir, ni->i_crtime); + inode_set_atime_to_ts(inode, ni->i_crtime); + inode_set_ctime_to_ts(inode, ni->i_crtime); + inode_set_mtime_to_ts(inode, ni->i_crtime); + inode_set_mtime_to_ts(dir, ni->i_crtime); + inode_set_ctime_to_ts(dir, ni->i_crtime); mark_inode_dirty(dir); mark_inode_dirty(inode); @@ -1768,7 +1773,7 @@ int ntfs_unlink_inode(struct inode *dir, const struct dentry *dentry) if (!err) { drop_nlink(inode); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); inode_set_ctime_to_ts(inode, inode_get_ctime(dir)); if (inode->i_nlink) diff --git a/fs/ntfs3/namei.c b/fs/ntfs3/namei.c index eedacf94edd8..ee3093be5170 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_mtime = inode_set_ctime_to_ts( - inode, inode_set_ctime_current(dir)); + inode_set_ctime_current(inode); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(inode); mark_inode_dirty(dir); d_instantiate(de, inode); From patchwork Wed Oct 4 18:52: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: 148518 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341030vqb; Wed, 4 Oct 2023 11:58:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFX6HQjJx/hccqZfoOLb/tvq5r6AENfUWe2SAupwFncXiKukuRmsUit2kqXVUH7kLTWVBLp X-Received: by 2002:a05:6a20:7348:b0:15f:faab:1be1 with SMTP id v8-20020a056a20734800b0015ffaab1be1mr3674036pzc.20.1696445913250; Wed, 04 Oct 2023 11:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445913; cv=none; d=google.com; s=arc-20160816; b=qwWo3Tm/YjVBvUwwi2Us4QlXbLzVKeD2yGijy0eZ2VuT8ycxzVCiKiSiyDVXjm2pY9 LmAykJjpxpAbz6fbTZKbLGugHfVJPcEs7OF7gX7qSmXgdYHSFWEzXDmHQdGoeCmcVpVy gb4av7OIo6LH6xv8kd0DsXnEvw/wdxwcGg0eJumXIx1wgIpaW7c+XPdyYmaaDd5pf4J6 TnfPPAVe9Q+Zo2/tPPISCFk1W1k/e2OTG110DrKqMjamAO18TRQ9aevNInGEnLdxw1Lp hVfWVYLPHobXHPO2xqg4XbdGjNl2xZRDCNv8vmBz0jbVHfUjkojCWtoVUO1IjZxZ4kJ1 dIew== 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=H57+h8PdQaTJb1Sz3DAokcXyCgYgyCgJgMRnGm9vPwg=; fh=tNLxgbuCF+p4xqiFm9ldKyAq8PJ5v7qcez6IpY/yvZo=; b=i0cCJdeGerO8jyNN/5olSM2Y0ryJXbCuprC3pR0L64J8XNjhRYVINLJp7eNKiDu6KB 8qtIBXoALYOAGTHuga1LfiHql/8mtnnMHgFaB7rLa6uB9r8bp9D+dszmu2E1OSQyx+I5 WJtIiGFKheecLPLCvvPx8IJbXJlX9WcuOwMcOLDBh6lCVOeIWFsBw3jPTGF0XZaSXZUw odGUVRjIXFTY7Lyc7r+JsXX0cfIKnssr6t7/IynwTK0hzvmW2p70oTGLp4194RODr2tb n5IuUfyCLP2uTuYN1uAU1x57RkjRxPztKwY4sP3NryOV08V5hn9C6yzSwP9WHqoo05Q0 /FbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tee27N02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y15-20020a056a00190f00b00690258a9766si4382108pfi.373.2023.10.04.11.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tee27N02; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id CF1C180B6324; Wed, 4 Oct 2023 11:58:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245098AbjJDS6F (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244991AbjJDSzh (ORCPT ); Wed, 4 Oct 2023 14:55:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494C9172C; Wed, 4 Oct 2023 11:54:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94D37C433CA; Wed, 4 Oct 2023 18:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445694; bh=tzetkEKdm7IhSKsA2rn3H4KPcSAaAcpqZ78Nh4oT9GI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tee27N02atghsw3fl3N/yIOkEo59Me7aFIoEvVgEa0Baziwx7DhakH6ZTRGomc7v0 +9udEanKTynMa5fdBCzoMZzsrswexM+oYMgKfnVQ8w6Mg2boJj/KET+LAni6NVdZrP c8W+lNXixmz0SsC+JobegiWsNzbcl0Rp4r2BCeurdbopZsLqfpd7LYnQsdIsZrKVWy y3SqkjJ1F7eMK+OkPHC+nsREOrwMzWpMa6ouedfNisjWZqBupYW/gKFpKl5J8tWbzL 6iQNbOrIhSFxKzmVy2o4bp7MBYTDX5VX31t4X1+tZBk8f6hfCSjBOQk7yPv+z2Zohl GS/x0ufODn9WA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: ocfs2-devel@lists.linux.dev Subject: [PATCH v2 56/89] ocfs2: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:41 -0400 Message-ID: <20231004185347.80880-54-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852469981309959 X-GMAIL-MSGID: 1778852469981309959 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ocfs2/acl.c | 4 ++-- fs/ocfs2/alloc.c | 6 +++--- fs/ocfs2/aops.c | 6 +++--- fs/ocfs2/dir.c | 9 +++++---- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/dlmglue.c | 29 ++++++++++++++--------------- fs/ocfs2/file.c | 30 ++++++++++++++++-------------- fs/ocfs2/inode.c | 28 ++++++++++++++-------------- fs/ocfs2/move_extents.c | 4 ++-- fs/ocfs2/namei.c | 16 ++++++++-------- fs/ocfs2/refcounttree.c | 12 ++++++------ fs/ocfs2/xattr.c | 4 ++-- 12 files changed, 77 insertions(+), 75 deletions(-) diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index e75137a8e7cb..62464d194da3 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c @@ -193,8 +193,8 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, inode->i_mode = new_mode; inode_set_ctime_current(inode); di->i_mode = cpu_to_le16(inode->i_mode); - di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); 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 0fb5e3a875d2..ebcce4bd50b6 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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); - di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(inode).tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime_sec(inode)); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); 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 0fdba30740ab..6ab03494fc6e 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -2048,9 +2048,9 @@ 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_set_ctime_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); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); + di->i_mtime = di->i_ctime = cpu_to_le64(inode_get_mtime_sec(inode)); + di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); if (handle) ocfs2_update_inode_fsync_trans(handle, inode, 1); } diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8b123d543e6e..a14c8fee6ee5 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -1658,7 +1658,8 @@ 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, + inode_set_ctime_current(dir)); retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); if (retval < 0) { mlog_errno(retval); @@ -2962,11 +2963,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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); di->i_size = cpu_to_le64(sb->s_blocksize); - di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(dir).tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(dir).tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime_sec(dir)); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime_nsec(dir)); ocfs2_update_inode_fsync_trans(handle, dir, 1); /* diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index b38776ba3306..85215162c9dd 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -336,7 +336,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inc_nlink(inode); inode->i_fop = &simple_dir_operations; @@ -359,7 +359,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_set_ctime_current(inode); + simple_inode_init_ts(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 c3e2961ee5db..64a6ef638495 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2162,7 +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 = inode_get_ctime(inode); + struct timespec64 ts; lvb = ocfs2_dlm_lvb(&lockres->l_lksb); @@ -2183,12 +2183,12 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); lvb->lvb_imode = cpu_to_be16(inode->i_mode); 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(&ctime)); - lvb->lvb_imtime_packed = - cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); + ts = inode_get_atime(inode); + lvb->lvb_iatime_packed = cpu_to_be64(ocfs2_pack_timespec(&ts)); + ts = inode_get_ctime(inode); + lvb->lvb_ictime_packed = cpu_to_be64(ocfs2_pack_timespec(&ts)); + ts = inode_get_mtime(inode); + lvb->lvb_imtime_packed = cpu_to_be64(ocfs2_pack_timespec(&ts)); lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); @@ -2209,7 +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; + struct timespec64 ts; mlog_meta_lvb(0, lockres); @@ -2236,13 +2236,12 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); inode->i_mode = be16_to_cpu(lvb->lvb_imode); set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); - ocfs2_unpack_timespec(&inode->i_atime, - be64_to_cpu(lvb->lvb_iatime_packed)); - ocfs2_unpack_timespec(&inode->i_mtime, - be64_to_cpu(lvb->lvb_imtime_packed)); - ocfs2_unpack_timespec(&ctime, - be64_to_cpu(lvb->lvb_ictime_packed)); - inode_set_ctime_to_ts(inode, ctime); + ocfs2_unpack_timespec(&ts, be64_to_cpu(lvb->lvb_iatime_packed)); + inode_set_atime_to_ts(inode, ts); + ocfs2_unpack_timespec(&ts, be64_to_cpu(lvb->lvb_imtime_packed)); + inode_set_mtime_to_ts(inode, ts); + ocfs2_unpack_timespec(&ts, be64_to_cpu(lvb->lvb_ictime_packed)); + inode_set_ctime_to_ts(inode, ts); spin_unlock(&oi->ip_lock); return 0; } diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index c45596c25c66..94e2a1244442 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -233,16 +233,18 @@ int ocfs2_should_update_atime(struct inode *inode, if (vfsmnt->mnt_flags & MNT_RELATIME) { struct timespec64 ctime = inode_get_ctime(inode); + struct timespec64 atime = inode_get_atime(inode); + struct timespec64 mtime = inode_get_mtime(inode); - if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) || - (timespec64_compare(&inode->i_atime, &ctime) <= 0)) + if ((timespec64_compare(&atime, &mtime) <= 0) || + (timespec64_compare(&atime, &ctime) <= 0)) return 1; return 0; } now = current_time(inode); - if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) + if ((now.tv_sec - inode_get_atime_sec(inode) <= osb->s_atime_quantum)) return 0; else return 1; @@ -275,9 +277,9 @@ int ocfs2_update_inode_atime(struct inode *inode, * have i_rwsem to guard against concurrent changes to other * inode fields. */ - inode->i_atime = current_time(inode); - di->i_atime = cpu_to_le64(inode->i_atime.tv_sec); - di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); + inode_set_atime_to_ts(inode, current_time(inode)); + di->i_atime = cpu_to_le64(inode_get_atime_sec(inode)); + di->i_atime_nsec = cpu_to_le32(inode_get_atime_nsec(inode)); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, bh); @@ -296,7 +298,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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); if (status < 0) { @@ -417,12 +419,12 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, } i_size_write(inode, new_i_size); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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_get_ctime(inode).tv_sec); - di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime_sec(inode)); + di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_journal_dirty(handle, fe_bh); @@ -821,9 +823,9 @@ 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_set_ctime_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); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); + di->i_mtime = di->i_ctime = cpu_to_le64(inode_get_mtime_sec(inode)); + di->i_ctime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); di->i_mtime_nsec = di->i_ctime_nsec; if (handle) { ocfs2_journal_dirty(handle, di_bh); @@ -2040,7 +2042,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, goto out_inode_unlock; } - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 e8771600b930..999111bfc271 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -302,10 +302,10 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_mapping->a_ops = &ocfs2_aops; } - inode->i_atime.tv_sec = le64_to_cpu(fe->i_atime); - 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_set_atime(inode, le64_to_cpu(fe->i_atime), + le32_to_cpu(fe->i_atime_nsec)); + inode_set_mtime(inode, le64_to_cpu(fe->i_mtime), + le32_to_cpu(fe->i_mtime_nsec)); inode_set_ctime(inode, le64_to_cpu(fe->i_ctime), le32_to_cpu(fe->i_ctime_nsec)); @@ -1312,12 +1312,12 @@ int ocfs2_mark_inode_dirty(handle_t *handle, fe->i_uid = cpu_to_le32(i_uid_read(inode)); fe->i_gid = cpu_to_le32(i_gid_read(inode)); 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_get_ctime(inode).tv_sec); - fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime(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); + fe->i_atime = cpu_to_le64(inode_get_atime_sec(inode)); + fe->i_atime_nsec = cpu_to_le32(inode_get_atime_nsec(inode)); + fe->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); + fe->i_mtime = cpu_to_le64(inode_get_mtime_sec(inode)); + fe->i_mtime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); ocfs2_journal_dirty(handle, bh); ocfs2_update_inode_fsync_trans(handle, inode, 1); @@ -1348,10 +1348,10 @@ void ocfs2_refresh_inode(struct inode *inode, inode->i_blocks = 0; else inode->i_blocks = ocfs2_inode_sector_count(inode); - inode->i_atime.tv_sec = le64_to_cpu(fe->i_atime); - 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_set_atime(inode, le64_to_cpu(fe->i_atime), + le32_to_cpu(fe->i_atime_nsec)); + inode_set_mtime(inode, le64_to_cpu(fe->i_mtime), + le32_to_cpu(fe->i_mtime_nsec)); inode_set_ctime(inode, le64_to_cpu(fe->i_ctime), le32_to_cpu(fe->i_ctime_nsec)); diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index 05d67968a3a9..1f9ed117e78b 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c @@ -951,8 +951,8 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) di = (struct ocfs2_dinode *)di_bh->b_data; inode_set_ctime_current(inode); - di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); 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 5cd6d7771cea..681e9501cdd3 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -795,8 +795,8 @@ static int ocfs2_link(struct dentry *old_dentry, inc_nlink(inode); inode_set_ctime_current(inode); ocfs2_set_links_count(fe, inode->i_nlink); - fe->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); - fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + fe->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); ocfs2_journal_dirty(handle, fe_bh); err = ocfs2_add_entry(handle, dentry, inode, @@ -995,7 +995,7 @@ static int ocfs2_unlink(struct inode *dir, ocfs2_set_links_count(fe, inode->i_nlink); ocfs2_journal_dirty(handle, fe_bh); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); if (S_ISDIR(inode->i_mode)) drop_nlink(dir); @@ -1550,8 +1550,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(inode_get_ctime(old_inode).tv_sec); - old_di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(old_inode).tv_nsec); + old_di->i_ctime = cpu_to_le64(inode_get_ctime_sec(old_inode)); + old_di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(old_inode)); ocfs2_journal_dirty(handle, old_inode_bh); } else mlog_errno(status); @@ -1592,7 +1592,7 @@ static int ocfs2_rename(struct mnt_idmap *idmap, drop_nlink(new_inode); inode_set_ctime_current(new_inode); } - old_dir->i_mtime = inode_set_ctime_current(old_dir); + inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir)); if (update_dot_dot) { status = ocfs2_update_entry(old_inode, handle, @@ -1614,8 +1614,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (old_dir != new_dir) { /* Keep the same times on both directories.*/ - new_dir->i_mtime = inode_set_ctime_to_ts(new_dir, - inode_get_ctime(old_dir)); + inode_set_mtime_to_ts(new_dir, + inode_set_ctime_to_ts(new_dir, inode_get_ctime(old_dir))); /* * This will also pick up the i_nlink change from the diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 25c8ec3c8c3a..3f80a56d0d60 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -3751,8 +3751,8 @@ static int ocfs2_change_ctime(struct inode *inode, } inode_set_ctime_current(inode); - di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); ocfs2_journal_dirty(handle, di_bh); @@ -4075,10 +4075,10 @@ static int ocfs2_complete_reflink(struct inode *s_inode, */ inode_set_ctime_current(t_inode); - di->i_ctime = cpu_to_le64(inode_get_ctime(t_inode).tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(t_inode).tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime_sec(t_inode)); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(t_inode)); - t_inode->i_mtime = s_inode->i_mtime; + inode_set_mtime_to_ts(t_inode, inode_get_mtime(s_inode)); di->i_mtime = s_di->i_mtime; di->i_mtime_nsec = s_di->i_mtime_nsec; } @@ -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_mtime = inode_set_ctime_current(dest); + inode_set_mtime_to_ts(dest, inode_set_ctime_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 6510ad783c91..b562cfef888a 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c @@ -3422,8 +3422,8 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, } inode_set_ctime_current(inode); - di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); - di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); + di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); } out: From patchwork Wed Oct 4 18:52: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: 148519 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341034vqb; Wed, 4 Oct 2023 11:58:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFePI5UFat9i/cPv5NoC1N/6uno9/WCLYLjjP9itQk8koLkuTYS7n2/ia5H8Y1oUguf9YhU X-Received: by 2002:a05:6358:8a2:b0:14b:86a3:b3f0 with SMTP id m34-20020a05635808a200b0014b86a3b3f0mr3366320rwj.5.1696445913953; Wed, 04 Oct 2023 11:58:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445913; cv=none; d=google.com; s=arc-20160816; b=gIxp4aNBIlkDqssa5wM4EC5k9H1MrlQs+bxJOEmSM40hKP+0RHA+suOgkWnpIdu9cv 4HLAfbwvPFTnmH4clDoSAOZvAkTV5g86HBbwDUtqkKsJvBQdoFkxtckXTeFp4b5z5qN7 6hhjKv8kZyjZka+krqxR/D0lPzwUbpc3IppdUcK6E5EJ2N3rUGYYcN9JJDNr95a4ok1l wdzB3Xh1jZtAOjfCEey+C79b0NVio7geHMm7sRtUt27ku6yz9aK6BiSNIEF2PPCz8r5Y xla4KIMEecqcf/OIwZ7mouDiZ2mSVdqqSlQfelEZYdbj2j2y8T3JmW50Sg+f+vKzqXCh SB7w== 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=hfG5PLNOysJea65TUqCICaU6rR/RJkrGLXHlHUoj35Q=; fh=Z2bTRy1scX8IrlJyHG5XI9Cg0kzzOD+BNHzLgjwr2MI=; b=rTKdxdfWKed87Oy4MR8pjwZatyUicg/HTw37K835p5hREMUIrxXo9lKFqtgXV6whpJ GRXb2So69apMXwiG+YxRiF0XD0HHFuobhmxfxgKhgnfAzzyd8Unn9LjY31uxxC2TQFII OhEgqdBnwfEKiW6t2Oz1gHEJzQ9bdezng1igDfVKBwJbKUZqcaaVAhkSASm54gADfwCJ Xn//oD3yGzmFppGPtzbuzGoGb+tr3vfEWKI0ffPGfSI5RdhVtED4LFtIzKk1s4SH4yzt VeSBkBPRH14qGZsNz4l1U+eP+1/1DS0gpVv0iC41mbeJJsF+qv3zS8igSIff8VU4Nxdv jGtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iSutjIkT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l191-20020a6388c8000000b00570505c5267si4361130pgd.262.2023.10.04.11.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iSutjIkT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8F78780CBDC4; Wed, 4 Oct 2023 11:58:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245131AbjJDS6L (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244988AbjJDSzh (ORCPT ); Wed, 4 Oct 2023 14:55:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A43A310C0; Wed, 4 Oct 2023 11:54:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A370AC433CB; Wed, 4 Oct 2023 18:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445695; bh=2GDYXuoPELo6aY4xsJQ5Xkq6BT2slz1YjAzuDRonK7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iSutjIkTw5Hg9r5T40U/3rI9n7UCPNKjw944PqszHvRshw2UhWhp/frAinofO6kwh aFedrArjmAAgJaa3BA0OffPFtHFX3093FMslVqXeptbUsis24716lHHBafC7ynkaB2 5F+FiSAgdAK7Ger1Kaa799u80Ramx+RfqMQP/v8vweUJLB4hlomh6yfLBvr0elPCBo sneCPuxSCq+tVlNSW+gN5yF8ULXpD1ldTmIEirzoqExsyobkDIo5jXE0q5KyStBtFU zX6X7Uvuif0YWr0Pwr2dJKe5OO3LUDj179M1mhOttEwySp4S1Awag15gKll/jFtkov KncqKNCf9i/6g== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-karma-devel@lists.sourceforge.net Subject: [PATCH v2 57/89] omfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:42 -0400 Message-ID: <20231004185347.80880-55-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852470815382514 X-GMAIL-MSGID: 1778852470815382514 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/omfs/inode.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 2f8c1882f45c..d6cd81163030 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_set_ctime_current(inode); + simple_inode_init_ts(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_get_ctime(inode).tv_sec * 1000LL + - ((inode_get_ctime(inode).tv_nsec + 999)/1000); + ctime = inode_get_ctime_sec(inode) * 1000LL + + ((inode_get_ctime_nsec(inode) + 999)/1000); oi->i_ctime = cpu_to_be64(ctime); omfs_update_checksums(oi); @@ -230,11 +230,9 @@ struct inode *omfs_iget(struct super_block *sb, ino_t ino) ctime = be64_to_cpu(oi->i_ctime); nsecs = do_div(ctime, 1000) * 1000L; - inode->i_atime.tv_sec = ctime; - inode->i_mtime.tv_sec = ctime; + inode_set_atime(inode, ctime, nsecs); + inode_set_mtime(inode, ctime, nsecs); inode_set_ctime(inode, ctime, nsecs); - inode->i_atime.tv_nsec = nsecs; - inode->i_mtime.tv_nsec = nsecs; inode->i_mapping->a_ops = &omfs_aops; From patchwork Wed Oct 4 18:52: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: 148561 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355200vqb; Wed, 4 Oct 2023 12:23:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOWpLoyy7mwZJizQhp/WEKD+3fQB5l5gvX7Kh8TuM4ZFYSMG6+YjLPurd4QTecAdkLfRBW X-Received: by 2002:a05:6a00:399f:b0:692:780a:de90 with SMTP id fi31-20020a056a00399f00b00692780ade90mr3360980pfb.30.1696447393412; Wed, 04 Oct 2023 12:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447393; cv=none; d=google.com; s=arc-20160816; b=QsUz4/bvnjyygGLyuaxevNnDwr/xLtOABYlx9qRkNKQXJ0p9Z+4v0h+QutNvLlT+W3 uG3GMB/EI/Kmk5BAsMvLvyfLmiRv29np4hKGIuA4BFlQ/eNtSsaS4ghRbU/jVyojCkXz dH7fnQzQqVDYqmBOAEA17MrDFi6i/gx0BRNhFPa9I7owLJpu7xQrdFqZBbdHPXWXogip IG56RJJqM0EV9FRgczMHsHSMPp+QxKqeXPRYcwqFh0jTInIo0osGUoRdfBLw3Ch/JzeU X9sgN2Mt0tH8AVBPtWpUVsVJVGYLldDOSFbT4inWPMP1vdGmZkl7pzwl/t/Ndy8Nag8X ytJg== 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:to:from :dkim-signature; bh=WD96dvjaTF7zOhueRkDYvvNWI3dDUtAok/ajlEVmL6Y=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=NtH3DLquX9qqJ7zA6WpViJSCypKETdSfhSbVAH7stPvS04jC3FqkcJChTNT9AMS6lZ 3pmS9DIDykLGr1/JSRM+9C3ASFj5Rp4M9JfqP5UUcvS/Jwgqp50DE9B6IqzIQLfqZ5e2 qMR7WSfu4JiQwgsI+xYu5qyFhTIadat/wU059FtmKutlsh0cY0WBAd758W94+tvG153Q QIHI0Fs5IGDYZ2kU4m3MpzUdOV1t4bI6YURQp/GhFjOnuKdtHF1NoGmEg/Z1o+AWNCT6 aJ5l1ANvxitu5Ej4ASlL20BSngDQpwgK44lZjoajI9jaS6ScnHZHBEg1DJCFKWHcQutF hjtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Or0rayYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j185-20020a638bc2000000b00588eedb3054si4360638pge.1.2023.10.04.12.23.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Or0rayYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id AE6B781A7AE2; Wed, 4 Oct 2023 12:23:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244914AbjJDS6J (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244989AbjJDSzh (ORCPT ); Wed, 4 Oct 2023 14:55:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE2F61734; Wed, 4 Oct 2023 11:54:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1D6EC433C8; Wed, 4 Oct 2023 18:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445696; bh=k6pPAtQL5fkGNB33LVt/CarhmNwpVtS+fZSlhEaLNnI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Or0rayYFM3JfUWgcxwJF2tWv16MkHMWmzg4cGup+y3szkq7GAWd6+/luIrW5uLu86 NnLVBI4bUXu3UZgPJXegtDCZW/TW2GUD9BD5P8SSNcHzshtk03hgMMgCkYFamHdYgR +vv+wOl6vo8WtAw+0kxdsg7xjN9KXu7HWGVCdGvUkIguYJhhD1w0milJmfyDbPJAje 6vqEL0DJBTEHkcN9+IZ29W6cKyGt05kPwC69a2+KmEPjGwcW1hS6PrxczA8N930FqY N1vs6d7bETfjgngbzrPGVKfs/2e1mjWD2acA9rajZBSmOT9s5se25aNHGDJA3lq2cn bcmNf1cG0euaw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 58/89] openpromfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:43 -0400 Message-ID: <20231004185347.80880-56-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854021883827764 X-GMAIL-MSGID: 1778854021883827764 Convert to using the new inode timestamp accessor functions. 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 b2457cb97fa0..c4b65a6d41cc 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_set_ctime_current(inode); + simple_inode_init_ts(inode); ent_oi = OP_I(inode); ent_oi->type = ent_type; ent_oi->u = ent_data; @@ -387,7 +387,7 @@ static int openprom_fill_super(struct super_block *s, struct fs_context *fc) goto out_no_root; } - root_inode->i_mtime = root_inode->i_atime = inode_set_ctime_current(root_inode); + simple_inode_init_ts(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 Oct 4 18:52: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: 148521 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341068vqb; Wed, 4 Oct 2023 11:58:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZJamWesZ11RbdqYOTTXJPoHb2UsUw9R9eMCPsAJz8hAmoX8YLcZ97nMJjTWJTfN9OMcEq X-Received: by 2002:a17:902:d2d1:b0:1c3:bbad:9b7c with SMTP id n17-20020a170902d2d100b001c3bbad9b7cmr3501891plc.31.1696445918046; Wed, 04 Oct 2023 11:58:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445918; cv=none; d=google.com; s=arc-20160816; b=HqgFo7zdj5iPgaCOD5iHbo4a1oAmQSz/66P6llrBB5nWKXg61lunZirli7KVPdXewQ rrzHbFMqbuz5kzOQQ0qKW6ow6yUPJMNljACWrEt8Vdoqf3krNF4fri1+sSWYCvvd5OpG H+du4Kp4lj9QG0A/INsu20jxEFJuR2o/xRt/FMnHcFVQNhA50W4enKi5LueRDhAYnKUP zgcTtvlCk/LAYkEBEuGv6Ny6hA1PaB3jNa2wtfxUZCu99QpY1EBRDZS3KON8V3NUXnFX gOCtJwoXqpqRcz+0XG0wI7dsJJLjgN1z5SqOJ+69DHPn2uEN9qzR14qffFP54Wt8eQJX 4qcg== 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=c4i46Qjad+FWGkYdtDV/4GJXUe1CfKQvOeI6/ivrRQY=; fh=GVt1ijfE6qyOdTZiw1ZWHf/IufkX/oUdAm3PK+I/G6s=; b=dT5TIUDhimgdFyG00+FGUatl0tg1iTN6dKW1l0xFANKNI1be4mO4SM+WPVio2IVzth 8DOXoFRohEr823jerz2d18zaqxkZ9cOvi3CDtSbKQ5dyj7wBEIB87n9isbBHZUpfDtls 63tvUZ1Uc3C376eKV1kPvGu6P/pA0EKSpG0dJyZfIHaXWUzEFVwFUzCX6eX9GY0651Sj FI2eXE8UcQ/qRiPoX+DQdHgds5RkQqYT/GDI7eb1xrpLgDhQV2ocQcYNRJCQsKyMXf7p K9/mKXMtinWCLlSpl6r1tSOHPv46Aa/GtBZlcryZFh73t11p/VcS8zrKRrsYY+qfVyz4 8xCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kr03zbFG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id kx14-20020a170902f94e00b001bc63c38e17si3981866plb.244.2023.10.04.11.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:58:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kr03zbFG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DC3D183F530D; Wed, 4 Oct 2023 11:58:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245062AbjJDS6Q (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244777AbjJDS4K (ORCPT ); Wed, 4 Oct 2023 14:56:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09B7A173F; Wed, 4 Oct 2023 11:54:57 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3223C433D9; Wed, 4 Oct 2023 18:54:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445697; bh=aWVRym5iRRtjlVkeeXRoMTht51r0uneC7a5peLTKRN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Kr03zbFGfkyv3NkbBQY3NOqQO4CTjEp4ImLQLOcslYbOFWZ+cWW0pFuudiQ8Pzoev l8mGR+l9M/90x6K2vQ5WQSSStr0IyHqJ94FJsepamie8W16xp3uK2xKoyIcczth3YY wAknJW6TInICa3B6GGpsYN+Z/HXsXhN56LxeXcsRl9QJpgFjvCHF5q6jlOSak/G3Wr XV+bWp3re3czgQZe1/Vo2GSzULNKE06clOQaWbWURqeY61JnEtpn2ADJ+LgbFSdI3b QpYbAl3AeU8PdcUIQS7AZ1BnTfqgtoT7fCxgmmm5imwL2IMs4Kd473XOL+cngm33jX 1IEaN/WOWNyeQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Martin Brandenburg , devel@lists.orangefs.org Subject: [PATCH v2 59/89] orangefs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:44 -0400 Message-ID: <20231004185347.80880-57-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:58:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852474886823927 X-GMAIL-MSGID: 1778852474886823927 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/orangefs/orangefs-utils.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index 0a9fcfdf552f..0fdceb00ca07 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -155,14 +155,14 @@ static inline void copy_attributes_from_inode(struct inode *inode, if (orangefs_inode->attr_valid & ATTR_ATIME) { attrs->mask |= ORANGEFS_ATTR_SYS_ATIME; if (orangefs_inode->attr_valid & ATTR_ATIME_SET) { - attrs->atime = (time64_t)inode->i_atime.tv_sec; + attrs->atime = (time64_t) inode_get_atime_sec(inode); attrs->mask |= ORANGEFS_ATTR_SYS_ATIME_SET; } } if (orangefs_inode->attr_valid & ATTR_MTIME) { attrs->mask |= ORANGEFS_ATTR_SYS_MTIME; if (orangefs_inode->attr_valid & ATTR_MTIME_SET) { - attrs->mtime = (time64_t)inode->i_mtime.tv_sec; + attrs->mtime = (time64_t) inode_get_mtime_sec(inode); attrs->mask |= ORANGEFS_ATTR_SYS_MTIME_SET; } } @@ -357,15 +357,15 @@ int orangefs_inode_getattr(struct inode *inode, int flags) downcall.resp.getattr.attributes.owner); inode->i_gid = make_kgid(&init_user_ns, new_op-> downcall.resp.getattr.attributes.group); - inode->i_atime.tv_sec = (time64_t)new_op-> - downcall.resp.getattr.attributes.atime; - inode->i_mtime.tv_sec = (time64_t)new_op-> - downcall.resp.getattr.attributes.mtime; + inode_set_atime(inode, + (time64_t)new_op->downcall.resp.getattr.attributes.atime, + 0); + inode_set_mtime(inode, + (time64_t)new_op->downcall.resp.getattr.attributes.mtime, + 0); inode_set_ctime(inode, (time64_t)new_op->downcall.resp.getattr.attributes.ctime, 0); - inode->i_atime.tv_nsec = 0; - inode->i_mtime.tv_nsec = 0; /* special case: mark the root inode as sticky */ inode->i_mode = type | (is_root_handle(inode) ? S_ISVTX : 0) | From patchwork Wed Oct 4 18:52: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: 148527 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342480vqb; Wed, 4 Oct 2023 12:01:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgSx9N283xYXeAE/TbKFEsHDxGvnyZ3W7EqQjsiRF+ze9y9kHAJ8p/ToXyqQuM2i6lTO3s X-Received: by 2002:a05:6a20:42a0:b0:14b:3681:567e with SMTP id o32-20020a056a2042a000b0014b3681567emr3758139pzj.29.1696446067608; Wed, 04 Oct 2023 12:01:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446067; cv=none; d=google.com; s=arc-20160816; b=wj/VK3/4ZGpUvPUWDnN6eEf8+lNKXhyl7kSmLufYXdsUoku8TW3Jr+lL5lX+glcLG2 1vaI7rLwNAuNneYb/5J4GvyDQd59Z3T0M3CzYnNycOYCc7/7p6srjx/y+KhMDoOo8ZR2 4sXnlRRnmqkWdQgQaSlomiGBJ9RIHQSwAeET+9NLgI8HMpgA9bTDkMRcY8uGImXaQdaB 5KdjT7CElXUZ8rBpyr0toqCV79PxFFUSBRSF5w9KqUZU62dfxXROTDs6ftURjhdWzYeR CI3W3llhR5ue0zGaUZzNrW86uhgu8C8BZXVaqBPeJmD1kKc76fxd3EllMOdkyQ9yMDVO bFSA== 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=+/N8UXlHRWGYYErWAxvC5D7YcJz+RC+gblxgBg19Pis=; fh=1ts8YaBpHdhauL1JhLd3+yfDH4+ZNqI6GN/ugCTFmCg=; b=lWD+m1WAPe2R8drmAIyPrdpGhFfwwcnc44uaUDMy/tfrBBBRVLvUEbFKKffE/gV258 U7+T6ITD1bd8V18AEQ9IhOvjkX31MswMu9EsNnj07XoP1Z21NLnY15uoloSai/gxTx5b i/FAKjaT0/5UxgRzNNhT3j6bQaqRTANwC3k+eYlUlNLicmVXi9lLmJZJ/EhP7kDyPrL6 jWHVt5SLdgpVgkLtaxeprERWqbYc7OWJGBYWwtVE9g7F9VxdRFtInWqXboHh/ADjhczr LkqYFWpuhzw+G22t6NN/FHUgapBKcAaN3sWQlI++9bZaw5Zm/qk3FSJgJLn7n3UlLbek jFsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hWYms5tB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id g28-20020a63565c000000b0056a1ea34f45si4221817pgm.670.2023.10.04.12.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hWYms5tB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 6C5988068970; Wed, 4 Oct 2023 12:00:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245108AbjJDS6b (ORCPT + 19 others); Wed, 4 Oct 2023 14:58:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245094AbjJDS43 (ORCPT ); Wed, 4 Oct 2023 14:56:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6AF31988; Wed, 4 Oct 2023 11:54:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09775C4166B; Wed, 4 Oct 2023 18:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445698; bh=YMmryZmmNEItRm2e+RTUeAshmJNZg8hKfFS2ryfvqkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hWYms5tBg7anp0uW84zt4o+EXEhIMFJDachX7wmqUsqsl24Yxew0DEMfDQSf22Sue 9YSh7c632k6ZCA3mQqeCsf6O8gNH2s/rskd6dpZRUB8kCGUW223XotwbsA4YKtUzj4 dJhwGAZi58NRfYKQWpqFUBccPn3Shz8urlrISuovGklJA62gHCWkcT6knYlVPJhNUy 1EcET826gGXKwkG0pTwZqse/ssgLNpzBakDb6em5V8mpF7nlDu8/WVZO0IKT2SZjYh b5kL47oWXd1dDNWv/jeQSOp9j7v6jMjRB9kSQTwc0WSUdq6/KwLcYxcUYEJf/oglBw kVEWbnnZVaj2A== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-unionfs@vger.kernel.org Subject: [PATCH v2 60/89] overlayfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:45 -0400 Message-ID: <20231004185347.80880-58-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:12 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852631862881710 X-GMAIL-MSGID: 1778852631862881710 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/overlayfs/file.c | 9 ++++++--- fs/overlayfs/inode.c | 3 ++- fs/overlayfs/util.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index acdd79dd4bfa..131621daeb13 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -250,6 +250,7 @@ static void ovl_file_accessed(struct file *file) { struct inode *inode, *upperinode; struct timespec64 ctime, uctime; + struct timespec64 mtime, umtime; if (file->f_flags & O_NOATIME) return; @@ -262,9 +263,11 @@ static void ovl_file_accessed(struct file *file) ctime = inode_get_ctime(inode); uctime = inode_get_ctime(upperinode); - if ((!timespec64_equal(&inode->i_mtime, &upperinode->i_mtime) || - !timespec64_equal(&ctime, &uctime))) { - inode->i_mtime = upperinode->i_mtime; + mtime = inode_get_mtime(inode); + umtime = inode_get_mtime(upperinode); + if ((!timespec64_equal(&mtime, &umtime)) || + !timespec64_equal(&ctime, &uctime)) { + inode_set_mtime_to_ts(inode, inode_get_mtime(upperinode)); inode_set_ctime_to_ts(inode, uctime); } diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 8adc27e5e451..345b8f161ca4 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -579,7 +579,8 @@ int ovl_update_time(struct inode *inode, int flags) if (upperpath.dentry) { touch_atime(&upperpath); - inode->i_atime = d_inode(upperpath.dentry)->i_atime; + inode_set_atime_to_ts(inode, + inode_get_atime(d_inode(upperpath.dentry))); } } return 0; diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index a44eec80dc82..73ac47b49218 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -1509,8 +1509,8 @@ void ovl_copyattr(struct inode *inode) inode->i_uid = vfsuid_into_kuid(vfsuid); inode->i_gid = vfsgid_into_kgid(vfsgid); inode->i_mode = realinode->i_mode; - inode->i_atime = realinode->i_atime; - inode->i_mtime = realinode->i_mtime; + inode_set_atime_to_ts(inode, inode_get_atime(realinode)); + inode_set_mtime_to_ts(inode, inode_get_mtime(realinode)); inode_set_ctime_to_ts(inode, inode_get_ctime(realinode)); i_size_write(inode, i_size_read(realinode)); spin_unlock(&inode->i_lock); From patchwork Wed Oct 4 18:52: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: 148531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342710vqb; Wed, 4 Oct 2023 12:01:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzXRRyMRyihqbM1WR4fHfMZwF5yjmSzwszLwUyhv455SDnNSTZT8eQNQgZrXyiWIV9acvN X-Received: by 2002:a05:6a20:549f:b0:14d:9bd1:6361 with SMTP id i31-20020a056a20549f00b0014d9bd16361mr3752624pzk.11.1696446082958; Wed, 04 Oct 2023 12:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446082; cv=none; d=google.com; s=arc-20160816; b=GEgV5UPLNa+GijJ1GiR6FEOd3XGsJkWlYhjDZhHxhj09JbLW8T/WD83CIC8Eqr/bue wxrhBveZ7+Ni/ne+rnYKVCITNCpuPBZkayfCXqsqCVHUYaaFkyMgbcneYiNXq5njlU9q jEPuxBrO1fJpaS/dyUHYRaYL3f8cTEq0h9NgPyqghnQNnKfwNeII4s0MGoEQxIEGGGKX SeDBLnC7OzPc4xcWPGfUgmmOlvNYoBnXlS+2k1l/o4v/tFJafzirp2A33z8PZht8YItY Lb4Aa+ieM7KahVdqdHrR7mTNGFpiYrxpLhY2FLene7WNPGm7HX222k3Ey1wbIT6sYBYi XlqA== 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:to:from :dkim-signature; bh=sWn0YYraQHPsuJYGccgoHETYjrgzvPjSdF5R0UakAqo=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=bJdqVYe4BRkWqmlZKRq5eTIspzDGoaF4VS0Zy0/8ZHx9P+D+KtR93qbCYclIzCWAXy 02M1ReruUFliNLodLGW97kqMY2Xn6sbTPh5XmzRQ37u3J5BNp72CTRQYaN+8LWS3+7CX hEvCdAJeCagq3vfDVgV0brcs4/2w7tVcLzZBZBL1lCidrkpz0qtKU6dWDCSJkEUOSRie +Lz3BydB8lvfw3CdlwSV/FqDfU87kVBTUZBorKn3nJyMGZfaaXC9lSwK/ZWJYxR4uMz1 0ovgOPdF3wBCIaJ3CBwZJCRrGdewaWiWB1iFKlizgYta+RHrILfjsOxhw7P5maPSMbWR fw2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DDrhnP8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id ca25-20020a056a00419900b00691018e3f4dsi4123393pfb.201.2023.10.04.12.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DDrhnP8p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 528A78031E96; Wed, 4 Oct 2023 12:00:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244676AbjJDS7G (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244942AbjJDS5D (ORCPT ); Wed, 4 Oct 2023 14:57:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1479B1993; Wed, 4 Oct 2023 11:55:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A0EAC433CC; Wed, 4 Oct 2023 18:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445699; bh=KXyNcOGOWfV88u79lgZecOECi0GoeXjGaQBhXsInjRI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DDrhnP8pW6/uoW4rlk3+xms49TMcPNMaurBMLiWzWXPbenYps9NFrWZWHIxnT42n/ rUhtX0qxs6nmPBb/kKIndzLlrc5kNdNX1wUfU2ul08cONnHImii76FUxwtyG0X367l 3CpSy+eKzsHQBo/1kY0Jk+1O3GxlHLPjXM+HB8+rEvqWjntbsbAjZeEF08af58nXbS 1hgFqn3b6hwxlsPZWhHfnQ5CmADbXhT1lPpOOYI6wxCfZkkJQTNsedjfTn2lf7+KYc AhydzPvXNQtmdkSy/TxfpD62J2BgyMfpG5A4UOeNZrVqIuZ0C9RF8oqYuV+qCALFOi wOOURyu5W05tQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 61/89] proc: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:46 -0400 Message-ID: <20231004185347.80880-59-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:47 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852647874269348 X-GMAIL-MSGID: 1778852647874269348 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- 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 601329f9629a..86516fbc572b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1898,7 +1898,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_op = &proc_def_inode_operations; /* diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 5933c78af6de..b33e490e3fd9 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -657,7 +657,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_set_ctime_current(inode); + simple_inode_init_ts(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 c88854df0b62..bc9a2db89cfa 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -465,7 +465,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_set_ctime_current(inode); + simple_inode_init_ts(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 ecc4da8d265e..b46fbfd22681 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_set_ctime_current(inode); + simple_inode_init_ts(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 63ac1f93289f..0e5050d6ab64 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_mode = S_IFLNK | S_IRWXUGO; inode->i_uid = GLOBAL_ROOT_UID; inode->i_gid = GLOBAL_ROOT_GID; From patchwork Wed Oct 4 18:52: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: 148530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp342699vqb; Wed, 4 Oct 2023 12:01:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6DU6It/brunD67HWk9xe7qRsQe7OvumJ3DLukXx1gB+J5dqgCXHOjTqiqYsabzCmUlb/Z X-Received: by 2002:a05:6a00:1251:b0:691:27b:15b4 with SMTP id u17-20020a056a00125100b00691027b15b4mr727284pfi.5.1696446082134; Wed, 04 Oct 2023 12:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446082; cv=none; d=google.com; s=arc-20160816; b=n1p2Svrsf+8SxEg2w3CQdGGaKddDrSc3caE3z/73nf8rBtFgzGHSQzVqvlh3TkiVis LXCYQJLibrdBB0QCix7mQofpOBqG/qP56hbOb7nWgzRuoARMAQL9F98cgE171oq4dvKK B7678chR3HbMf/xM885MOpV7eAr3B4jdw/UCUZh+pREAIHHlOqT8ddTbzGb7ffOT24jS Tx0re/xGqkfOFo42R5PWDRXEY2pJZeITCc7WRSQa8aN502H6z4m5LToRZBXak2GatcYJ Hu6qvVxLQ/Zcof1l+rO14eo2npXMHdz/e+sf9W875mPBavR8/p1vfLRPQ9uN8qT8cA0r zAxA== 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=d4p39vkJDn46zrM9Opx/mv7t9Me/Ft9Xc8Rfc6RZqnc=; fh=tSP12W2W6KpbvgXhzX2/WLclKY+Hbbispj0/1qq5urU=; b=P7hhG1GN3q+r+sS0eYtqoKCqqjKE/pGoDTijYDITst3TQkmOkbfQ/S5HdwkH+OOQq3 18qNy+aNZ5ah8UJvsCi3nF2LUchNDgnZlwc249DiVfO5SFBD7RUWUWVgCnseZJt6pMk5 O2O2jqor0oP6m8cAw3u2NP88IhCydPMwlNcvl8ru5lExd5HSYxTQCROdZB7Yw+IRIZ23 K4dHBsSpQbQx3BII+1ToRsHLQZWBfstQCUsP7u5A5Rwi95tRCAqd1yANkKeRbbfqU0R5 62hcL92KgVLx9YTxARu5xRf+vws/S7alDu6YQqUenk76Yft1OioXjoCsGsrQl7o0LiZ6 a5fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KjK3bPaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id bw5-20020a056a00408500b0068ffe38c5ddsi4148508pfb.223.2023.10.04.12.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KjK3bPaN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 2676880BCB88; Wed, 4 Oct 2023 12:00:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245175AbjJDS7J (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245141AbjJDS5O (ORCPT ); Wed, 4 Oct 2023 14:57:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9521419A0; Wed, 4 Oct 2023 11:55:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64BAAC433C9; Wed, 4 Oct 2023 18:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445701; bh=pqa40rTt8rF9QxOQy5tzuN4wusDcUHt9LX9OlvRILZs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KjK3bPaNQza0AJ9shfnVYLa+KoGvGcGntwREq0i74ILqop4xBxR+fljBXYI7i6f4z kHp9cwLgZlN00D9BYEXFpbJPQ4xGcQxPH2GHiTUol0RcSHTY0VZsbrawoJJ/iAmiap VLp9gV2S4AXTjokJ45h+JM7ftJHR8aR5HlxddQ/SB6hwhSRLkVw4asefnJ2DfSCmX3 et91YGW3H2SClI5HkKLGS4csMnAUtpCZL+BKyDFNK9yOHPDiXCScvue61tpa/c+yEv HEh5fHcdk43jwHKK/NReGtstrFINfhy1UQ0w40UH5jBa0gK86YwNKccVjVmZMgj7lS ENm7U6PAHiJCg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tony Luck , "Guilherme G. Piccoli" , linux-hardening@vger.kernel.org Subject: [PATCH v2 62/89] pstore: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:47 -0400 Message-ID: <20231004185347.80880-60-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:44 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852647391216308 X-GMAIL-MSGID: 1778852647391216308 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton Acked-by: Kees Cook --- fs/pstore/inode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 585360706b33..d41c20d1b5e8 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_set_ctime_current(inode); + simple_inode_init_ts(inode); } return inode; } @@ -390,7 +390,8 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) inode->i_private = private; if (record->time.tv_sec) - inode->i_mtime = inode_set_ctime_to_ts(inode, record->time); + inode_set_mtime_to_ts(inode, + inode_set_ctime_to_ts(inode, record->time)); d_add(dentry, inode); From patchwork Wed Oct 4 18:52: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: 148522 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341470vqb; Wed, 4 Oct 2023 11:59:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDpm6vkTMLqNTgnRA4rIJkdPPMtk9UGjFqzjjo9wXLbZ8T6cMvIMBG3LmmJF4NK8EsKzeB X-Received: by 2002:a17:903:646:b0:1c0:7bac:13d4 with SMTP id kh6-20020a170903064600b001c07bac13d4mr3127154plb.65.1696445983258; Wed, 04 Oct 2023 11:59:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445983; cv=none; d=google.com; s=arc-20160816; b=DkIivj7P1Xa5t1bZvNaRyiuvrDZt2RTDRRWWNMVlT4HYxaXBCaM+rUf9raweQERpDg +6/aHjLzZXhbnF2FtXQuxfrGj3RIzKkqbhCW6VDvITMbHzQdEeWM5xenV+ykLg0bn9ur /JlosubNwIVPOIm2+NFRl/pnHytiBHZDL+EnnRR+cgUIQ7TLg/OCd3I7dNWW6nq42/kY ChLzed2JH37OHdSYRPbjlEbQerDKhRnt4n7cDlD4JaqjbPy4b5KyMuVuajL9NlFUmZB4 1wbJDBx8ab0GulCbhEOk+9aBgg5EZCnFSa1XNO82D/7XcrYj4ToAQWQehImthyVrRyGi w2rQ== 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:to:from :dkim-signature; bh=/mYOme4O6x9eGdUf8mHK/uAfmgZGNsVRgKppa6AO1Bw=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=C0/gCesfH7JQzLDbClO9u/bhJT2FUK/n1jqnDaY0j2oEjgGVEGa/r4IAs8L0ErRHwQ qw6p5yoWFXS8TGrz6ojtVEndn3w1A+j8k4j9MVUt0rOLYJXcVTuY0dEKD9A7WZW11Lqi ADqL82bOAYrDl+U2yDfMcy5HUzMcACI1Zs/xla1BXirNljN5EwauuOVy4ELFHIQStsmD ywQ1kGaotADN04ew8Kkuq5afX5Hwsrqbhh61lIXi+/uK7YL0otKkZWIXEDmY+5fwiYGx W+DWDM8HBdFNh7hnhGGdpYmvehHpEkhOQwQlEPBnlO6fsML1HXQu1H5P6SXsB+I/U2Hw 4BDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zkuj6bKo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id n6-20020a170902d2c600b001b9e2ce5723si4437986plc.495.2023.10.04.11.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:59:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zkuj6bKo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id A280D80B6328; Wed, 4 Oct 2023 11:59:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245195AbjJDS7Q (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245188AbjJDS5c (ORCPT ); Wed, 4 Oct 2023 14:57:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4071F19A5; Wed, 4 Oct 2023 11:55:02 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C16CC4160E; Wed, 4 Oct 2023 18:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445702; bh=CMGdYXPOxwLuV14GaP34l2MZRW5TD6XlHfy3cpYDZKI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Zkuj6bKo0HwDupniG2ss2xEtuc0eyAJaM392Ev7OfmRTCEVD4WrK8IA3AUdNFTpnu MTOw+zNLYznrO8lpG9RSTRM3qchtnokzLXkd/Hp0fbv9i7pLPZs5hcscbFpvCO0SYv ay+vRxUvCwc8X7RZ62HRWclm4icmawFbJfccf6App8UpGYS4t5tHqMxMluyMrlcbKQ /sPPOYuNN2uqwK/C0ndwu/9WEMjQ1v8OIXVTZ1rvw3XjxZFa/CfPjSrI/hBxmAqxmr m7IVle42FOoX5AbOESPfrmGciskoED1lDXawTdj5adAdikULLxqMtLh6PRmBdnfOZd JNjC5JOmrOXIg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 63/89] qnx4: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:48 -0400 Message-ID: <20231004185347.80880-61-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:59:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852543420190645 X-GMAIL-MSGID: 1778852543420190645 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/qnx4/inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index a7171f5532a1..6eb9bb369b57 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c @@ -301,10 +301,8 @@ struct inode *qnx4_iget(struct super_block *sb, unsigned long ino) i_gid_write(inode, (gid_t)le16_to_cpu(raw_inode->di_gid)); set_nlink(inode, le16_to_cpu(raw_inode->di_nlink)); inode->i_size = le32_to_cpu(raw_inode->di_size); - inode->i_mtime.tv_sec = le32_to_cpu(raw_inode->di_mtime); - 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_set_mtime(inode, le32_to_cpu(raw_inode->di_mtime), 0); + inode_set_atime(inode, le32_to_cpu(raw_inode->di_atime), 0); inode_set_ctime(inode, le32_to_cpu(raw_inode->di_ctime), 0); inode->i_blocks = le32_to_cpu(raw_inode->di_first_xtnt.xtnt_size); From patchwork Wed Oct 4 18:52: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: 148523 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341541vqb; Wed, 4 Oct 2023 11:59:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFt/TLpfVTiaJ0gJsymY+gdWMcZawEpPZYG5pN1A1NI+zswJNEX6qsU57gKKvBKvOBQwPGn X-Received: by 2002:a05:6a20:d42a:b0:15c:cb69:8e64 with SMTP id il42-20020a056a20d42a00b0015ccb698e64mr2655829pzb.25.1696445993133; Wed, 04 Oct 2023 11:59:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696445993; cv=none; d=google.com; s=arc-20160816; b=fPdfTDFCnLWiFSPnluR6PJG0INrjmtVzQYZXLYnhWqAICoEBfTL+ZI1SsBQQg92rwP wylzfj6NNXih+EzhPGeRKcnZIbFRf8MLsY2xfuMlvt16sNIk50B3S1E2h+7qYwTKzysn bNUQvc8CSYCHUabYU18s5CC6gpFVaqy8OtSXjvV5dagGvytUXW6/HfPtoeApHih6ToPY 2PFQxyOffTN++RIjIAHH/7IfIepPBaNDDDsMrjZFU6iBsP4M9xE3qGFIOdgcwnxEbYIa FyRX3cBc686eVUvxWGGkhHrNAW0UTMwYiP+yzadyIU31SxBUypfGVwXzlAVCtmM3AmAE yYKw== 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:to:from :dkim-signature; bh=bO7dkPLuihrjzCKQr3872sK4pXVUQrAeRE6bMcD2yDQ=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=gHKQ6s1w3zXaHhTLGKke+qwNfMEe3qgIvWCoiI11ravhLSz95UMQW1P9rNojWSzZUn iqtNxsIkt2+i+SdCRR0iEoHYRgvo8y/BagTAtBraBGM9SIc1U0Le4YzQfP7qMdvZsvra QVzFdsXniJoKctklnqBoXNeXz9bKzXvHGCx0mOSYlNCC9KhSaiuG1HKdzHX4MJH35QMz 4qcB473DmhIm7sDBZOlLunWqJbLYhEtaXuN8EH4uc4mCyvBfr3ipmoXYlIxhlqZPAZco xHIcFnB4+WNLz/crrocHg4EYBuXb5fKc8R+EWmmi5MpqVv+1lZfhFP7gvkP5R86gFoYZ FRxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dSi0Xigi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id q17-20020a637511000000b00563f4e46f7esi4043610pgc.287.2023.10.04.11.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 11:59:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dSi0Xigi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3C464840FE08; Wed, 4 Oct 2023 11:59:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245207AbjJDS7U (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245191AbjJDS5c (ORCPT ); Wed, 4 Oct 2023 14:57:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B8519AE; Wed, 4 Oct 2023 11:55:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96BC1C433CA; Wed, 4 Oct 2023 18:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445703; bh=/8pjuOM0Qd24x5SzFojlCX8B9Y/ANN/ymKVyByVWTeg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dSi0XigiWvrO5U9YjC4QnVjoXcIv+NwVDRdo7lo5xz8exDjb4kyMNDmx5BGqBb5T4 U5Bl0BvUjBjPZXdQ+atsXLYt2OhorZUm7gzV7gbofDEYFRPmofhqrgBpcHHOle2KjL 8eUTNE4sFyG/BOsV9Km1T4W2QrMWHCj3PHysmqKvdImpSQywLSNXIu8R2gB8zqA+yt gu/hw8qLNi4jjD6B662tBSVJQGZCmzQQjQHnMRfh/awPE4U0Jk2h4b/MQ6VJXx7ftb KH/4pczKTxK0P+dnaiVk6P8ZIZxk7DgC9V2E21FOA17G8Plth3XaahU1l0ZFY1iWVI xh3jtfcCwVz0A== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 64/89] qnx6: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:49 -0400 Message-ID: <20231004185347.80880-62-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 11:59:52 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852553625082878 X-GMAIL-MSGID: 1778852553625082878 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/qnx6/inode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c index 21f90d519f1a..a286c545717f 100644 --- a/fs/qnx6/inode.c +++ b/fs/qnx6/inode.c @@ -558,10 +558,8 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino) i_uid_write(inode, (uid_t)fs32_to_cpu(sbi, raw_inode->di_uid)); i_gid_write(inode, (gid_t)fs32_to_cpu(sbi, raw_inode->di_gid)); inode->i_size = fs64_to_cpu(sbi, raw_inode->di_size); - inode->i_mtime.tv_sec = fs32_to_cpu(sbi, raw_inode->di_mtime); - 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_set_mtime(inode, fs32_to_cpu(sbi, raw_inode->di_mtime), 0); + inode_set_atime(inode, fs32_to_cpu(sbi, raw_inode->di_atime), 0); inode_set_ctime(inode, fs32_to_cpu(sbi, raw_inode->di_ctime), 0); /* calc blocks based on 512 byte blocksize */ From patchwork Wed Oct 4 18:52: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: 148525 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341752vqb; Wed, 4 Oct 2023 12:00:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3vrPRn3HYjtvPHXkExXguMiQzZF/OIqlorUyjrDjM5u9l71STCbyOw2n5Bo1TFgrbEPya X-Received: by 2002:a05:6a20:f3a4:b0:15d:e68d:a850 with SMTP id qr36-20020a056a20f3a400b0015de68da850mr3013878pzb.29.1696446011309; Wed, 04 Oct 2023 12:00:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446011; cv=none; d=google.com; s=arc-20160816; b=ikVjQItqlDulILeqR65Do7nPtv/PUHGVUXq8uqmSFj5OmL/CzoN/7VIzulyS+Q4Ubp Mnv5CXzkOMMt1JJmiDWR2fakBNHvncVsbGaKqB9gLNWEuJvJzYbUB3thWdhXYxgFTQ/A d4I0D9F5u/x5JEsZJYm0tGW0D98lCFGdB+wNIDHz9thQkQw1k6kBhXc2aEVioyj3HC1V cHE91nams0AxfOwu/Oj4fD5LOYO0KbH6wAyN766V2XDBFiYXZHqrqCq7ssV6mQic6QVE PoBgRZUQ9tgqxXG0DaKcYdvYpGeduwpjAHa/RoKgSK+CZaTkfpr/DsKVVX2kn8peo7Qf ipSA== 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:to:from :dkim-signature; bh=BsL/mAgTrQCTN+UBgRTzARCZeKBWD+oe6a/7qQhp33U=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=RW42/715LahYdNRB+ft1R8+2K42+2hDGzBUapG1OHxeZs30k34wfCfj15uGB0s4p0y eKk7vY7lcDs5g9R+UM6KXDVKVsDK4Io7HXpfcDMiSxVsWBGDYSvCdyqroX19vVD4LlGq HlTJ7OtmMq3WSF4arUsOXTxM9P6gMRSMq/swQb9KFH5alqMdysdUSZwD3xtGKG9B8Oz/ Xkr++JS9B1xmk9qrw1Aba+AVHgNw7/V5BiUbCRAJFHqe4fmNlaZIKZVlUkYnR2FbN/k4 pjW7tDV3ReLFtDbwT+9Pnsmvu2PaI0UcFA2idMQb2zzRiCnHv7GTq4J9hpLSp0e3jMxk FauQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JwtjnuCA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i127-20020a639d85000000b005859eba7939si4144577pgd.20.2023.10.04.12.00.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:00:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JwtjnuCA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1F54180B18BC; Wed, 4 Oct 2023 12:00:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244971AbjJDS7Y (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245197AbjJDS5d (ORCPT ); Wed, 4 Oct 2023 14:57:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1777F19B2; Wed, 4 Oct 2023 11:55:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9110AC433CB; Wed, 4 Oct 2023 18:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445704; bh=S8tAZxon6hXRz9ReTd0X25sPxDNyJENVPOCPLJigAL0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JwtjnuCALLzl4pVn8WtHZ5djoHE7zzymhuew+1h8c4iBqmCTd28c5lltf+jtzVG+A 2kyoeduQxqL22Qt9yczA61L2BNNFop4j4jQTec2w+ey8xdfOdhT8/i5MlHXSCXVYBA inz/uO/ciYyK8U8aul62i+ozajX2HroX6ZGFer9SQ4YEjstfkjlCOZ9XQjuy5zPpXK C6GeihVxFm8GY6LyimSjAswIsfNUJMSWnoWWo06LnT1mf6Ct7KRgZviYWQyK2++BoJ 6RqgfkFFwLgIckOYAsYWbtczKXrQ7gqBVZpOdmXrwwnWI9Q/6xeZNmUTJQiv8TO/+6 eZkpzxRN4bFpw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 65/89] ramfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:50 -0400 Message-ID: <20231004185347.80880-63-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852572636392879 X-GMAIL-MSGID: 1778852572636392879 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ramfs/inode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index 18e8387cab41..4ac05a9e25bc 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_set_ctime_current(inode); + simple_inode_init_ts(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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); } return error; } @@ -138,7 +138,8 @@ static int ramfs_symlink(struct mnt_idmap *idmap, struct inode *dir, if (!error) { d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, + inode_set_ctime_current(dir)); } else iput(inode); } From patchwork Wed Oct 4 18:52: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: 148524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp341655vqb; Wed, 4 Oct 2023 12:00:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgVB5gsTOxQnVDnTPCu0xTtOcqhQxWjeqqjiQs6wFyasGoYpU7jIjTuhR7jKPWci2kfp4H X-Received: by 2002:a17:902:dac3:b0:1bb:b86e:8d60 with SMTP id q3-20020a170902dac300b001bbb86e8d60mr3888106plx.46.1696446004752; Wed, 04 Oct 2023 12:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446004; cv=none; d=google.com; s=arc-20160816; b=n9VWYR6bUYoco186D/1iTJxlvXak+WeB/FHD3NdfM2Zi4UkamT2j0jQQAzu7liVmKZ wwEG3Ggs0qdHsaCgYjtmfSZKLTlD4rUy5+USXR/x6Oa+G7s6EDUORqMi5wV1/oN4QLMW fX6nXKdBrZteugiGeLva6PAqqth8x6k+qB/JKPX1rM1QLuCo2xLQegjqTHoxmiwlkQJQ y97w4m+8S1tLYITLc1Ym2YFPcK83G8nrnJSx25b6kbWtoVJCjCWI1/Vfz5MpQKKjDZfR 7Rs1qfIBM4HXAag7YZNvvnXh3+sc9rfamtT3egh4c1XAQfOrRpFaySt0R25uAWXFHNLc 2dhw== 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=193wx2SXtV7Z5/GqE6mVqQrOZp0/LaR2VZEFfZy4bds=; fh=eAvaNBw3deuQszq/dVYFR/Il1MGmzbmDKm2WiHeD7v8=; b=jCXIxEcjslOVdSuw5RRRrHuoo8vrO9NVJSnhR8yh5X+q/V4YYmFbentJBTZMk/CRJg JIZAbrwrbl5QyaRa/4ANEGvy/VN+LJwQ/4qA1yaY+LK86mwIm5uc6IkIlalj2uzPYo+S E1HeSArzQsQwmfksXiAphgfScPlT/LTzJ23Ar4lHxuFD8dEd84Q3ibS3resa0xXehq7r 4J7dgoCFkLEdQzQDoWHQb7iuTAVAZUSNECbly3//kpUHTth1vC8IZCVUJFI04d3CPIYb OfWImch5yJYzp3xH7rVBCwYIGwp+ieA+ha/nAA3NLwiSC7aOF6s0egO+WQIjlo3bsP2b 4rtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ShDFwKFr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a12-20020a170902eccc00b001bbae3ae2bcsi4774485plh.413.2023.10.04.12.00.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:00:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ShDFwKFr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C4AFC80756CE; Wed, 4 Oct 2023 12:00:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244851AbjJDS7W (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244842AbjJDS5e (ORCPT ); Wed, 4 Oct 2023 14:57:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90DDC19BE; Wed, 4 Oct 2023 11:55:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4825C433CD; Wed, 4 Oct 2023 18:55:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445705; bh=yAeLI7C8FS/jnlSR3OJ6c14X/tE7zEDbA+SFSmoaVbg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ShDFwKFrVrXVS+LxoFsHhwRpQx8Tw1iTmkncpeqoXnUU9c7aDmKet/YOTimS4BWLn 4Jo+BqokYM+2say+UPeM9bRKV/f5Uf2VfHVX7SgDnZ2FHXVgBgg0FCVDuTAwHVhPAj JGA0T5G/2Zjvrd1NeZlEzJRUt8kiVVqO/3/RLb9nMBwNze3NyWVqxUVX09zsmVNl+g VyLTWQ5uw6lNmUX5opUQNHely2hX+27HZfmZKkXuvFehdXFmTmAi9FXLE3d0Y/FdAz v/onLQ9z0j73UA3bna7MkC2Xo8fqGw37upFMNSptQi7M7c7krzHPBQINufhFcBIWjW +4nenb+58VyHA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: reiserfs-devel@vger.kernel.org Subject: [PATCH v2 66/89] reiserfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:51 -0400 Message-ID: <20231004185347.80880-64-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852566093622334 X-GMAIL-MSGID: 1778852566093622334 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/reiserfs/inode.c | 26 +++++++++++--------------- fs/reiserfs/namei.c | 8 ++++---- fs/reiserfs/stree.c | 5 +++-- fs/reiserfs/super.c | 2 +- 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 86e55d4bb10d..c8572346556f 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1257,11 +1257,9 @@ static void init_inode(struct inode *inode, struct treepath *path) i_uid_write(inode, sd_v1_uid(sd)); i_gid_write(inode, sd_v1_gid(sd)); 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_set_atime(inode, sd_v1_atime(sd), 0); + inode_set_mtime(inode, sd_v1_mtime(sd), 0); inode_set_ctime(inode, sd_v1_ctime(sd), 0); - inode->i_atime.tv_nsec = 0; - inode->i_mtime.tv_nsec = 0; inode->i_blocks = sd_v1_blocks(sd); inode->i_generation = le32_to_cpu(INODE_PKEY(inode)->k_dir_id); @@ -1311,11 +1309,9 @@ static void init_inode(struct inode *inode, struct treepath *path) i_uid_write(inode, sd_v2_uid(sd)); inode->i_size = sd_v2_size(sd); 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_set_mtime(inode, sd_v2_mtime(sd), 0); + inode_set_atime(inode, sd_v2_atime(sd), 0); inode_set_ctime(inode, sd_v2_ctime(sd), 0); - inode->i_mtime.tv_nsec = 0; - inode->i_atime.tv_nsec = 0; inode->i_blocks = sd_v2_blocks(sd); rdev = sd_v2_rdev(sd); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) @@ -1370,9 +1366,9 @@ static void inode2sd(void *sd, struct inode *inode, loff_t size) set_sd_v2_uid(sd_v2, i_uid_read(inode)); set_sd_v2_size(sd_v2, 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_get_ctime(inode).tv_sec); + set_sd_v2_mtime(sd_v2, inode_get_mtime_sec(inode)); + set_sd_v2_atime(sd_v2, inode_get_atime_sec(inode)); + set_sd_v2_ctime(sd_v2, inode_get_ctime_sec(inode)); 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)); @@ -1391,9 +1387,9 @@ static void inode2sd_v1(void *sd, struct inode *inode, loff_t size) set_sd_v1_gid(sd_v1, i_gid_read(inode)); 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_get_ctime(inode).tv_sec); - set_sd_v1_mtime(sd_v1, inode->i_mtime.tv_sec); + set_sd_v1_atime(sd_v1, inode_get_atime_sec(inode)); + set_sd_v1_ctime(sd_v1, inode_get_ctime_sec(inode)); + set_sd_v1_mtime(sd_v1, inode_get_mtime_sec(inode)); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) set_sd_v1_rdev(sd_v1, new_encode_dev(inode->i_rdev)); @@ -1984,7 +1980,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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_size = i_size; inode->i_blocks = 0; inode->i_bytes = 0; diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 9c5704be2435..994d6e6995ab 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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,8 +966,8 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) inode->i_nlink); clear_nlink(inode); - 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))); reiserfs_update_sd(&th, inode); DEC_DIR_INODE_NLINK(dir) @@ -1075,7 +1075,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) reiserfs_update_sd(&th, inode); dir->i_size -= (de.de_entrylen + DEH_SIZE); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); reiserfs_update_sd(&th, dir); if (!savelink) diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 3676e02a0232..2138ee7d271d 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c @@ -2003,7 +2003,8 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, pathrelse(&s_search_path); if (update_timestamps) { - inode->i_mtime = current_time(inode); + inode_set_mtime_to_ts(inode, + current_time(inode)); inode_set_ctime_current(inode); } reiserfs_update_sd(th, inode); @@ -2028,7 +2029,7 @@ int reiserfs_do_truncate(struct reiserfs_transaction_handle *th, update_and_out: if (update_timestamps) { /* this is truncate, not file closing */ - inode->i_mtime = current_time(inode); + inode_set_mtime_to_ts(inode, current_time(inode)); inode_set_ctime_current(inode); } reiserfs_update_sd(th, inode); diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 7eaf36b3de12..67b5510beded 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); return len - towrite; } From patchwork Wed Oct 4 18:52: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: 148534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp343160vqb; Wed, 4 Oct 2023 12:01:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9CObHG9lmEAmSr4kqQMl/osBkHz5fkKQN6YD0NaDBvDxAjVHRFK2iZgotLLEunQTgTP6k X-Received: by 2002:a17:902:ea0f:b0:1bd:bba1:be78 with SMTP id s15-20020a170902ea0f00b001bdbba1be78mr4064403plg.23.1696446112991; Wed, 04 Oct 2023 12:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446112; cv=none; d=google.com; s=arc-20160816; b=CBnu5+i2Mt+q1ENS9hFiWaWJjIzc5fN+7pzAD2amLkHHGOrAa8qxi9yh6ublXgn5ET DAeyHY5JiM59NE1vG5boCc5qzgNsbVh40mMBgg8i+GXQqiHCvgl+nrpUiL4OrYNaae55 7u54L7JYrmln8VsPW3VCh9AtBi6vi49WTGX7C2o2EGwKNrp+96nW+aPfACKSv1igBg9f Mx/+cFFjPO2uoVVi523hyJ+kB5rxa+eCqPt18ejDr13W/Jjm6DWrm6qzTXEaGGYkWd+9 iUXsxTrK2okxPJOF+Cxe9VjGvguJXzm26TYe9t2NYS9IwouzdVQ2HTsAe7V9NC9O6ozF wFXw== 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:to:from :dkim-signature; bh=ERVS3x+PEt2SJUafrvf3HNeUWbRMD34gkhCQV1BBzwQ=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=srQXa/5volQcZy5lO4UisTJCUCX6nj2STuOOVhr+Kf5dKI9lioC5OQOT9BSlQi+6hQ BpBQfWEjy/eApvpYXTZJbzHx+xnbpjAeWfuFyBYo/oNmbsX03JaV/QpLoxjPxZ3ZiT1O wxeLjcaH5QbX3GDLsuwsfWOPjh6iOLe+J5rj2vM1SNJhhXUA+vKoOakMSkussGLWaEA8 4teCTxrnca3pthEvxbfd8lTpyyx/x9/LBjYgEKeYkaZlYQ0NDvE5YSlV3jv9vD8Z6P8+ e3ijxUy4sze/8peP1m+gVYrzfb3T1MtH2E2LA8O4w2M7fb+gydvOxzGhC9G64kfL7mUL Fe4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qb5DWzuV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b3-20020a170902650300b001c6249a387esi4079311plk.531.2023.10.04.12.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qb5DWzuV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CB1DB81F3298; Wed, 4 Oct 2023 12:01:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244980AbjJDS71 (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244976AbjJDS5i (ORCPT ); Wed, 4 Oct 2023 14:57:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D258B1BCA; Wed, 4 Oct 2023 11:55:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E04E8C433C8; Wed, 4 Oct 2023 18:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445706; bh=cYZfH8J20PFiLPgQtnzXidDq8KjSTBwLQM10SWUOyDc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qb5DWzuV+Yl+U5i4O4AmUUPGTtX3PVCwHHJ0ZsJMlSb2jRzt/5ftMWWnHnawPiUxf m/JOkoQ/ElFbyi38QpXwo5bKDZ4sKET3/xO9mydJGs97TUjiZ3j8jgzoANQj6Pe5+F zOInfraFWC1C+Vf8Su/e7GPDTaOQFYaM7GPP9+OV1eCokyYW68iQfeQ9znZP94fNtu tpA6x5rcgX8+ILIGAHBFqF08ABgd489h5Ppjii12q9xTC/s5/k+rMoS3GRA3DNPUve fUxw0wzSzQ8s+llzdXnlJXFolH5nunFeMvgfLuit7ETtrMziCiYrlmsoW2ZzQ++/Ff 50oAonuXfFlrQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 67/89] romfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:52 -0400 Message-ID: <20231004185347.80880-65-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:01:17 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852679247031573 X-GMAIL-MSGID: 1778852679247031573 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/romfs/super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/romfs/super.c b/fs/romfs/super.c index b1bdfbc211c3..545ad44f96b8 100644 --- a/fs/romfs/super.c +++ b/fs/romfs/super.c @@ -322,7 +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 = i->i_atime = inode_set_ctime(i, 0, 0); + inode_set_mtime_to_ts(i, + inode_set_atime_to_ts(i, inode_set_ctime(i, 0, 0))); /* set up mode and ops */ mode = romfs_modemap[nextfh & ROMFH_TYPE]; From patchwork Wed Oct 4 18:52: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: 148536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp343203vqb; Wed, 4 Oct 2023 12:01:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo2uZDKaLsMSVbOrid+2XN4yT/Q3f1i1rbOQ2pUgDgpHlbwx4hhMlzKEt0McTx7817hBm7 X-Received: by 2002:a05:6a21:7783:b0:15d:4a2b:b50c with SMTP id bd3-20020a056a21778300b0015d4a2bb50cmr3143671pzc.56.1696446116320; Wed, 04 Oct 2023 12:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446116; cv=none; d=google.com; s=arc-20160816; b=bneGrGPCF5oe4c32K3z7TUYoAuYuMbz+x7sHp/+ZBvOcq0lBbnl1CP3ZBCmKTw8REa UUZrIEPObD3oEx5g3Y2/dxGX0sLZy2toPzICGTAzIsN7OxMXWDxKvKb1oH977k6gs2Ou 9vW4AKrsrMYrbxd7Qvz/yrMXwShgCM/SK0A3Y51vsVASavt/pWOmFwo56Tq26kBoHYuC W8jFcOAAZBDpKjKI6tD2p2RbOz4kkR1yXGQAkB/Xpzy3xfU5/sCEWj6d2XDN7nxsOBB/ pIqLBSWay9L/kTyC1zWv0Qt4BR2LwbXIlkiC9toXRwQnhT809lW8ooYx6L7ejWzfKbFh ZNtg== 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=MdneN3V9Aq/zjlIk+BkNAwBmYqWK44USm0pUXV2mLZM=; fh=+omxPMm6LMeT6CMn/0FVSJAoSBWEcLYtLW983BmBYTM=; b=IEmIlzDuzX7duMokojwg7yORPMubcf9fXC7tDAaE422B1/mkjAFofzYEY/OflvXQSP /d/DsfyRlXED2psfT9h4yw6eGK+UzImVDZb3srXiO9U070poiSbegyY0xITEU+2pgEd5 2h+zie4xJPZmrCvn3VIifXDfc1gDcwqkHSNGuGLFyW5HIAbpEycysKiSnKNZskFUdGiP 5Z5RO5Lwm+6WNMspBVFnV+zvjld3rCit9gn6HirjBtL/2QOhCODUweuHauoRBoxB6DPW KBVqCOEDThY+47zx1dO8NgceVWEqqH8bRBJ2Rnav6IsO9J6MkDoYBsNpcxAxSwuB9M3q 6Tcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pcu9yRaX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l184-20020a6391c1000000b00585a5e3039esi4291376pge.113.2023.10.04.12.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pcu9yRaX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0CE41807C55B; Wed, 4 Oct 2023 12:00:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245077AbjJDS7z (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245079AbjJDS6C (ORCPT ); Wed, 4 Oct 2023 14:58:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EF061BD0; Wed, 4 Oct 2023 11:55:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35C18C43391; Wed, 4 Oct 2023 18:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445708; bh=Mxx0BtmMInezBzzuDb5FKs83348Tgftw3CavncYhdKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Pcu9yRaX24NjYh70pmYyj25yD44b36Gj1v0ldhfV2ISDV83mAY4WRMOVlg/44uMs6 MsRxg/Mk7BvUrkEGk4OQDNXKkC8Y11ur2sQePDteP9mSKu1nJLg00dgRK6DYeaalCu 4Ns8rgsXa4mIHxqrP/D1R4NWoPgrabvZCKZewoOyMPYed0r4Mh6R63wME78fbPIjrg MQiO7upcmNcr4rswGFl6B378G9nHFQVtsGaSzPq9+Uetpi9diNrjKURLBqEZXmktkl LOMpiB026iqWL97WEadqLmoreluLzTQ2/+USQVdSIuZ2qkf04uh2H+ctWkfzb3xEwF vWATO/WuKaEGA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH v2 68/89] client: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:53 -0400 Message-ID: <20231004185347.80880-66-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852682409515311 X-GMAIL-MSGID: 1778852682409515311 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/smb/client/file.c | 18 ++++++++++-------- fs/smb/client/fscache.h | 6 +++--- fs/smb/client/inode.c | 17 ++++++++--------- fs/smb/client/smb2ops.c | 6 ++++-- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 2108b3b40ce9..cf17e3dd703e 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -1085,7 +1085,8 @@ 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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); } spin_lock(&cinode->deferred_lock); cifs_add_deferred_close(cfile, dclose); @@ -2596,7 +2597,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_set_ctime_current(inode); + simple_inode_init_ts(inode); if ((bytes_written > 0) && (offset)) rc = 0; else if (bytes_written < 0) @@ -4647,11 +4648,13 @@ static void cifs_readahead(struct readahead_control *ractl) static int cifs_readpage_worker(struct file *file, struct page *page, loff_t *poffset) { + struct inode *inode = file_inode(file); + struct timespec64 atime, mtime; char *read_data; int rc; /* Is the page cached? */ - rc = cifs_readpage_from_fscache(file_inode(file), page); + rc = cifs_readpage_from_fscache(inode, page); if (rc == 0) goto read_complete; @@ -4666,11 +4669,10 @@ static int cifs_readpage_worker(struct file *file, struct page *page, cifs_dbg(FYI, "Bytes read %d\n", rc); /* we do not want atime to be less than mtime, it broke some apps */ - file_inode(file)->i_atime = current_time(file_inode(file)); - if (timespec64_compare(&(file_inode(file)->i_atime), &(file_inode(file)->i_mtime))) - file_inode(file)->i_atime = file_inode(file)->i_mtime; - else - file_inode(file)->i_atime = current_time(file_inode(file)); + atime = inode_set_atime_to_ts(inode, current_time(inode)); + mtime = inode_get_mtime(inode); + if (timespec64_compare(&atime, &mtime)) + inode_set_atime_to_ts(inode, inode_get_mtime(inode)); if (PAGE_SIZE > rc) memset(read_data + rc, 0, PAGE_SIZE - rc); diff --git a/fs/smb/client/fscache.h b/fs/smb/client/fscache.h index 84f3b09367d2..a3d73720914f 100644 --- a/fs/smb/client/fscache.h +++ b/fs/smb/client/fscache.h @@ -49,12 +49,12 @@ static inline 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_get_ctime(inode); + struct timespec64 mtime = inode_get_mtime(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_write_time_sec = cpu_to_le64(mtime.tv_sec); + cd->last_write_time_nsec = cpu_to_le32(mtime.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 d7c302442c1e..3abfe77bfa46 100644 --- a/fs/smb/client/inode.c +++ b/fs/smb/client/inode.c @@ -82,6 +82,7 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) { struct cifs_fscache_inode_coherency_data cd; struct cifsInodeInfo *cifs_i = CIFS_I(inode); + struct timespec64 mtime; cifs_dbg(FYI, "%s: revalidating inode %llu\n", __func__, cifs_i->uniqueid); @@ -101,7 +102,8 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) /* revalidate if mtime or size have changed */ fattr->cf_mtime = timestamp_truncate(fattr->cf_mtime, inode); - if (timespec64_equal(&inode->i_mtime, &fattr->cf_mtime) && + mtime = inode_get_mtime(inode); + if (timespec64_equal(&mtime, &fattr->cf_mtime) && cifs_i->server_eof == fattr->cf_eof) { cifs_dbg(FYI, "%s: inode %llu is unchanged\n", __func__, cifs_i->uniqueid); @@ -164,10 +166,10 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) fattr->cf_ctime = timestamp_truncate(fattr->cf_ctime, inode); /* we do not want atime to be less than mtime, it broke some apps */ if (timespec64_compare(&fattr->cf_atime, &fattr->cf_mtime) < 0) - inode->i_atime = fattr->cf_mtime; + inode_set_atime_to_ts(inode, fattr->cf_mtime); else - inode->i_atime = fattr->cf_atime; - inode->i_mtime = fattr->cf_mtime; + inode_set_atime_to_ts(inode, fattr->cf_atime); + inode_set_mtime_to_ts(inode, fattr->cf_mtime); inode_set_ctime_to_ts(inode, fattr->cf_ctime); inode->i_rdev = fattr->cf_rdev; cifs_nlink_fattr_to_inode(inode, fattr); @@ -1816,7 +1818,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry) when needed */ inode_set_ctime_current(inode); } - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); cifs_inode = CIFS_I(dir); CIFS_I(dir)->time = 0; /* force revalidate of dir as well */ unlink_out: @@ -2131,7 +2133,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) cifsInode->time = 0; inode_set_ctime_current(d_inode(direntry)); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); rmdir_exit: free_dentry_path(page); @@ -2337,9 +2339,6 @@ 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_mtime = target_dir->i_mtime = inode_set_ctime_to_ts(source_dir, - inode_set_ctime_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 9aeecee6b91b..f4849a8ad40b 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -1403,12 +1403,14 @@ smb2_close_getattr(const unsigned int xid, struct cifs_tcon *tcon, /* Creation time should not need to be updated on close */ if (file_inf.LastWriteTime) - inode->i_mtime = cifs_NTtimeToUnix(file_inf.LastWriteTime); + inode_set_mtime_to_ts(inode, + cifs_NTtimeToUnix(file_inf.LastWriteTime)); if (file_inf.ChangeTime) inode_set_ctime_to_ts(inode, cifs_NTtimeToUnix(file_inf.ChangeTime)); if (file_inf.LastAccessTime) - inode->i_atime = cifs_NTtimeToUnix(file_inf.LastAccessTime); + inode_set_atime_to_ts(inode, + cifs_NTtimeToUnix(file_inf.LastAccessTime)); /* * i_blocks is not related to (i_size / i_blksize), From patchwork Wed Oct 4 18:52: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: 148567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355510vqb; Wed, 4 Oct 2023 12:23:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/GpDL8dUSWABLZ92txIer8NYXNRG8kvc7inhGUFhI7A9ZWhOptf41noqzz5NSKfZ9N8ou X-Received: by 2002:a17:90b:23d8:b0:267:fba3:ed96 with SMTP id md24-20020a17090b23d800b00267fba3ed96mr2844057pjb.3.1696447430266; Wed, 04 Oct 2023 12:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447430; cv=none; d=google.com; s=arc-20160816; b=hgHb+QTWsxId3D3ji+Qgihu280CMMFoHaXYXnCGK39k/7DFnzd9jQAui8l3eEEiplp xOcUs5kWPOomFo1P2XSODyek1B7RsSHwIYuS8lknErpIIGmkgtR4RaEiSRT3Jvoa2Q0d AKKmwvBoYw/k7TIAyVOMZLK2jxr/4p2Q6TxOAVnwnIV42c68sZ7Oe0h9Z21K1HfoXm/C 5z5BifpyyuEcE7dtzWoWDnTxG+FFiENWeOfEe7RYIqFn9cY0kxYDo9OXBXaJbePFyfZi by2Jy78i+lDD8z/SjQ/Vbpa1tyHUFUC/0sPAywwFFKCEEHt3OwGmTHHFxWjCDQr2DefE GxLw== 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=eXwSktQtP4tCxssu3Nu+5Uh8ai/FTBiA0oPKL23CbVw=; fh=5fhsb7mGODlpL95j/1iQ6ZPX/BoBMAWQ3hWfXH8zC1o=; b=Ml4U31bIqORD70vzEmNdy8raatYAdb+wbdo0haVt23XBoLV/GRHbI0LM0783rF6YNj uUWMj719pWy23rAS9WVY6t/rX5g293dncAa9j/axOIJIibHlPSBfvu6mOILwBolKM5R5 82hj6n92xeaOpNmW4JYLDOTK5JZ+SthaHs8dVx8NMkUjemzuZPYAs9PTkMm5JfT3d4Tp eCHwIqjM0j8aIt5GoW0GkeeB3y7d6OIJdffv/XQstbwVJDKEkpwMbQm3637pq7EkUV9v MpuyIcji8bG8dFnhnQz/gIPvP3ZmHuDChLdSKTSR4FZ4z2kTf0BD8TeHLbu2OJGe6COl fTJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H0dMSKQM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t12-20020a1709028c8c00b001c46467a211si4212292plo.193.2023.10.04.12.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H0dMSKQM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 984CC8489E5F; Wed, 4 Oct 2023 12:23:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245276AbjJDS7g (ORCPT + 18 others); Wed, 4 Oct 2023 14:59:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244982AbjJDS5i (ORCPT ); Wed, 4 Oct 2023 14:57:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFD8E1BFB; Wed, 4 Oct 2023 11:55:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A81A3C43140; Wed, 4 Oct 2023 18:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445709; bh=C2sMGCifwVKgPH9B5NULLuhjFDkV30Ac28vR9ZpArJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H0dMSKQMuTar62s8aTrrgqnAAVo1fygmNDAZlzC7LIjlOAQTpW+bw2CXhsbT3f6l7 FsCcQhgkXqjYwJScf7XhohFQ9wIyiolRZCpA+CsJAnkaZbnFYSE5i79qD1qMpmkpSS 6kK5ehF2Ztll2jcw6nvCc5zSduIlbsdKB3Dorc4l0YDfTMCYTsaJVrCYN89BFMbBlD L0r4hJL6iXMAwOZ781Nkp0FfSMc0PzbN6J5jUpwx1ylyyD1b0jKeV8By6IcDAUQjQ/ 4rm6s5G4PseQwx+CA3FUwRnHHd3jvR/MpuDJ7CJVnkMMPHxnklXV2d0ONIpz5smNrY XX6nZuJvmJJKA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sergey Senozhatsky , Tom Talpey , linux-cifs@vger.kernel.org Subject: [PATCH v2 69/89] server: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:54 -0400 Message-ID: <20231004185347.80880-67-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854060990592345 X-GMAIL-MSGID: 1778854060990592345 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/smb/server/smb2pdu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c index 544022dd6d20..581f1deb1a03 100644 --- a/fs/smb/server/smb2pdu.c +++ b/fs/smb/server/smb2pdu.c @@ -4797,9 +4797,9 @@ static void find_file_posix_info(struct smb2_query_info_rsp *rsp, file_info = (struct smb311_posix_qinfo *)rsp->Buffer; file_info->CreationTime = cpu_to_le64(fp->create_time); - time = ksmbd_UnixTimeToNT(inode->i_atime); + time = ksmbd_UnixTimeToNT(inode_get_atime(inode)); file_info->LastAccessTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_mtime); + time = ksmbd_UnixTimeToNT(inode_get_mtime(inode)); file_info->LastWriteTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode_get_ctime(inode)); file_info->ChangeTime = cpu_to_le64(time); @@ -5406,9 +5406,9 @@ int smb2_close(struct ksmbd_work *work) rsp->EndOfFile = cpu_to_le64(inode->i_size); rsp->Attributes = fp->f_ci->m_fattr; rsp->CreationTime = cpu_to_le64(fp->create_time); - time = ksmbd_UnixTimeToNT(inode->i_atime); + time = ksmbd_UnixTimeToNT(inode_get_atime(inode)); rsp->LastAccessTime = cpu_to_le64(time); - time = ksmbd_UnixTimeToNT(inode->i_mtime); + time = ksmbd_UnixTimeToNT(inode_get_mtime(inode)); rsp->LastWriteTime = cpu_to_le64(time); time = ksmbd_UnixTimeToNT(inode_get_ctime(inode)); rsp->ChangeTime = cpu_to_le64(time); From patchwork Wed Oct 4 18:52: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: 148542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp345335vqb; Wed, 4 Oct 2023 12:05:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLQyy9BmB37rvWWYk61Q/6ocF8C+5gWXULbBdWfpQny4N47pdhO86C1gYE0SGguROmG2Sc X-Received: by 2002:a17:90a:4926:b0:273:6b28:9e30 with SMTP id c35-20020a17090a492600b002736b289e30mr3023007pjh.41.1696446300158; Wed, 04 Oct 2023 12:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446300; cv=none; d=google.com; s=arc-20160816; b=gQtK1UU4AQufeosVthWgfrixJzvu8QsIea2v4uB2Kt0TlL7xMPDehaIyRMIZsT2SXA xqZGnIYoGdP+JtAj6o6ujy41WLX/x2xqXWoOBnhfkhL7VcStRdnRhFnIMKDdj6pxXgeY 23u3CW0VDWpCXsIIh3sS3t8zH6TMbyxffjHdBngQnz57qCwqZoXHoUCeP5k2QVs3TAMD /bFF48Cm4hqMkDdnkFUu/66lZWRSnFjnQXxFHsl0pkMYEe9csObckldvdEQbo9V/JTMq MWGTDOCquHOLKPPvpdgaWoZD0iTXRQ6UipxJhejRt9Iw9nRgkvjhvt2puF5s0o4Ct77n sc6w== 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:to:from :dkim-signature; bh=Km54x7F60NCCZXYAbA0nWAXQgpomb2nBmhcfnOfJT8Q=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=QMT47RYiq3tT+LMm5f+bLjLio6/87IxJGsdPY/ZSSJ7KcZ842jB0S4CiG5YOreiTkV Bc8Py0d917t8c+KzMrV0PNivWzUO+1js4XudZj88ZKUk1hQOuB9TTCGDlaCdAVqu1cYU RZteRDqJzNhmoazdkZBCFCScldeLlmOUmDunQuyYeVWWN9W3QKxV1+Xl3VYupzQ7U15+ 6z3TVKgxgOYfPhiXBuYFFeQ5MqxKgkSrjjIKVoCuxjvIEnIYNQtkBgl+FGIfiLPql4O1 TIQdUhVjN8IXpweI89i8pQQIzcv+Zi64ZmnVyoRJZqXD1YyM21mgm5Cntk62i+iAPaaq T1mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="IqCYdL/2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id m189-20020a633fc6000000b00564929df8besi4236074pga.568.2023.10.04.12.04.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:05:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="IqCYdL/2"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 463058093D43; Wed, 4 Oct 2023 12:04:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245272AbjJDS7e (ORCPT + 19 others); Wed, 4 Oct 2023 14:59:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244981AbjJDS5i (ORCPT ); Wed, 4 Oct 2023 14:57:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7940E1BD3; Wed, 4 Oct 2023 11:55:10 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB4E8C433CA; Wed, 4 Oct 2023 18:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445710; bh=BarXufvXf2ktRprPzHNppo1XnC87rUiWSkDLJs3wtgM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IqCYdL/2Q7DHU2a6kZiAksUSC9udosFiIVjxa30pfzz/qefKqWnNKFN7yC73cWQ8s o2qBSzPNCObrNxI6QRI9cKDzAhDbRw8liTQt1dtwYXtt/25MjvBDLo9HEbBrQIEOt3 Z04vuAf2WgSLf69zxOE0GeFzuFqHgfjUdqDztel4bBWucbUfjxYhkVHadRC8TA5Pth hPifYve2XAt/F8gNd5KZ9y1Yt8M4/gymedNq2NBW5nyCmsPIWRf0vBFNW6EbLK2l/i VJzAFNMWw9jRiB80vOVW5SjUeYa/aIlPoq3DG3CqQp5JLXc+LnTV/VmiEZfAloz+pU jFUe3evo8bvGQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 70/89] squashfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:55 -0400 Message-ID: <20231004185347.80880-68-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:04:39 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852875146923687 X-GMAIL-MSGID: 1778852875146923687 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/squashfs/inode.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c index c6e626b00546..aa3411354e66 100644 --- a/fs/squashfs/inode.c +++ b/fs/squashfs/inode.c @@ -59,9 +59,9 @@ static int squashfs_new_inode(struct super_block *sb, struct inode *inode, i_uid_write(inode, i_uid); i_gid_write(inode, i_gid); 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_set_ctime(inode, inode->i_mtime.tv_sec, 0); + inode_set_mtime(inode, le32_to_cpu(sqsh_ino->mtime), 0); + inode_set_atime(inode, inode_get_mtime_sec(inode), 0); + inode_set_ctime(inode, inode_get_mtime_sec(inode), 0); inode->i_mode = le16_to_cpu(sqsh_ino->mode); inode->i_size = 0; From patchwork Wed Oct 4 18:52: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: 148535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp343206vqb; Wed, 4 Oct 2023 12:01:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpkOJ2hcVlEb3xbWVrtxl43ixYxm5oAugtabqIktTz72qcmdFBj9Xkf6TAcAO0XGzLOqVa X-Received: by 2002:a17:903:32cf:b0:1c5:8401:356c with SMTP id i15-20020a17090332cf00b001c58401356cmr3459540plr.62.1696446116467; Wed, 04 Oct 2023 12:01:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446116; cv=none; d=google.com; s=arc-20160816; b=dpbNDrKSC5n+I8lq3OXP3G8OghXJG91E/NBvxTRVf33h6DCrw2bi3Cnw6iEtOSaT7I QIeEhPKnZQ6R+lqYvSR/MG3XhGYi/uuMLmLYFw0zan/Ys3I8iCPwDenlPe/gEIt1z0L2 6FcVuSBQ8XFCz7PO17twMEVUMeGGDVc6O4k8mt2Zv714qld5O5qwHL36cMeGzewttibW NgomFcFWEw6LxDn6HvFSxZJrPAyDMxPZV0iZ2rOzF3phnKUX2n8MwnwIwq1IyW7Gn7ak fKm52LEkmmuTUz+C1Y963xDDNTNss8fi3F89f7tTP+VstxR6Zozn2+Z2HjuIs9h1V0Jf HOdg== 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:to:from :dkim-signature; bh=a1Rfxla9Gg4HWVIe4k/7J3Nm3ceW0Gr+ik5zeztbpQg=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=UOWf7YwwI1Kvv5geAbyVgig8smUj9iVK3rEZvvhS6gpMPvYv7LXWrGcLuzcJB1lfHu aEnSS5ZKQJ4bc3dznWlgcfxLHazPVEQKDcQ9oQPjObDQDbdaqb/4ek83GZ80ZFiE14hQ 1jlYwkz7OTBOwHKzRn35r1TbzHDZndN3oinThmdBNO+qywoyyVOvKxXnyBBBEhYkO+Uo 4fuUZXaEHsfj2NZnCq01ti9zEDvyERdnzqRQ3BcT/1MGJk5vr6lJdIrhNGL6hJRXJZ1T by3SdZmhKSWGyd1+Bjq4COahyPrgdyffjn0VCjr/CDsp0Y2+uGfwfwql+HhBvvcVsIMk kFqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ShrOxWUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id d10-20020a170902654a00b001c5e1c94588si4025158pln.550.2023.10.04.12.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ShrOxWUf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 5C57580756CC; Wed, 4 Oct 2023 12:00:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245159AbjJDTA2 (ORCPT + 19 others); Wed, 4 Oct 2023 15:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245088AbjJDS6Z (ORCPT ); Wed, 4 Oct 2023 14:58:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BF1D1BDF; Wed, 4 Oct 2023 11:55:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D7B5C433CB; Wed, 4 Oct 2023 18:55:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445711; bh=Jf/tgaFw2JwJVZViZFVmICop3c/4tpLGm/RvPo6JJs4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ShrOxWUf67smiUEzEWwq78XVsbjlrkZyK9rITImRb+4vh17rPGATcfp/fa/z8qeNR rLmv/nxdQ+iSe8QkMnnS5citNeMVw4oPt02RMM/S6Iuma+vkln6FjH2m+JGRMr07z1 jtrOQtVH55tSB4qd2mxgL7RGvpy4a5GRo9zbhIpJJQgQ6tI7xOfrqo3PfaA7qECpJm LSrRQTQVC5wR4iYjI/kXhP0uVFoJ99IlSzlQdmwQWKhOvgQQDvkqdEjbWFqzw1NjBw vigyBmb1Cu3qRhRYFDxj4vkDCZVFnw6fM7LTZjIWReypScJW+gI0F5ySiorK+rqA78 8ohn6b9vj3tBA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 71/89] sysv: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:56 -0400 Message-ID: <20231004185347.80880-69-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852683425305049 X-GMAIL-MSGID: 1778852683425305049 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/sysv/dir.c | 6 +++--- fs/sysv/ialloc.c | 2 +- fs/sysv/inode.c | 12 +++++------- fs/sysv/itree.c | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index 2f5ead88d00b..2e126d72d619 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); return sysv_handle_dirsync(inode); } diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index 6719da5889d9..269df6d49815 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_set_ctime_current(inode); + simple_inode_init_ts(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 0aa3827d8178..5a915b2e68f5 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -200,11 +200,9 @@ struct inode *sysv_iget(struct super_block *sb, unsigned int ino) i_gid_write(inode, (gid_t)fs16_to_cpu(sbi, raw_inode->i_gid)); set_nlink(inode, fs16_to_cpu(sbi, raw_inode->i_nlink)); 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_set_atime(inode, fs32_to_cpu(sbi, raw_inode->i_atime), 0); + inode_set_mtime(inode, fs32_to_cpu(sbi, raw_inode->i_mtime), 0); inode_set_ctime(inode, fs32_to_cpu(sbi, raw_inode->i_ctime), 0); - inode->i_atime.tv_nsec = 0; - inode->i_mtime.tv_nsec = 0; inode->i_blocks = 0; si = SYSV_I(inode); @@ -253,9 +251,9 @@ static int __sysv_write_inode(struct inode *inode, int wait) raw_inode->i_gid = cpu_to_fs16(sbi, fs_high2lowgid(i_gid_read(inode))); raw_inode->i_nlink = cpu_to_fs16(sbi, inode->i_nlink); 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_get_ctime(inode).tv_sec); + raw_inode->i_atime = cpu_to_fs32(sbi, inode_get_atime_sec(inode)); + raw_inode->i_mtime = cpu_to_fs32(sbi, inode_get_mtime_sec(inode)); + raw_inode->i_ctime = cpu_to_fs32(sbi, inode_get_ctime_sec(inode)); 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 edb94e55de8e..725981474e5f 100644 --- a/fs/sysv/itree.c +++ b/fs/sysv/itree.c @@ -423,7 +423,7 @@ void sysv_truncate (struct inode * inode) } n++; } - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (IS_SYNC(inode)) sysv_sync_inode (inode); else From patchwork Wed Oct 4 18:52: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: 148555 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp348774vqb; Wed, 4 Oct 2023 12:10:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFa3LvXwTEXq1N8Puu4BIkzMgiZ4wOsSZ5tuloI/XY2ABfOjWmtMHOD+dLp/2hyMJ5NVD1s X-Received: by 2002:a17:90a:9a94:b0:274:a861:4391 with SMTP id e20-20020a17090a9a9400b00274a8614391mr2817140pjp.40.1696446657300; Wed, 04 Oct 2023 12:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446657; cv=none; d=google.com; s=arc-20160816; b=ZCh5whQOv8UJQio9sR1QhrlriRyQWpkv6UtW2wiP7vnFMbHshw1TEM4JaCLcOXwSg4 I6ckuLK1TnxjdiR2D6ePmJY2IhtxWQ3W787F1O8qAC7qGg6XMq8Py1RWhTKWJq6InuXv G6mjvsseS5jUWO6Z9StXGZk9XUu9IlQ5x0u1VAytAszRxWYEmhaFMzmN7x6SsX9gFgCp USdCHvhonOUehJ36qiiDp7XlZji69izVJBwNLQQW4t3JHpkYJRIE59IsGNWxH2IOYoOV El7YPRNAfNdRstStyMoYorF8WFa5T3SvQuUlAE0aFwbMHGwdgg9eHmaMaVk8xTfEWzUA 3eNQ== 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=nkRgfmFQy8we0TIyvcPQed2G1pNZKRiEfv3gb6oRw2M=; fh=YrYPsgI6aDgoToY9/x6NbYk+xzgS1IfwawNeKZWLDos=; b=yMtZCewu4dn8uVWnDBY5wdtIGtM3B6cbT5USHmNFALSMrRc3wvWbY0XrIbM9C1739Z 349yQeEEGZo/CtNWdINxZx0gk1h/kwKvbouyLXDOZKY+rElz2VZJrfp1hI1blc/FXybe yEDne5qDTXX1OYB7Y0HZYxhc5rOnOFtvOhrugIKFP/mtfuA3pCiCCAaF8gcCB6OnddWu mkf7ABUufXjGNFAJEH8alpxpGiWIVoYa64SoJZr2rQRFQEq0OtmaCi9Y/IlUn616Turu R6359c8oWr/WDlY45D1VtW10hOeX9a3LsMiJIKN9Unl1ryzqD5E8n8NMQulwtQsCpITw vPxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ppAyk+Eg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id co10-20020a17090afe8a00b0027763ca82e9si2019180pjb.91.2023.10.04.12.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:10:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ppAyk+Eg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 3137681F3301; Wed, 4 Oct 2023 12:09:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245398AbjJDTIN (ORCPT + 19 others); Wed, 4 Oct 2023 15:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245383AbjJDTHk (ORCPT ); Wed, 4 Oct 2023 15:07:40 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19E3619AA; Wed, 4 Oct 2023 11:55:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17672C433C7; Wed, 4 Oct 2023 18:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445712; bh=XBmNDeJ7i675C+Gqvs30b2zycqgu44WCEf/N/NZrkg0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppAyk+Eg4X3oYeDh4VbHhyxo0RFdxGDi/En92Iktn7jh7p9zGA8ldu+i7QC2Xhr8y WrrMZgT4v+Mp2CNEcfRScrnNbpa18rPgQNGpVDosO7/R4lKeqFuvusHsYysTePlMow rtga7EjrMXOlVLruaWgXs0kYFQndnHjxd/ta17NZBykqSWWMBO7pDFN483vTM8EKtr Pr75rUcR44L/9FHe7HA0vUM+SDuyud6DM7Xn6rJbJInJuA1mEh+DHnG1Ct0iKo9ge/ HMZsp5iyhMeTHF1M7ZsfzW4SG9ovmua1ezR8QFlVYMcqpicCX3e91u+z9OGu3WkSDH OD7BUldhfXz/Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-trace-kernel@vger.kernel.org Subject: [PATCH v2 72/89] tracefs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:57 -0400 Message-ID: <20231004185347.80880-70-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:09:45 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778853250147001731 X-GMAIL-MSGID: 1778853250147001731 Convert to using the new inode timestamp accessor functions. 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 891653ba9cf3..429603d865a9 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -152,7 +152,7 @@ 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_set_ctime_current(inode); + simple_inode_init_ts(inode); } return inode; } From patchwork Wed Oct 4 18:52: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: 148547 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp347379vqb; Wed, 4 Oct 2023 12:08:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHa7uDctmZ6TohlYlShkxr/RZ3mx6GvkWCtsjWNLxdqhrn0X5AtZ+GrWFyPeBmKHqs0f5A0 X-Received: by 2002:a05:6a21:a5a8:b0:152:6b63:f1e5 with SMTP id gd40-20020a056a21a5a800b001526b63f1e5mr3983085pzc.38.1696446512632; Wed, 04 Oct 2023 12:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446512; cv=none; d=google.com; s=arc-20160816; b=it84Ohx7MabqFfxlGqS9NoNYf8R3an55zhSvOYIftQ/CdHu52NMhItmXWIMUpBxliN jt10sD3CcT9sXKPIFDCh5QqgL1e5yMgqoZr6BD0XBk/WOrGI6hruvNca+z1cWj0E84t2 Fxysdm2ZOhAReUw6Y4ndhGqxlwsE7cgBH+ioVKAj0WxWK/CWL0BSpPxdjhmbr86R3r6S p1xM+YV8I68rpEyjawAjVU6MQeH3i/xwG7TPhJXScZji6nBJvZty1zxch7SYB3BaEPPQ MxmRFqg6fWx79k1DyddUZXq1NVYJ/EvSo9jNZUoFrxhddVp0uwaIwakrVXkQZQp9IMz7 ko6g== 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=LoIVDZ6bBskXpwOXXA97GdSR/6GOQz1xS+RGY/EmCjU=; fh=9dbp+PVfJHvhQ2T/xAbsquROFmtfn3Q6xzmielwCmS0=; b=imjUufQgi6flgQj7WmCHqI5CE9Fbp+pi0d2rzgZKOl7+PTwAQw27B9gJZcXtJXCKUc X6Ge87rF0kS/DH61Pp005i4L8fSxuolIhTi+iFlW3viHyy66S0qipFIErErueAq41xma RQ6h/xVnvO0U06Hx9CDNP2x0qG04ZcNmJnmCEz/fgz7Kegwo+hMTwjqsklu5rNWEoVpN k3dzpZUeHWLNL3ydasaQ0uEXXPzcbH0iDCpm3rDzLEaNCZBFQ0PTjO8znwpBcZT6NdoO tBKrzdTubzqhTleI37ZVF/jc+HZWIXLcb/NI8icN8zh8UMp9cM/Puo/TO67Ih02y9Khk dKtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DRmjkNuo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k6-20020a170902c40600b001bbd70bdffbsi4644044plk.440.2023.10.04.12.08.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:08:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DRmjkNuo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 261918411D64; Wed, 4 Oct 2023 12:08:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245383AbjJDTIQ (ORCPT + 19 others); Wed, 4 Oct 2023 15:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245444AbjJDTHr (ORCPT ); Wed, 4 Oct 2023 15:07:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4526E1BE8; Wed, 4 Oct 2023 11:55:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E6B8C433C8; Wed, 4 Oct 2023 18:55:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445714; bh=Lyh66FBiI7e8TiDJrXRpQ2b/EtHjNFGdpdc1U69mMM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DRmjkNuoYWRuOtM4jCGCgTJktUwJYQEz06EM/nSpaqKIDHpr9xt2MhhmP7gMw9XC2 lqrUeOTEV8ieE0n0+mBF1WYcWOQaYku/qWXCoQY0ND8k5dHRP223m1dya/uMpelCHA /a4mNsUpxnbbg+YJm8eRv7wjps5GQlEsc2zbq4/UVvI0PnDlNgNqOYu1mVzYsMVOsr JdzDdJGAABNxCR64yaohtDeuN/oI9L+FXtfA0EPIW8m2RQJ8KnLMuymDWLmyv6Eb0b 6ICGxosl2NxIke5qxk3eflGyVyHufULGnXQGjR9F3ilPRjKpQzspAUWMQwdS+k4MZj R2pgUnfxNMHpA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-mtd@lists.infradead.org Subject: [PATCH v2 73/89] ubifs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:58 -0400 Message-ID: <20231004185347.80880-71-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:08:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778853098219474642 X-GMAIL-MSGID: 1778853098219474642 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ubifs/debug.c | 12 ++++++------ fs/ubifs/dir.c | 23 +++++++++++++++-------- fs/ubifs/file.c | 16 ++++++++-------- fs/ubifs/journal.c | 12 ++++++------ fs/ubifs/super.c | 8 ++++---- 5 files changed, 39 insertions(+), 32 deletions(-) diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index eef9e527d9ff..d013c5b3f1ed 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -237,14 +237,14 @@ void ubifs_dump_inode(struct ubifs_info *c, const struct inode *inode) pr_err("\tuid %u\n", (unsigned int)i_uid_read(inode)); pr_err("\tgid %u\n", (unsigned int)i_gid_read(inode)); pr_err("\tatime %u.%u\n", - (unsigned int)inode->i_atime.tv_sec, - (unsigned int)inode->i_atime.tv_nsec); + (unsigned int) inode_get_atime_sec(inode), + (unsigned int) inode_get_atime_nsec(inode)); pr_err("\tmtime %u.%u\n", - (unsigned int)inode->i_mtime.tv_sec, - (unsigned int)inode->i_mtime.tv_nsec); + (unsigned int) inode_get_mtime_sec(inode), + (unsigned int) inode_get_mtime_nsec(inode)); pr_err("\tctime %u.%u\n", - (unsigned int) inode_get_ctime(inode).tv_sec, - (unsigned int) inode_get_ctime(inode).tv_nsec); + (unsigned int) inode_get_ctime_sec(inode), + (unsigned int) inode_get_ctime_nsec(inode)); 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 2f48c58d47cd..7af442de44c3 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -96,7 +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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_mapping->nrpages = 0; if (!is_xattr) { @@ -324,7 +324,8 @@ 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 = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -767,7 +768,8 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir, inode_set_ctime_current(inode); dir->i_size += sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -841,7 +843,8 @@ static int ubifs_unlink(struct inode *dir, struct dentry *dentry) drop_nlink(inode); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 1, 0); if (err) goto out_cancel; @@ -944,7 +947,8 @@ static int ubifs_rmdir(struct inode *dir, struct dentry *dentry) drop_nlink(dir); dir->i_size -= sz_change; dir_ui->ui_size = dir->i_size; - dir->i_mtime = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 1, 0); if (err) goto out_cancel; @@ -1018,7 +1022,8 @@ 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 = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) { ubifs_err(c, "cannot create directory, error %d", err); @@ -1109,7 +1114,8 @@ 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 = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; @@ -1209,7 +1215,8 @@ 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 = inode_set_ctime_to_ts(dir, inode_get_ctime(inode)); + inode_set_mtime_to_ts(dir, + inode_set_ctime_to_ts(dir, inode_get_ctime(inode))); err = ubifs_jnl_update(c, dir, &nm, inode, 0, 0); if (err) goto out_cancel; diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index e5382f0b2587..2e65fd2dbdc3 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -1088,9 +1088,9 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr) if (attr->ia_valid & ATTR_GID) inode->i_gid = attr->ia_gid; if (attr->ia_valid & ATTR_ATIME) - inode->i_atime = attr->ia_atime; + inode_set_atime_to_ts(inode, attr->ia_atime); if (attr->ia_valid & ATTR_MTIME) - inode->i_mtime = attr->ia_mtime; + inode_set_mtime_to_ts(inode, attr->ia_mtime); if (attr->ia_valid & ATTR_CTIME) inode_set_ctime_to_ts(inode, attr->ia_ctime); if (attr->ia_valid & ATTR_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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); /* 'truncate_setsize()' changed @i_size, update @ui_size */ ui->ui_size = inode->i_size; } @@ -1365,9 +1365,9 @@ static inline int mctime_update_needed(const struct inode *inode, const struct timespec64 *now) { struct timespec64 ctime = inode_get_ctime(inode); + struct timespec64 mtime = inode_get_mtime(inode); - if (!timespec64_equal(&inode->i_mtime, now) || - !timespec64_equal(&ctime, now)) + if (!timespec64_equal(&mtime, now) || !timespec64_equal(&ctime, now)) return 1; return 0; } @@ -1429,7 +1429,7 @@ static int update_mctime(struct inode *inode) return err; mutex_lock(&ui->ui_mutex); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); release = ui->dirty; mark_inode_dirty_sync(inode); mutex_unlock(&ui->ui_mutex); @@ -1567,7 +1567,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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 ffc9beee7be6..d69d2154645b 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -452,12 +452,12 @@ static void pack_inode(struct ubifs_info *c, struct ubifs_ino_node *ino, ino->ch.node_type = UBIFS_INO_NODE; ino_key_init_flash(c, &ino->key, inode->i_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_get_ctime(inode).tv_sec); - ino->ctime_nsec = cpu_to_le32(inode_get_ctime(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->atime_sec = cpu_to_le64(inode_get_atime_sec(inode)); + ino->atime_nsec = cpu_to_le32(inode_get_atime_nsec(inode)); + ino->ctime_sec = cpu_to_le64(inode_get_ctime_sec(inode)); + ino->ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); + ino->mtime_sec = cpu_to_le64(inode_get_mtime_sec(inode)); + ino->mtime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode)); ino->uid = cpu_to_le32(i_uid_read(inode)); ino->gid = cpu_to_le32(i_gid_read(inode)); ino->mode = cpu_to_le32(inode->i_mode); diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 96f6a9118207..0d0478815d4d 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -138,10 +138,10 @@ struct inode *ubifs_iget(struct super_block *sb, unsigned long inum) set_nlink(inode, le32_to_cpu(ino->nlink)); i_uid_write(inode, le32_to_cpu(ino->uid)); i_gid_write(inode, le32_to_cpu(ino->gid)); - inode->i_atime.tv_sec = (int64_t)le64_to_cpu(ino->atime_sec); - 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_set_atime(inode, (int64_t)le64_to_cpu(ino->atime_sec), + le32_to_cpu(ino->atime_nsec)); + inode_set_mtime(inode, (int64_t)le64_to_cpu(ino->mtime_sec), + le32_to_cpu(ino->mtime_nsec)); inode_set_ctime(inode, (int64_t)le64_to_cpu(ino->ctime_sec), le32_to_cpu(ino->ctime_nsec)); inode->i_mode = le32_to_cpu(ino->mode); From patchwork Wed Oct 4 18:52: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: 148537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp343234vqb; Wed, 4 Oct 2023 12:01:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGv4GjsumunrkPvjuxaOksFI3EmJjBzizFmtxvMqLbK8ZHSCu4Lsg8kyUutuJtDg9wUJR3u X-Received: by 2002:a17:903:1208:b0:1c3:92de:1b23 with SMTP id l8-20020a170903120800b001c392de1b23mr3976866plh.59.1696446118276; Wed, 04 Oct 2023 12:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446118; cv=none; d=google.com; s=arc-20160816; b=sbKDRMf4Y5TJuVPP6nsiZ/gtX/JnVRhRccT1aDrx1Yg5ogH4eFZnho+MNFdlaMuI++ AIel1r18Tas7OZkaiuFqCWrweOAtl3kSwXpQFpEPxPsT7FtqIMkIbm8Yybqk9/WNmhzw xnD3tUSXU2WMzw0cA7RcJsxvwSPp7PEjnee1XNJO56q5oMxBU/fMTUveYoJBUWvoLEH5 wG/LW+HzfNEIG0RHgn4zzy1mWuFoh5mpWkDnboQmAXI3NZViIJfgzov0GRvs8iyD3Xdp PkgxXA9I7BXVhVKfTbdZyGIe3oc4Yo4BczkASbS+ljZ64i6BYf61VjCr516OGkOpX/QH 8wkQ== 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:to:from :dkim-signature; bh=dlyXXyuFn59nG9OYRygg2WvA6OxOYVRNumdTs350yMg=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=YCWY2ppc5gppmaY9JERrtvTn6wpOIKnV7Az3/YDVm+pxEVffNxWtZDLAbvzvM4kvSP Z0Fx1YkZik50WX82I6tIJgWupHhVEgF8n9w+zO8mapJ12nsilq5dmWb/ROwe59UyDRG7 7hs6AVep8ge9+2u/CA2itwpwp9rPECN8gV9XOiOlPSWPq+gpQdLAi4tFmbQtukH81+lJ ZECmYcx4m4bsYUjGZBS/uGB8Ru9fwfNBap3WX8tM7q40WJnuOw/lQyfA95ASoTSCNcFZ 3yQvIGJSrQAAfRdJBIUY311+Ik6FaS6kPZ+qmm65w9xPjvpBuDat1pRsxrUHEiMtMZLc aHNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LIpqcTRN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k18-20020a170902c41200b001b7d2b55d8asi4788149plk.626.2023.10.04.12.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LIpqcTRN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4376080A44D2; Wed, 4 Oct 2023 12:00:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245306AbjJDTAr (ORCPT + 19 others); Wed, 4 Oct 2023 15:00:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245123AbjJDS6p (ORCPT ); Wed, 4 Oct 2023 14:58:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAA67126; Wed, 4 Oct 2023 11:55:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0708C433C9; Wed, 4 Oct 2023 18:55:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445715; bh=RJedcd0N98toISTDqRYwkieG7DCuEBxX78QaIUnOLeU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LIpqcTRN62xrhkjIbLLz2L5StBxlBAS6QjkkRpksfZLILlsDF5Y1iMh1sjUXQpi9s /mxPT62/A7H2T8d3yVaJOWAEytMWPJKivHyhhOUiVLxiLcAhLE0bhjQEY824M+mGNE v4f/9XvNhLFAdF36oeEVwUrtWhOot+Ve/zgk7DO3J/THA9r7ePsR2n053AtWoTanZ1 mabWOHb054ld9hMnBO3xrAECZpkGB50kQx9TRmg8w1jaCh+HsMpaw2GxjoT6RQ4O7S i8t2xdchuR7xJDU7RTOJCztNiP32xus6djW7UIHisF/ri1hVTp59rC5Kr/XXTTVIEB pK0inceO1ntTQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 74/89] udf: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:52:59 -0400 Message-ID: <20231004185347.80880-72-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:00:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852684766314507 X-GMAIL-MSGID: 1778852684766314507 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/udf/ialloc.c | 4 ++-- fs/udf/inode.c | 38 ++++++++++++++++++++++---------------- fs/udf/namei.c | 16 ++++++++-------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index 6b558cbbeb6b..5f1f969f4134 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c @@ -100,8 +100,8 @@ 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_set_ctime_current(inode); - iinfo->i_crtime = inode->i_mtime; + simple_inode_init_ts(inode); + iinfo->i_crtime = inode_get_mtime(inode); if (unlikely(insert_inode_locked(inode) < 0)) { make_bad_inode(inode); iput(inode); diff --git a/fs/udf/inode.c b/fs/udf/inode.c index a17a6184cc39..d8493449d4c5 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -1296,7 +1296,7 @@ int udf_setsize(struct inode *inode, loff_t newsize) goto out_unlock; } update_time: - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); if (IS_SYNC(inode)) udf_sync_inode(inode); else @@ -1327,7 +1327,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; + struct timespec64 ts; reread: if (iloc->partitionReferenceNum >= sbi->s_partitions) { @@ -1504,10 +1504,12 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) 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(&ctime, fe->attrTime); - inode_set_ctime_to_ts(inode, ctime); + udf_disk_stamp_to_time(&ts, fe->accessTime); + inode_set_atime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, fe->modificationTime); + inode_set_mtime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, fe->attrTime); + inode_set_ctime_to_ts(inode, ts); iinfo->i_unique = le64_to_cpu(fe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); @@ -1519,11 +1521,13 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << (inode->i_sb->s_blocksize_bits - 9); - 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(&ts, efe->accessTime); + inode_set_atime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, efe->modificationTime); + inode_set_mtime_to_ts(inode, ts); + udf_disk_stamp_to_time(&ts, efe->attrTime); + inode_set_ctime_to_ts(inode, ts); udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); - udf_disk_stamp_to_time(&ctime, efe->attrTime); - inode_set_ctime_to_ts(inode, ctime); iinfo->i_unique = le64_to_cpu(efe->uniqueID); iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); @@ -1798,8 +1802,8 @@ static int udf_update_inode(struct inode *inode, int do_sync) inode->i_sb->s_blocksize - sizeof(struct fileEntry)); fe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); - 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->accessTime, inode_get_atime(inode)); + udf_time_to_disk_stamp(&fe->modificationTime, inode_get_mtime(inode)); udf_time_to_disk_stamp(&fe->attrTime, inode_get_ctime(inode)); memset(&(fe->impIdent), 0, sizeof(struct regid)); strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); @@ -1829,12 +1833,14 @@ static int udf_update_inode(struct inode *inode, int do_sync) cpu_to_le32(inode->i_sb->s_blocksize); } - udf_adjust_time(iinfo, inode->i_atime); - udf_adjust_time(iinfo, inode->i_mtime); + udf_adjust_time(iinfo, inode_get_atime(inode)); + udf_adjust_time(iinfo, inode_get_mtime(inode)); udf_adjust_time(iinfo, inode_get_ctime(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->accessTime, + inode_get_atime(inode)); + udf_time_to_disk_stamp(&efe->modificationTime, + inode_get_mtime(inode)); udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); udf_time_to_disk_stamp(&efe->attrTime, inode_get_ctime(inode)); diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ae55ab8859b6..3508ac484da3 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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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); - 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))); mark_inode_dirty(dir); ret = 0; end_rmdir: @@ -555,7 +555,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) set_nlink(inode, 1); } udf_fiiter_delete_entry(&iter); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); inode_dec_link_count(inode); udf_add_fid_counter(dir->i_sb, false, -1); @@ -748,7 +748,7 @@ static int udf_link(struct dentry *old_dentry, struct inode *dir, udf_add_fid_counter(dir->i_sb, false, 1); inode_set_ctime_current(inode); mark_inode_dirty(inode); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); mark_inode_dirty(dir); ihold(inode); d_instantiate(dentry, inode); @@ -866,8 +866,8 @@ static int udf_rename(struct mnt_idmap *idmap, struct inode *old_dir, udf_add_fid_counter(old_dir->i_sb, S_ISDIR(new_inode->i_mode), -1); } - old_dir->i_mtime = inode_set_ctime_current(old_dir); - new_dir->i_mtime = inode_set_ctime_current(new_dir); + inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir)); + inode_set_mtime_to_ts(new_dir, inode_set_ctime_current(new_dir)); mark_inode_dirty(old_dir); mark_inode_dirty(new_dir); From patchwork Wed Oct 4 18:53: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: 148562 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355322vqb; Wed, 4 Oct 2023 12:23:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoOCC1/PD6bEalXDQnCF35nyh6HUGAlgrfXK53Tf5Fc4513OFTiiNMj500rVRoWCmeP1Je X-Received: by 2002:a17:902:b607:b0:1bb:30c5:835a with SMTP id b7-20020a170902b60700b001bb30c5835amr2916961pls.7.1696447405695; Wed, 04 Oct 2023 12:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447405; cv=none; d=google.com; s=arc-20160816; b=OUo1fUR1li83v3SJ7RsmyBiI9DUdisTHc4djwFmiepytgGLiGcchVtNl7CtUb9qKxM uu2Ty9sPpOodGjU8WxRs8RMu8682UrJF55HTqCUEOpfhZjor44bfOdLf7YyrPJP6EECp VOh+BqJMzgw1ooTJAb1oErfrxhI2x+hyUltyA4y503q7UKh1pUW1f0Q5cVKG6xbT2JOK DjdVfe7czAMsqjfChX9tYEtX1Dg26N1MjTvR/Ab8C/pYcOyWhC3jJIqerghUfWaTPByb LP6U0QTK/+bONxayknwXYsOCmGUfqbiqpidK3GYCycCO8t0zmPIHIAWZBtedTCLeCm6f /lxw== 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:to:from :dkim-signature; bh=6RsHCiAN2pHffX6g2t+ANsxz81DEatQTcbQ1niSvA2A=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=awfOTPv2zDNvAQMq+jW5gI0KlT5D0j1z2D5xL+OrM8P14FbC3OSUUDBlR1VwCpjMns ceCWMWCmS6TgOtoiWmNzlMYPWDlKMBpTDdLjp7OxUOfcOO4/pFzYWm9bgpEqmtGGlCIe sVIdQ4ro9cKHvR/65BJuP8HgdfXivoPrY/AIr+Dtsa8B/GXcIR+Z/uWyofvJUmB6Txp8 FBz2paRPhngSHOeceu9TfNQJyDTwiU5xjGAwZFaGByCdYoCtQ97azpQ/uK90voZogMRx bW+uOF/GqwGNu9PboJA/4RPTZLjgGve2GofbZLvXleWkc6X/J1C0tyuCjU9wcf03RyUL 2sAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BD/kRVgy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j21-20020a170902c3d500b001b3bd85f54bsi4149273plj.35.2023.10.04.12.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="BD/kRVgy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F0C448271746; Wed, 4 Oct 2023 12:23:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245290AbjJDTAi (ORCPT + 19 others); Wed, 4 Oct 2023 15:00:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244908AbjJDS6g (ORCPT ); Wed, 4 Oct 2023 14:58:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F36D5180; Wed, 4 Oct 2023 11:55:16 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 075A2C433CA; Wed, 4 Oct 2023 18:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445716; bh=VbCo0eKc8ekxrhUBcrDBQ1C0dDKwLWbCq7bj/cpDt4g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BD/kRVgy9ga/NCA2u9pnBJjdOPaT7EucAU9hoH3MnYVHGXfYn83ng1JBORwVFwo/W FQT42l/MP/NJ/XN4pux5ewDTHDLMhREnNM8OJ3xzEEq7nX4DcZpyjCyl6olL3s1KNT qGvfm45sOkyRBGmjKeklft8yTKYyfJRnLsMXFCMsvnbEXVC5trOY8K3YrgXSB3GNw7 ibNnf/7VQPmHsxbbmE96OGdB32horwnxIp8w+mIM7+9Gg6e1vCezu7qb7Ap6fU1Dry h3ZeDoFmTjv/cXezzK23i/wm+l561/4k0k/1lQeFaOUtFovMLjkMKwYn/pSdiyLYXe gtLywmuZ8hDcA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 75/89] ufs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:00 -0400 Message-ID: <20231004185347.80880-73-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854034837423151 X-GMAIL-MSGID: 1778854034837423151 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/ufs/dir.c | 6 +++--- fs/ufs/ialloc.c | 2 +- fs/ufs/inode.c | 42 ++++++++++++++++++++++++------------------ 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/fs/ufs/dir.c b/fs/ufs/dir.c index fd57f03b6c93..27c85d92d1dc 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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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 = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_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_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_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 a1e7bd9d1f98..73531827ecee 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_set_ctime_current(inode); + simple_inode_init_ts(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 21a4779a2de5..338e4b97312f 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c @@ -579,13 +579,15 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode) i_gid_write(inode, ufs_get_inode_gid(sb, 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_set_atime(inode, + (signed)fs32_to_cpu(sb, ufs_inode->ui_atime.tv_sec), + 0); inode_set_ctime(inode, (signed)fs32_to_cpu(sb, ufs_inode->ui_ctime.tv_sec), 0); - 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_set_mtime(inode, + (signed)fs32_to_cpu(sb, ufs_inode->ui_mtime.tv_sec), + 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,12 +628,12 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode) i_gid_write(inode, fs32_to_cpu(sb, ufs2_inode->ui_gid)); 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_set_atime(inode, fs64_to_cpu(sb, ufs2_inode->ui_atime), + fs32_to_cpu(sb, ufs2_inode->ui_atimensec)); inode_set_ctime(inode, fs64_to_cpu(sb, ufs2_inode->ui_ctime), fs32_to_cpu(sb, ufs2_inode->ui_ctimensec)); - 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_mtime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_mtimensec); + inode_set_mtime(inode, fs64_to_cpu(sb, ufs2_inode->ui_mtime), + 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); ufsi->i_flags = fs32_to_cpu(sb, ufs2_inode->ui_flags); @@ -725,12 +727,14 @@ static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode) ufs_set_inode_gid(sb, ufs_inode, i_gid_read(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_sec = cpu_to_fs32(sb, + inode_get_atime_sec(inode)); ufs_inode->ui_atime.tv_usec = 0; ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, - inode_get_ctime(inode).tv_sec); + inode_get_ctime_sec(inode)); 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_sec = cpu_to_fs32(sb, + inode_get_mtime_sec(inode)); ufs_inode->ui_mtime.tv_usec = 0; ufs_inode->ui_blocks = cpu_to_fs32(sb, inode->i_blocks); ufs_inode->ui_flags = cpu_to_fs32(sb, ufsi->i_flags); @@ -770,13 +774,15 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode) ufs_inode->ui_gid = cpu_to_fs32(sb, i_gid_read(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_get_ctime(inode).tv_sec); + ufs_inode->ui_atime = cpu_to_fs64(sb, inode_get_atime_sec(inode)); + ufs_inode->ui_atimensec = cpu_to_fs32(sb, + inode_get_atime_nsec(inode)); + ufs_inode->ui_ctime = cpu_to_fs64(sb, inode_get_ctime_sec(inode)); ufs_inode->ui_ctimensec = cpu_to_fs32(sb, - inode_get_ctime(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); + inode_get_ctime_nsec(inode)); + ufs_inode->ui_mtime = cpu_to_fs64(sb, inode_get_mtime_sec(inode)); + ufs_inode->ui_mtimensec = cpu_to_fs32(sb, + inode_get_mtime_nsec(inode)); ufs_inode->ui_blocks = cpu_to_fs64(sb, inode->i_blocks); ufs_inode->ui_flags = cpu_to_fs32(sb, ufsi->i_flags); @@ -1208,7 +1214,7 @@ static int ufs_truncate(struct inode *inode, loff_t size) truncate_setsize(inode, size); ufs_truncate_blocks(inode); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); mark_inode_dirty(inode); out: UFSD("EXIT: err %d\n", err); From patchwork Wed Oct 4 18:53: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: 148560 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355197vqb; Wed, 4 Oct 2023 12:23:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUpXmx5fDsZC4bx0k42C8uq7+g4k7+9K4yyVldCgp1xk8eQGksrVMSoQc3sJh764eUeUc8 X-Received: by 2002:a17:90b:124c:b0:279:98f6:deac with SMTP id gx12-20020a17090b124c00b0027998f6deacmr3167610pjb.20.1696447393173; Wed, 04 Oct 2023 12:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447393; cv=none; d=google.com; s=arc-20160816; b=xABvoUlQU5pdXEUES2HYAyjtTq1FDOYlIbXGEkbkRC4jxG0Gr5evMrnxsusA67vfwp GIjl4WIKlWMwf77SjYffOOA+0dPqX8Nh+r1SQ5e2UvuGNfA3XpGFVWogq0joO9xRJZMO cRvqA1by64wjmxC8XiWCmWLXFBRYT/cbzyzrHonSN4m+RvEUspHeKyGBAYAL9BaujDmE G81jIh8uqzEG5TgpzPVO0e+y0Zxg6rktieOnkLtYEezBHtJU5DXHgR6sYBPSlyQSq5iA A/gb4DoxYfSbJKYuc2Z5lr4AXIs5tzK+DfwTwvBje7rp7Tzbb0791cuHM2eXNoNOHojH shiA== 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:to:from :dkim-signature; bh=r3dc2nRw6jMMvLMCQ2OvZPU+n2DDHi5snYupHQJCgxE=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=uma2DLEFvQzyFaxnROSbcSIgk6anD6N8TpqJX+Tr1PKqFNseEwyUAc+oVy1X+jZnJc h/pw8GC9NXKnfTSWoYcr5HyYhpq8KDmc4fbEcEopzPQlnrZj82Phr9yoIIHqMIzbPOrx 1v/dbSGgW1msy3CnKysAJ/8tLmsabNWV2sC7Y6ATssw4p/h6y83tDGwjfq0+UWNob/FH PqM20q7BMiTseAw4SPjLE5kJGJgPXhQ2keRwFONKpVOjn8tXva26zdNT3j24sZ6Q9fn6 8IE/zWUQMR5Sha0gLj4HO0TgaWfPBhrepQBnh+hdb4ya4o+x+1pFWJgr+w3rojP65d8A sf6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ismg/J/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a8-20020a17090ad80800b0027761a3a4b0si2131734pjv.0.2023.10.04.12.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Ismg/J/W"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 8B6E78184E3F; Wed, 4 Oct 2023 12:23:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245316AbjJDTA7 (ORCPT + 19 others); Wed, 4 Oct 2023 15:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244936AbjJDS7D (ORCPT ); Wed, 4 Oct 2023 14:59:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E762610C6; Wed, 4 Oct 2023 11:55:17 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04C18C433CC; Wed, 4 Oct 2023 18:55:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445717; bh=78x5FOKJ4pJ0GRw5ASlWg2VLmVN1uACyyEUJyyEHhFs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ismg/J/W8acoWAloIwD82D6YteudQRf4/7EhDQ4uEWHSKRwD4FipLrvKsh6j3jLMc Ycgn3Sd2pdb1/LCLz+2Cqv9DE2eLWZgNklc6j90ZYhLP7zy7t6lvt02CMOSSuJtTcE 3XKTbix/LUmHjfBbn9NUG/6D2JFcBXk2pPgf0KX0uEs4X4HMgGRnUkF5H8DpN9wIKN 98mS3ERLgq7XN6LDG8VVtpqZbslfitcjKo/JjzIlRauBm1iBLXPvRTxQ2iEy8zM+aP eSszRaUhnanJMRDs7E9koFxiRdvzowWxcoy8vFFg0T8BmP6/gJ2bQ9mYqt2SMNlhOa UJZ7niAeAhduQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 76/89] vboxsf: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:01 -0400 Message-ID: <20231004185347.80880-74-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854021707437169 X-GMAIL-MSGID: 1778854021707437169 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/vboxsf/utils.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/vboxsf/utils.c b/fs/vboxsf/utils.c index 83f20dd15522..72ac9320e6a3 100644 --- a/fs/vboxsf/utils.c +++ b/fs/vboxsf/utils.c @@ -126,12 +126,12 @@ int vboxsf_init_inode(struct vboxsf_sbi *sbi, struct inode *inode, do_div(allocated, 512); inode->i_blocks = allocated; - inode->i_atime = ns_to_timespec64( - info->access_time.ns_relative_to_unix_epoch); + inode_set_atime_to_ts(inode, + ns_to_timespec64(info->access_time.ns_relative_to_unix_epoch)); inode_set_ctime_to_ts(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); + inode_set_mtime_to_ts(inode, + ns_to_timespec64(info->modification_time.ns_relative_to_unix_epoch)); return 0; } @@ -194,7 +194,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry) struct vboxsf_sbi *sbi; struct vboxsf_inode *sf_i; struct shfl_fsobjinfo info; - struct timespec64 prev_mtime; + struct timespec64 mtime, prev_mtime; struct inode *inode; int err; @@ -202,7 +202,7 @@ int vboxsf_inode_revalidate(struct dentry *dentry) return -EINVAL; inode = d_inode(dentry); - prev_mtime = inode->i_mtime; + prev_mtime = inode_get_mtime(inode); sf_i = VBOXSF_I(inode); sbi = VBOXSF_SBI(dentry->d_sb); if (!sf_i->force_restat) { @@ -225,7 +225,8 @@ int vboxsf_inode_revalidate(struct dentry *dentry) * page-cache for it. Note this also gets triggered by our own writes, * this is unavoidable. */ - if (timespec64_compare(&inode->i_mtime, &prev_mtime) > 0) + mtime = inode_get_mtime(inode); + if (timespec64_compare(&mtime, &prev_mtime) > 0) invalidate_inode_pages2(inode->i_mapping); return 0; From patchwork Wed Oct 4 18:53: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: 148553 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp348737vqb; Wed, 4 Oct 2023 12:10:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt9Ua5OX4S1jR+z4wpo++xc/bDbYrIT4pNXhoqTg/5PPNEpN4tSEQd/+HR41x7/iFK5/dz X-Received: by 2002:a17:902:e852:b0:1c5:59dc:6e93 with SMTP id t18-20020a170902e85200b001c559dc6e93mr858209plg.3.1696446653623; Wed, 04 Oct 2023 12:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446653; cv=none; d=google.com; s=arc-20160816; b=E0Nj8bM/CbNEDf1TxavZMkBg80vpCPpsmo48D7ze1bRAu4nhcojdYz01xj3cO2Rq76 XO1YDDOtPn4GLdj6peIV2VclPjVrfU5avbWvRMiGBkJjfZmPfCdveNfY1890xjN2sbPZ ZSD8g/cYCRq8BUGJd6Be0kv0BYHnlITeW69Re1kFK4g96mm2rFD/6y8hEXtsCEzKb6Ri jTLSheLDF5erJHx3YjZT1b63FYaI5jJCbOd6kGg/AF8eq3vP5SaajfiFM9tXXagYlXQY MmmSY5QT1cAce6/xNUlUT4eTUTECvR/6uq57P7h81uoQOMTTOEA29WeeMhUU9gpJQLLL Pa+g== 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=hzkyujtTWsM/M++UkP1cmcEORuhKB/8UpaTYzXH9uDA=; fh=UjFDZgIoGRf1xjRPVQNYcJg+7dmGrO7W0xsuCCC32Bo=; b=B5bY6egNP8vriN/jYHhv//hNta09r6+u8UX0/ztOszuqOyaw7IW4Zk7LQ6Q4cxgHab jAFCBbVjpqswJIFnHBaFOgUgCO+MkvFmGsSfDIgolFdzZUBSF4lqZ28gYyZod0rtb3nc IrAGt/fO9VQ4ioE+tE8U+fL3rS0KNVTQlQG4QEshKMaWP7xxMegmyo3KgI9P3QsFACb2 H5tsGnF+ZtfMX/6KBKCPtj/zlaU3WlYKyBn+Qn/7bg+ocHVSNCUKKq8uWvKyIU6BRScF olQgNlhrN+OXwvKo/M2E2g6dFp8o9/J1VYvXdQOvbqXfYs++2+kHRmwh1Y54BsfrWb/U Iz6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NaAcmkyp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id u10-20020a170902e80a00b001c56edc4b7asi4696642plg.278.2023.10.04.12.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:10:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NaAcmkyp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 5392E808738B; Wed, 4 Oct 2023 12:10:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245156AbjJDTI1 (ORCPT + 19 others); Wed, 4 Oct 2023 15:08:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245500AbjJDTIB (ORCPT ); Wed, 4 Oct 2023 15:08:01 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E1FF10DD; Wed, 4 Oct 2023 11:55:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8C94C433C7; Wed, 4 Oct 2023 18:55:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445719; bh=IjkUPhbmYczYkXpzgrTEcDFuI4tfjCDPQMycSKoo/uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NaAcmkyp9t16v9NaW85TlKfJSpvzj6u1RoepQQCDzss+0J3qRaolSk3f0kJbnMC7X ZYyqHg1pXEmrjwf0QmXTm4/KKpMQDnDsm9mM2vjM55N1q1V1Ysv9zHQnPTCMP47Ne4 17VoAlSpZIrHQgvzN95on39fmtEs7CgE7brE9LRz4USnzaoSkbS1JsdXzSBkkcjnii Lyw+OrAyCrGM7NKAXP6prg1ZdSEqG0ddY6strTXw9ukiOQ2e0+URj82j8vuMeuCnM8 f5L8kH2q2zgtdmxAFPRQo2TbXUWEZDqLdImQ16S6va1JwjC4ItR+qAXzgYzweBhHTM EUu8hh4sjMXvg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: [PATCH v2 77/89] xfs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:02 -0400 Message-ID: <20231004185347.80880-75-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:10:08 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778853246321652825 X-GMAIL-MSGID: 1778853246321652825 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/xfs/libxfs/xfs_inode_buf.c | 10 ++++++---- fs/xfs/libxfs/xfs_rtbitmap.c | 6 +++++- fs/xfs/libxfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_bmap_util.c | 7 ++++--- fs/xfs/xfs_inode.c | 4 ++-- fs/xfs/xfs_inode_item.c | 4 ++-- fs/xfs/xfs_iops.c | 8 ++++---- fs/xfs/xfs_itable.c | 12 ++++++------ fs/xfs/xfs_rtalloc.c | 30 ++++++++++++++++-------------- 9 files changed, 46 insertions(+), 37 deletions(-) diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c index a35781577cad..543f3748c2a3 100644 --- a/fs/xfs/libxfs/xfs_inode_buf.c +++ b/fs/xfs/libxfs/xfs_inode_buf.c @@ -220,8 +220,10 @@ xfs_inode_from_disk( * a time before epoch is converted to a time long after epoch * on 64 bit systems. */ - 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_set_atime_to_ts(inode, + xfs_inode_from_disk_ts(from, from->di_atime)); + inode_set_mtime_to_ts(inode, + xfs_inode_from_disk_ts(from, from->di_mtime)); inode_set_ctime_to_ts(inode, xfs_inode_from_disk_ts(from, from->di_ctime)); @@ -315,8 +317,8 @@ xfs_inode_to_disk( to->di_projid_lo = cpu_to_be16(ip->i_projid & 0xffff); to->di_projid_hi = cpu_to_be16(ip->i_projid >> 16); - 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_atime = xfs_inode_to_disk_ts(ip, inode_get_atime(inode)); + to->di_mtime = xfs_inode_to_disk_ts(ip, inode_get_mtime(inode)); to->di_ctime = xfs_inode_to_disk_ts(ip, inode_get_ctime(inode)); to->di_nlink = cpu_to_be32(inode->i_nlink); to->di_gen = cpu_to_be32(inode->i_generation); diff --git a/fs/xfs/libxfs/xfs_rtbitmap.c b/fs/xfs/libxfs/xfs_rtbitmap.c index fa180ab66b73..396648acb5be 100644 --- a/fs/xfs/libxfs/xfs_rtbitmap.c +++ b/fs/xfs/libxfs/xfs_rtbitmap.c @@ -970,6 +970,7 @@ xfs_rtfree_extent( xfs_mount_t *mp; /* file system mount structure */ xfs_fsblock_t sb; /* summary file block number */ struct xfs_buf *sumbp = NULL; /* summary file block buffer */ + struct timespec64 atime; mp = tp->t_mountp; @@ -999,7 +1000,10 @@ xfs_rtfree_extent( mp->m_sb.sb_rextents) { if (!(mp->m_rbmip->i_diflags & XFS_DIFLAG_NEWRTBM)) mp->m_rbmip->i_diflags |= XFS_DIFLAG_NEWRTBM; - *(uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0; + + atime = inode_get_atime(VFS_I(mp->m_rbmip)); + *((uint64_t *)&atime) = 0; + inode_set_atime_to_ts(VFS_I(mp->m_rbmip), atime); xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); } return 0; diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c index 6b2296ff248a..70e97ea6eee7 100644 --- a/fs/xfs/libxfs/xfs_trans_inode.c +++ b/fs/xfs/libxfs/xfs_trans_inode.c @@ -65,7 +65,7 @@ xfs_trans_ichgtime( tv = current_time(inode); if (flags & XFS_ICHGTIME_MOD) - inode->i_mtime = tv; + inode_set_mtime_to_ts(inode, tv); if (flags & XFS_ICHGTIME_CHG) inode_set_ctime_to_ts(inode, tv); if (flags & XFS_ICHGTIME_CREATE) diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c index fcefab687285..40e0a1f1f753 100644 --- a/fs/xfs/xfs_bmap_util.c +++ b/fs/xfs/xfs_bmap_util.c @@ -1644,7 +1644,7 @@ xfs_swap_extents( uint64_t f; int resblks = 0; unsigned int flags = 0; - struct timespec64 ctime; + struct timespec64 ctime, mtime; /* * Lock the inodes against other IO, page faults and truncate to @@ -1758,10 +1758,11 @@ xfs_swap_extents( * under it. */ ctime = inode_get_ctime(VFS_I(ip)); + mtime = inode_get_mtime(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)) { + (sbp->bs_mtime.tv_sec != mtime.tv_sec) || + (sbp->bs_mtime.tv_nsec != mtime.tv_nsec)) { error = -EBUSY; goto out_trans_cancel; } diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 4d55f58d99b7..36f5cf802c07 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -844,8 +844,8 @@ xfs_init_new_inode( ASSERT(ip->i_nblocks == 0); tv = inode_set_ctime_current(inode); - inode->i_mtime = tv; - inode->i_atime = tv; + inode_set_mtime_to_ts(inode, tv); + inode_set_atime_to_ts(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 127b2410eb20..17c51804f9c6 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -526,8 +526,8 @@ xfs_inode_to_log_dinode( to->di_projid_hi = ip->i_projid >> 16; 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_atime = xfs_inode_to_log_dinode_ts(ip, inode_get_atime(inode)); + to->di_mtime = xfs_inode_to_log_dinode_ts(ip, inode_get_mtime(inode)); to->di_ctime = xfs_inode_to_log_dinode_ts(ip, inode_get_ctime(inode)); to->di_nlink = inode->i_nlink; to->di_gen = inode->i_generation; diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 1c1e6171209d..687eff5d9e16 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -572,8 +572,8 @@ xfs_vn_getattr( stat->uid = vfsuid_into_kuid(vfsuid); stat->gid = vfsgid_into_kgid(vfsgid); stat->ino = ip->i_ino; - 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->blocks = XFS_FSB_TO_BB(mp, ip->i_nblocks + ip->i_delayed_blks); @@ -1062,9 +1062,9 @@ xfs_vn_update_time( now = current_time(inode); if (flags & S_MTIME) - inode->i_mtime = now; + inode_set_mtime_to_ts(inode, now); if (flags & S_ATIME) - inode->i_atime = now; + inode_set_atime_to_ts(inode, now); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_log_inode(tp, ip, log_flags); diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index f5377ba5967a..14462614fcc8 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -107,12 +107,12 @@ xfs_bulkstat_one_int( buf->bs_size = ip->i_disk_size; buf->bs_nlink = inode->i_nlink; - buf->bs_atime = inode->i_atime.tv_sec; - 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_get_ctime(inode).tv_sec; - buf->bs_ctime_nsec = inode_get_ctime(inode).tv_nsec; + buf->bs_atime = inode_get_atime_sec(inode); + buf->bs_atime_nsec = inode_get_atime_nsec(inode); + buf->bs_mtime = inode_get_mtime_sec(inode); + buf->bs_mtime_nsec = inode_get_mtime_nsec(inode); + buf->bs_ctime = inode_get_ctime_sec(inode); + buf->bs_ctime_nsec = inode_get_ctime_nsec(inode); buf->bs_gen = inode->i_generation; buf->bs_mode = inode->i_mode; diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 16534e9873f6..2e1a4e5cd03d 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -1420,25 +1420,26 @@ xfs_rtunmount_inodes( */ int /* error */ xfs_rtpick_extent( - xfs_mount_t *mp, /* file system mount point */ - xfs_trans_t *tp, /* transaction pointer */ - xfs_extlen_t len, /* allocation length (rtextents) */ - xfs_rtblock_t *pick) /* result rt extent */ -{ - xfs_rtblock_t b; /* result block */ - int log2; /* log of sequence number */ - uint64_t resid; /* residual after log removed */ - uint64_t seq; /* sequence number of file creation */ - uint64_t *seqp; /* pointer to seqno in inode */ + xfs_mount_t *mp, /* file system mount point */ + xfs_trans_t *tp, /* transaction pointer */ + xfs_extlen_t len, /* allocation length (rtextents) */ + xfs_rtblock_t *pick) /* result rt extent */ + { + xfs_rtblock_t b; /* result block */ + int log2; /* log of sequence number */ + uint64_t resid; /* residual after log removed */ + uint64_t seq; /* sequence number of file creation */ + struct timespec64 ts; /* temporary timespec64 storage */ ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL)); - seqp = (uint64_t *)&VFS_I(mp->m_rbmip)->i_atime; if (!(mp->m_rbmip->i_diflags & XFS_DIFLAG_NEWRTBM)) { mp->m_rbmip->i_diflags |= XFS_DIFLAG_NEWRTBM; - *seqp = 0; + seq = 0; + } else { + ts = inode_get_atime(VFS_I(mp->m_rbmip)); + seq = (uint64_t)ts.tv_sec; } - seq = *seqp; if ((log2 = xfs_highbit64(seq)) == -1) b = 0; else { @@ -1450,7 +1451,8 @@ xfs_rtpick_extent( if (b + len > mp->m_sb.sb_rextents) b = mp->m_sb.sb_rextents - len; } - *seqp = seq + 1; + ts.tv_sec = (time64_t)seq + 1; + inode_set_atime_to_ts(VFS_I(mp->m_rbmip), ts); xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE); *pick = b; return 0; From patchwork Wed Oct 4 18:53: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: 148558 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp350245vqb; Wed, 4 Oct 2023 12:13:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkNfoWVW8O2sXSNlDkcrOdq3ue4ZwwO9le9KXcD+Bt9JH3yTUS2Crro1nVVo59fePAMRbq X-Received: by 2002:a17:902:e84c:b0:1bc:4f04:17f4 with SMTP id t12-20020a170902e84c00b001bc4f0417f4mr633354plg.30.1696446817550; Wed, 04 Oct 2023 12:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446817; cv=none; d=google.com; s=arc-20160816; b=nVUJqOmBd+kVOXtW/KAMK2hx4Q8wZ8OzTvz/njy9k7QJtDCV+fUdYyiKHZlc3z4RYk k/lSn7a3pO2QmKC6f3PfGI0K77ji+CTaKUSvtvnf9fDqW265fVQLrdWluBcHisp1+trv h6oyAmTYpAUA0/bLYwYaBz3+QR90UN/wvEpdu3Q5SeUKbO0zGYzrath3Y0FcknXKzSct 6z4G2+H6rZGl3jhAGuTHchcFBjCMpwvpdANP5C7oT8BFv244qNvMjyjqqZdu5ndlEJ5e yXXdTsZZDl3PovN1fUQ+qqkCDoHWyqdImsMnEUp9D37NxUpHtCsm42obmkTq4X+uzCQk lA0A== 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=/xSMSybDb0vz7oEEIeLuKuRimluN6i2ijNHcnq4mo6c=; fh=KZ2Ejrdjn3st4YZfYh/U6JH5wVhYC1lVTNFXDG/+XsQ=; b=zgv8Cp9VQWkds5SHij+cFGN4Jd8HnOStzaKYGL59oJ2cGz8HiCK/uNVIeTkL0Vjgsx YoWzXkT8JlbYyai6279Lv/fZ/tmGPUDyrLLV7vDhwik2IcLg56mJ9e8NTvM+a+iXfUD0 zpABhtXV5IbXtisHcu6p3RO7aTFId6sT3cNmDYDWHz3f/P9staJaV/5Xj5EPwH6Rh+2I q09IJncVRKON67Uh3SmYTl2LwzBqUcYCd4KXtz3r2wYvYrzzp50D7kx0cryA5gMEWT6Z Y/X4bhILEOTTSCpdwa77lAn1XaZIb+buC9a/ZEixho74sp9V3cAUbBuSRiAZkMseTylO 8vLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="C2OsC/Rx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q7-20020a170902a3c700b001c3976e22f5si3911520plb.515.2023.10.04.12.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="C2OsC/Rx"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A9E0E81F3337; Wed, 4 Oct 2023 12:13:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245294AbjJDTIU (ORCPT + 19 others); Wed, 4 Oct 2023 15:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245515AbjJDTIC (ORCPT ); Wed, 4 Oct 2023 15:08:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9451E1FC9; Wed, 4 Oct 2023 11:55:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDDB1C433C9; Wed, 4 Oct 2023 18:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445720; bh=DgEQfKZJzVRlGstT1xAqKNQO563GSXEO2vDTLGHo+yw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C2OsC/RxcQr0BRZI/QLa1FUKzOqS8R6jL95JBqmAGXw2/a9/YQayqFFcyb+CIngJc rvBnyxd93Mhbt/eBfItE82kVUi84VCNV0+VGpl0ZBUxyg4undkJfgsehP6FT3QESat lEDZqCTTlf82pLO8msBiD9gJhrH2dFIACqxSSnKWekRNKKLqwW5K52AoQ3hVJBW52v u6wFJdDhT1kkPg+m7voxfnr1CgEGEvWVJVODxOcB966qb3FFgR1S5uJTVl2pCI/OuL jnQlakb0gAvF90i3icw0CTd+/mjWTk+C+W57VUG9h6QCiPAOQyq5gZx3gFMQ+jBYEh KAO+9XFnyV6TQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Johannes Thumshirn Subject: [PATCH v2 78/89] zonefs: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:03 -0400 Message-ID: <20231004185347.80880-76-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:13:15 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778853418339812816 X-GMAIL-MSGID: 1778853418339812816 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- fs/zonefs/super.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 9d1a9808fbbb..e6a75401677d 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -658,8 +658,8 @@ static struct inode *zonefs_get_file_inode(struct inode *dir, inode->i_ino = ino; inode->i_mode = z->z_mode; - inode->i_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, - inode_get_ctime(dir)); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime_to_ts(inode, inode_get_ctime(dir)))); inode->i_uid = z->z_uid; inode->i_gid = z->z_gid; inode->i_size = z->z_wpoffset; @@ -695,8 +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_mtime = inode->i_atime = inode_set_ctime_to_ts(inode, - inode_get_ctime(root)); + inode_set_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime_to_ts(inode, inode_get_ctime(root)))); inode->i_private = &sbi->s_zgroup[ztype]; set_nlink(inode, 2); @@ -1319,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_mtime = inode->i_atime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_op = &zonefs_dir_inode_operations; inode->i_fop = &zonefs_dir_operations; inode->i_size = 2; From patchwork Wed Oct 4 18:53: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: 148563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355326vqb; Wed, 4 Oct 2023 12:23:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAZzKl9apGKembiI495rHrKK2G/yAvmjTPFiFHCDhddgj6VCMS9gql8slExBKVL7GiZpJ4 X-Received: by 2002:a05:6a21:4984:b0:15c:b7ba:69cd with SMTP id ax4-20020a056a21498400b0015cb7ba69cdmr2766088pzc.19.1696447406049; Wed, 04 Oct 2023 12:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447406; cv=none; d=google.com; s=arc-20160816; b=pNdJj0qDwpz7PywCS86q7Wpna4fKaE1gSw7BuEa3o0BDIYj8hYDfU3gI7eod5R/hAA B+IFm05bTWIVzz16tyN1rf+o71QZw0mQPELZs05+HIRxtz82c99yGGyLLDxOAqKbzNmr 09WVBO1IKy0T5TMvLN6jvXXFF65+h95V7GFq7nEcF2HkASCs8pij6lc9giSiacuZ6bn1 db443YVyP51b6cD/x3+EeDwbuvE5ueyIS+5kcr0OOvKNnTppo+DIFqduexBYr+AtdYvo B3NTtamFNCwlHEIpCgSjNjH2IYiJ6vPcpP1EGo67EPSyCYNoq21aCeBOJ5fdCbmRTDbU sOqQ== 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:to:from :dkim-signature; bh=YCurTzIs7F8OmrfES2lR2V76jnQ5vJbN+z/DPqJBO6k=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=FVrLwfwWpfN2CukSswNukOhe1f4ekyv1xJCnaT9DmkClUGONkHq1qZN5MiC8VA4oMA wfkvS0wQ7WVVe7n30Ha+/Kynw7vKtscJTlYB4ApC6T4MHk3vV7nZ/j1ZWod7MP1dLr6r U+SoOeEfCFdGsh8/UhLMjj21i+VUaFOAhLayWpUxP0Itaa0rgHzwpFtnOviHXLSXrtRZ y5Q4CvHEQLJ4Y2OHntWchd5fdPULrd8pa8tUB4Y+5Ss6mXGXTUCaXRH1Auqac/Un8D0M r+rThduhcdjFoci+3DrrqTbw5SGpSfxG30kAKulGNA4clZh11LAdJmSfIsoFimckZ8b7 iriQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBPj3XaF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id h1-20020a056a00230100b0068fa9821905si4342563pfh.335.2023.10.04.12.23.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RBPj3XaF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 196F38489E44; Wed, 4 Oct 2023 12:23:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245188AbjJDTBC (ORCPT + 19 others); Wed, 4 Oct 2023 15:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244954AbjJDS7H (ORCPT ); Wed, 4 Oct 2023 14:59:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 834D41FCE; Wed, 4 Oct 2023 11:55:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD016C433D9; Wed, 4 Oct 2023 18:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445721; bh=nmBe8zw5Ozk9SsspeSTfoPTE0dqkpP5EVJV/pwQVTiE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RBPj3XaFy+HwqFSflFtf5YtrJJVo8X1ACXxsgvFrdKXMqPtoSLFYkdVUHtJaqlusA qDi2W48u0a1FGdiLEJ+H+DFD8htQ7bo1EJz/L/to0iCkmAsehZZSTeQ0AJDvvXVnHd 0ovJ/va685FW4d+kK18tNDfz26SQDz62ba/VXxeZj924DLlz8bYjVB7Sq677PZmfLx a4TNg5esgu54s8aLm+3tpfiOcJH9RTarmO1RPqVbue7jZ49Phd8lSowGO0DqLCUvVs +ug3tJ1ADfh86rbO+d0Z2bLQgOXdHyNmYChQp3eXfzdCc6iBYyuVyGdC+YwD+yPYgq +ACSyE9eD558g== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 79/89] linux: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:04 -0400 Message-ID: <20231004185347.80880-77-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854035150192324 X-GMAIL-MSGID: 1778854035150192324 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- include/linux/fs_stack.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/fs_stack.h b/include/linux/fs_stack.h index 010d39d0dc1c..2b1f74b24070 100644 --- a/include/linux/fs_stack.h +++ b/include/linux/fs_stack.h @@ -16,14 +16,14 @@ extern void fsstack_copy_inode_size(struct inode *dst, struct inode *src); static inline void fsstack_copy_attr_atime(struct inode *dest, const struct inode *src) { - dest->i_atime = src->i_atime; + inode_set_atime_to_ts(dest, inode_get_atime(src)); } static inline void fsstack_copy_attr_times(struct inode *dest, const struct inode *src) { - 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)); } From patchwork Wed Oct 4 18:53: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: 148544 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp346397vqb; Wed, 4 Oct 2023 12:06:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEpOgFt2LRV3IY5gjaUUEef5S0yYzGYRcdtzzxOwJYfN7H9U9SQluV5L3mZpY9kpHQ8Sra9 X-Received: by 2002:a05:6a21:a5aa:b0:15d:fc71:1b9e with SMTP id gd42-20020a056a21a5aa00b0015dfc711b9emr4281493pzc.49.1696446399612; Wed, 04 Oct 2023 12:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446399; cv=none; d=google.com; s=arc-20160816; b=x5VA25CvKtkF2bgbiERhALKPFwpCXB+szI8RPmoYVaK1J+JXLAcWWBqTsH+FTKpVH3 PlAaG8pLFS6PeDHKeJ0lINo3qT8V+PySFrweY0k+d4cchrDYwYr5ijfBA4WvwMCgBD3T vBpKYOFrld73q1Z3ciLCcN0cITM7jf2zxlDXLSkGAhfHtWP/S8goysarRiekCwSNit/7 MN0nU0SUN+m6fiYoCfB7UhzTTnxRjPIVpBHLcDf/kq4zDcsM9AFrJlMRUzMJd13vl4ga hZV63UXTLjFu/p7+ubhrdmzFXwUVYmil/FvL0760SUGUtfhsGx8I3K+ay/6EgMp+MNRM Y2TA== 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:to:from :dkim-signature; bh=b07Vu4EVsK4TIwARqiUIYSpZfBVxzIjWJ/Y3jcI5km4=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=frgQlT1hO/RQ22tdyg8TXbyBwpEyhv4yJG8EEBB5MdAmrwB/w3S4i7YAPPP0XgHhx0 zXLj1e7RRUMxddoRrBKh/a/UxFNMHt6CXgn7NSNr+TZ1KMU5/rkAU1DUyCDcErFZNGrH wJs1fNp1vv59fB93khHN2eRaOH4XO8MH6DFbAz3nH9klN1iqCwGx2tUElSQHdWaRECU/ I2lfGb8BFFFeXQFqLLp0XtGVGTRTgK+oE/AEgC9hO3m48cpZVATrDysODIdOWIvHD4oR XdkAv1o2juQsTyMzYNs00q+SIwM8aTH7qrRt2WY7r3+ax+qEoC6ata27strFfEVmTo0f Mhhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vh2AgEQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z69-20020a633348000000b00578b9fb24f1si4136167pgz.634.2023.10.04.12.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vh2AgEQT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D67D48098411; Wed, 4 Oct 2023 12:06:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245341AbjJDTBG (ORCPT + 19 others); Wed, 4 Oct 2023 15:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245005AbjJDS7H (ORCPT ); Wed, 4 Oct 2023 14:59:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B5C1FD2; Wed, 4 Oct 2023 11:55:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB6A8C433CA; Wed, 4 Oct 2023 18:55:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445722; bh=iyyGrxAUe096blFO1DRwsMjGFs8ZEoXIuSVblfBp4jQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Vh2AgEQT9fzJvL5UqIp8nkt0ufLRg6GqgwK2Cpzmcdaq++A9VweDpcYn8AD/Ashi2 u4TOYMgyn+aSn+2xfwh2yOyFUtvpQoAe4CLiWPm/HCgAgbVfOZ7/DrkJwjsbu/X3PE iyruKtUQaPHIwcHfpU0Pz3OOneoMe07rFE4vltcLi8mfjsQwkd6qlnWNe9c7A5RUWs tT9NSkBfApFmCZTuE5j+fLVeeTMve1AEv9ha0lTeoVJru+sxXMYL9QGf8XkpemWpUZ gRZTs7XR124n3LVjOzZIEnWbMpsoJSHmRz5ZWArVBuCqWXOOgTuH4SuRkccvxCaNRh FBO8A4eJwU22A== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 80/89] ipc: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:05 -0400 Message-ID: <20231004185347.80880-78-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:06:20 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852979994642221 X-GMAIL-MSGID: 1778852979994642221 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- ipc/mqueue.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ipc/mqueue.c b/ipc/mqueue.c index ba8215ed663a..5eea4dc0509e 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_atime = inode_set_ctime_current(inode); + simple_inode_init_ts(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_mtime = dir->i_atime = inode_set_ctime_current(dir); + simple_inode_init_ts(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_mtime = dir->i_atime = inode_set_ctime_current(dir); + simple_inode_init_ts(dir); dir->i_size -= DIRENT_SIZE; drop_nlink(inode); dput(dentry); @@ -657,7 +657,7 @@ static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, if (ret <= 0) return ret; - inode->i_atime = inode_set_ctime_current(inode); + inode_set_atime_to_ts(inode, inode_set_ctime_current(inode)); return ret; } @@ -1163,7 +1163,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_set_ctime_current(inode); + simple_inode_init_ts(inode); } out_unlock: spin_unlock(&info->lock); @@ -1257,7 +1257,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_set_ctime_current(inode); + simple_inode_init_ts(inode); /* There is now free space in queue. */ pipelined_receive(&wake_q, info); @@ -1395,7 +1395,8 @@ 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_set_ctime_current(inode); + inode_set_atime_to_ts(inode, + inode_set_ctime_current(inode)); } } else if (info->notify_owner != NULL) { ret = -EBUSY; @@ -1421,7 +1422,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_set_ctime_current(inode); + inode_set_atime_to_ts(inode, inode_set_ctime_current(inode)); } spin_unlock(&info->lock); out_fput: @@ -1484,7 +1485,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_set_ctime_current(inode); + inode_set_atime_to_ts(inode, inode_set_ctime_current(inode)); } spin_unlock(&info->lock); From patchwork Wed Oct 4 18:53: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: 148545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp346535vqb; Wed, 4 Oct 2023 12:06:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFA8yu6VOqEdJHOTMmQ3CMdhQ0TQ1UqoGC8akil//MJlAKjFjS9Empl59ZNBfVN2/hWe0Ve X-Received: by 2002:a05:6a21:6d9c:b0:15b:2125:890f with SMTP id wl28-20020a056a216d9c00b0015b2125890fmr3370610pzb.37.1696446414706; Wed, 04 Oct 2023 12:06:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446414; cv=none; d=google.com; s=arc-20160816; b=XZx1kFEKNMYsPfAvatnp11IF1Pnz68tFBgmetwHoxlSYk3GJhQ6IFhSyhiJaWTNyh1 Qtpe9pCAm7InMd8c0C/JcBAfmSaIDGwzExiBircSG/7eyuTehLiQ1LCUbnj+oDVxXxps agATfVhf9qYPInxg4xoOmeg9XtYTT8Hsbs3KqEpwZ7etefjRYUpEWPddLVHtdjkAFT4L B1VbLFBMJA/slsB3REGVGpfWzxg2NGWHcgeACsXTKJyt9AVcqmZe5gO8lAGN2SUnXtd/ P7gfOpbzOeTxjdhJN9rfvNaidqXzXCU6vGUKNg2DW/LzrolRGxhO4ZKUzGlFNPLyhmzy YyxA== 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=IkIdezz6n7HUAoSOuwW0uZuLjLJFdOBSyXRraXKOKps=; fh=c46m5ey7SAzRIMX10Og2AyTSJ44BS0wa+PqFJ/sgKgY=; b=yuVJ0UuKEoh9IPr4GZox+SYsq3y5XJyGBqPf7DpN2CSoHRGKRFdYxn1bJZvX0Nki/k 7wPKENCx1uz2KJYXHF3FOyGR1O+uiPVyzWkbIQttnlvajB8kdTS5WtycH298d2OgEkRz HR7WT2TZionElYlSpAdbuRlHty8p8XV1V4zzrJaPv05pUGhE6wEHDBAXaoyThR+LofZG lwlHwdxf2xxl8vlN+DfTX8lXp1Gm+xXN0K2EbjjlkadRx3TnTvpZ/XStSAhSWYP8RoEP BGPhRXfesMSTCSl0qOGsi0pn24IshBVaEiaow3Jnuum5zwDy4KbjZCwgS8WKpjsQ3OJ3 LMhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HlJs8eUM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id z3-20020aa78883000000b0068e29a05fa4si4364429pfe.326.2023.10.04.12.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:06:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HlJs8eUM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 901F5809340C; Wed, 4 Oct 2023 12:06:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245251AbjJDTBP (ORCPT + 19 others); Wed, 4 Oct 2023 15:01:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245221AbjJDS7N (ORCPT ); Wed, 4 Oct 2023 14:59:13 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAD461FE4; Wed, 4 Oct 2023 11:55:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8569C433C9; Wed, 4 Oct 2023 18:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445724; bh=EO4970jbAZuKMZTl4/2rNPllueWoXzioRkZ7MMwMF6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlJs8eUM6lfk7ktqhE291v3xrDfffAHYaeF8iPm+c9muga1RkV44BSTk1vLuGArCu RgO/Yq993tPgfM7L9w0wDuYLn1zlgWsnf7pxyTXmWK4MEZNCrmoPfQrBRFgwgXoaF9 4FAzJpSj4CWJEorRD13r+KQ4klo7Q4XSdtqb977uwDZ+CJAIV/hAm1W9teJQSvrbVI X/2QivHontTzKXxisF4a8CvbP6lpfmYHQDLLspzm9iULj5I98QNuHXz4dNqX8Wjb92 DV4H9tLDg1FAC7T6Crb1CFOLS+8i3lso+jm/1i18XMKPEiklIvaOZhs4/XzLSy6/bE oXX4TPhA+fbVQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org Subject: [PATCH v2 81/89] bpf: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:06 -0400 Message-ID: <20231004185347.80880-79-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:06:35 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852995490884011 X-GMAIL-MSGID: 1778852995490884011 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- kernel/bpf/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c index 99d0625b6c82..1aafb2ff2e95 100644 --- a/kernel/bpf/inode.c +++ b/kernel/bpf/inode.c @@ -118,8 +118,7 @@ static struct inode *bpf_get_inode(struct super_block *sb, return ERR_PTR(-ENOSPC); inode->i_ino = get_next_ino(); - inode->i_atime = inode_set_ctime_current(inode); - inode->i_mtime = inode->i_atime; + simple_inode_init_ts(inode); inode_init_owner(&nop_mnt_idmap, inode, dir, mode); @@ -147,7 +146,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode, d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = inode_set_ctime_current(dir); + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); } static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir, 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: 148565 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355405vqb; Wed, 4 Oct 2023 12:23:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRGDA6r8NgGRnpYIyFarvP7lquGnePl9B4sKuN8lj4FDD88hB6OP360LuCwTMWr5eW1K7g X-Received: by 2002:a17:90a:8a8c:b0:26d:5049:cf48 with SMTP id x12-20020a17090a8a8c00b0026d5049cf48mr2925897pjn.40.1696447416318; Wed, 04 Oct 2023 12:23:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447416; cv=none; d=google.com; s=arc-20160816; b=FFKLcIhadhTev2PtgdIS8wHHNhBKj0ny7JKN3VruqA/C+tR08vjMp/vFNkJAeZcD6j RCh/O1icjGUUZcACI1ZUyQYr3uZfB/LU+w8kKnSswNPpnW3S+WeJWVF296EEfdQ1SXYU HPglng3k2Mhrz1sZ8FNKYVSBikWFd77qvvgU2JuEONBSmoWqAaZD3BRAXOEHFxrbU/ER YZ7U4TGGq2zvGhaRXguEWP36Q64WHZJb+YxwZ0dk9ITTQYgpLP8dXBf3pJcXZlzD3Tvk w5Xr4ZD2kSH3p+WZhovf0fyoXmSfI2sd5nRZu3oj9gsiyfkIW3zc5QKmEb/natnXfNEO 3j0g== 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=qQTDCLUWbjKPjQu7SLJ59PyTx7087Qx4d7zqkuxG61A=; fh=YcvKTfjdELTIgtVvxDx+GI7Jag3KQiPyLLfYV96J/gA=; b=l+GbSuO2khg4CivP5GMLKzXIxUhlxX+olVha6syDaX0a+9U0ufc4dX/e0YK6cEuEX+ Ky70f7Gw6iSvmdIPqto98D6rPd045uREdi9V9CaMfQLeLzixGLDhl0g0n2bqTmT2uf/r fY+AZ3nMeZ/oAq1bAV16EmkYgtXoMX2LwI28D8opnq600swosqxJ7VNzZ9uZhD+Lu1Nc wRdsKQdGyF82dV32qcFVFw33h0Ot91rX8PSuEhCshe2NTchKmaSILW52rvdnHZ/Z++Qg 59N8rGO4mIxe8xVGTGlIlr0ncMrUaP8PnHpMkQ+xu2caWb04da0NDzhvMzztm+1Bxc66 0M/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F18Oj6eE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f18-20020a17090ace1200b00278ea235413si2085415pju.31.2023.10.04.12.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F18Oj6eE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 466228452EF4; Wed, 4 Oct 2023 12:23:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245249AbjJDTBJ (ORCPT + 18 others); Wed, 4 Oct 2023 15:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245224AbjJDS7O (ORCPT ); Wed, 4 Oct 2023 14:59:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 479001FEB; Wed, 4 Oct 2023 11:55:25 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854045826472787 X-GMAIL-MSGID: 1778854045826472787 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:53: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: 148554 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp348749vqb; Wed, 4 Oct 2023 12:10:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFb1Ge0qJYxFUG7YznN0I40vPxpw7MH6DlcTLQgSkA3b6RsKt9JwzqsLiAuHCwy9MNLkJzO X-Received: by 2002:a17:902:bb84:b0:1c1:fafd:d169 with SMTP id m4-20020a170902bb8400b001c1fafdd169mr2891244pls.3.1696446654377; Wed, 04 Oct 2023 12:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446654; cv=none; d=google.com; s=arc-20160816; b=SYC+mpPx/tnXp4sFsfFXjiF54YPvqXRvb+bY07yjQqnDcOCvaZlcNXafrbShc4G46u GkAJxEw6fdf4EueeNKyqJMtraBlb/ZnOIhd5FoV5t1HXEgJQIzLt7B8NbD1Kcyk7VyOU N/XC7i/lB+F0ulzhovVdjAzeWG8icGqdmOUAosOgX6IhoAuPaCGgpyWmh6lPuXZFmN9t SQ/GitAXgvANHA1jbsThKzaVdrcIbWWmzaLE62VgfaHJZnzheIpBeDDyi+QfPU9GQAR6 fUWsZ9mx5a06NUkFFm0qqlOc7U85FSto3GWu9UR+uJadh9OD2ISV7MMkrNa256IBCSFR SZXA== 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=QzdKQvBZkpC1eI1Aeu0dADxP/NRFMUJLaN+zGveX4HM=; fh=f57+WOTreorKF/qXl5as28mzLP2sMCESIPBPN/7u+eE=; b=cMoteeBoOOL9TZU7rvSyk9FJJG9wuZvMGimG3y4NIlLgB4LrBM11k/x2ZlzRm/CgtP Avvj1WBUyUZpi69FrTKopPopGrwawwg1TuThmM/8F6xZQO/iqrSwoGhlsAooDqXpVlS8 UFvxePIDpks9SKRhm8HmxFNsMTGyKWAU8xcQtHaslQF1vaEvkP+X4FxuooD4JXMD0neF TYLtAq5bkNELGGQ29jl/72gEE8sBEk7RnK3vy7DkQlwJWpm2xUwNQdJu7Ra/Ij+Z25ue jG9c1szx46VzmkCGce00fvDKG72yY1d3llQxR5jKVxolBvopV9ATmd8osRY7XsSlYOlZ n3dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FnESdMYE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id kb14-20020a170903338e00b001c5fa46f0e6si4069563plb.190.2023.10.04.12.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:10:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FnESdMYE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 943D180A07FF; Wed, 4 Oct 2023 12:10:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245444AbjJDTI2 (ORCPT + 19 others); Wed, 4 Oct 2023 15:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245402AbjJDTHo (ORCPT ); Wed, 4 Oct 2023 15:07:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24E4A1FF7; Wed, 4 Oct 2023 11:55:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2DFAC433C7; Wed, 4 Oct 2023 18:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445726; bh=n26ifruBeSupq+s8VbXmEVZ3lXfdrda3ueK60gXr4l0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FnESdMYEgrhZH/Almr6hVPT2D1Y98Eg1F6ZKbQWwtmrxCM5IbA7uJn1QExRntQ/P0 G9h7myryxeaizxYalsCBYgujn0WIpTw/OINL1z3VDKzaIxevvF3gtRF2oPzdT8l6HJ tkZGwPFD80GYnBN5dPrzeijaeUY1ApsADEYTl2ODNEnlTRVUhGCqhQaJMIIkRHRp3j 4W4ueSWil/CVMUfUJD3ijzoLZuXOCuPRPQI1MwDdvmuB0bw1wjMginzccTDfIWerj3 304/17y5qcgV0iZ0HBCljj/rKxlHHW+qsacX/5QHApITia8gigeaixxZW+MKo32QGO yydDcmb/0rRPg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , linux-nfs@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 83/89] sunrpc: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:08 -0400 Message-ID: <20231004185347.80880-81-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-Spam-Status: No, score=2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:10:16 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778853246829783441 X-GMAIL-MSGID: 1778853246829783441 Convert to using the new inode timestamp accessor functions. 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 f420d8457345..dcc2b4f49e77 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_set_ctime_current(inode); + simple_inode_init_ts(inode); switch (mode & S_IFMT) { case S_IFDIR: inode->i_fop = &simple_dir_operations; From patchwork Wed Oct 4 18:53: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: 148538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp344915vqb; Wed, 4 Oct 2023 12:04:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzvhAc+3KQYb0W/nufrqtzTOTSMah1omkX6B8wZBc7/6OhMRK6UUl8CcGyrZUcORYlNyXY X-Received: by 2002:a05:6e02:1a45:b0:34b:aa34:a5c4 with SMTP id u5-20020a056e021a4500b0034baa34a5c4mr3509297ilv.30.1696446261984; Wed, 04 Oct 2023 12:04:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446261; cv=none; d=google.com; s=arc-20160816; b=eR9diTfoiiNikPnIti55JBgi1IVkp5Ncsgf5Z4/Hf71spNd1x3aYLlDHoQ2rpQJyKj dpyEDH0jXPpnkW7UGs8vdrgT0pdpNA60AYE15vQ/t/QLFhGoRG9kVCPtAw21w1Idi5Xm hvlyYmBefeQdSTdI1c6LIf3PLA6lpj3btnx1jcmx9Crc3OlIE5YxsowPj+OpY5NcVP1g SSEOLqHsMTbIgOj5X+UQqD/41CJZTMecSu1+dRIZXfuFG7VcxOQjKSrALDODD/5AWMr3 k7KK2+d7p1zSpJtgS4VMFMsDx9WLT/z+p2h3/G3oHMR/Axh5sufu9q+ESC3h1/RlNSsp PxHA== 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=qR2hBddCj8Yqx5h6MrxdR575gIAbWo6jOiEhh8FLQ1o=; fh=oiowXySz2F+J4jdl2t70kJesSvr0fL+txr5uWibwDGw=; b=u8OkcIC6621AsTviHt0UdOBrK8D3Dn8VVF51FgrgxbtxQzqQWWEPZRHqHD72CIcaNy fQ9jJ7POWczXABH4Ci5Sv2/R9Fy8uH72tP5ZRLnfFqL777okA19PRCoyhiWNEnxoV5lN VIVAxyECQicosp6K/0vSHXz9nXjXN0ZuF/nuM9Yxe3vE55W3FCOy0u8zQ4Nt+VCOiwXW 5QtDx/q3F8oiW0QT+m7v/TdDHAYccz47KFoUlLBkLBTI9RiV9zZzlE3xlP90s1KFMCib Y1jM3YZWnMdwlOUn0s9WlLXxrKyB9iK8ZOq5Oc234zeUghCaZ9HXRbNFyAsUDJ5LQb+0 zX5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPqhVdWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x28-20020a63b21c000000b0057ab7f46d3dsi4225252pge.108.2023.10.04.12.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:04:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JPqhVdWs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2D44883EB326; Wed, 4 Oct 2023 12:04:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245365AbjJDTBR (ORCPT + 19 others); Wed, 4 Oct 2023 15:01:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245229AbjJDS7S (ORCPT ); Wed, 4 Oct 2023 14:59:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C0281FFD; Wed, 4 Oct 2023 11:55:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EFB6C433CD; Wed, 4 Oct 2023 18:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445727; bh=MoIiW0tMHURG7cJf6w6ln0tYlsyoiEpsfqWIhLoofRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JPqhVdWskSIIpfDDjPHzSCqQNZIl417YlCoBc9LPz5sjsfGqE07PJZOhE6sbqYP2X 0U1dSNp6FcjR7IOU1yow1ION3UjDnESIbSQDkdDpWksH/8zYMZcB3idwbfTAzC0HXB /qVg/1XnBw320D6Hhx0qh2KItlWeJkAItTSMRcgeDL9uG/CHgx4Ckr4D4rAbL+jDlv QwK/9vxexr4tqB/vjwaQtmI63IBMlRihiEOuGgDK0Y/BnD4ubIzD95kSWb57EJGSzJ nPT6UIVKEBcI2UHtAFu84iqq2l6M7LkuDXctHZOMs99yMKIepLnPV/675uCcQfewxu QIoYrlMYYkRpQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 84/89] apparmor: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:09 -0400 Message-ID: <20231004185347.80880-82-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:04:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852835755016114 X-GMAIL-MSGID: 1778852835755016114 Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton --- security/apparmor/apparmorfs.c | 7 ++++--- security/apparmor/policy_unpack.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c index c198a8a2047b..27b0540a761c 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = iops ? iops : &simple_dir_inode_operations; @@ -1557,7 +1557,8 @@ 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, + inode_set_ctime_current(inode)); } old->dents[i] = NULL; } @@ -2546,7 +2547,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_set_ctime_current(inode); + simple_inode_init_ts(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 94d0f801eb49..7f0e58f3e1fc 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_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); inode = d_inode(data->dents[AAFS_LOADDATA_REVISION]); - inode->i_mtime = inode_set_ctime_current(inode); + inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode)); } } From patchwork Wed Oct 4 18:53: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: 148549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp347569vqb; Wed, 4 Oct 2023 12:08:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnV6pwbd7pmD62Y0twXaRXs2/QecJkiYOevYse7eRHRhbu98Qv7TxTbP7Gc9xJxV9QoNEk X-Received: by 2002:a17:903:32cb:b0:1c3:2ee6:3811 with SMTP id i11-20020a17090332cb00b001c32ee63811mr3912722plr.8.1696446530566; Wed, 04 Oct 2023 12:08:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446530; cv=none; d=google.com; s=arc-20160816; b=SEU5aWSJTWJGli4zn2fv4JL+OBZHISZDTaX92BF9h77ecNi+1VHtLHbHsD/GzPu2kK COVE6Jv2xUItEMIQpGZuxSz8Z9c41wwqiJX745bEmtmRW5SvhHP67NwvRBNI+9bW0P1A uaL7wHL5Q5Plkhzw3gxAe1aoCOcQvXJZK+N+LN61hgjqqEIZEyjl0V6Dg9JV/4+LLSqs qFC+NjNgLTJ1asVSQ6aXMA1xlEXClGoqo57LZX1as6DMhpb2oMqpuPn9ldBZHPm8k1wp P6TWxpAl3YY37TZ0RwKOVLj5TwcAU4q6bPkYIW93hgy9EE1u/KNsldFd7NhGTK+jCjA1 cPGw== 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=RkMR9vKTj2OAKmZEnfo1hx6kjyH22ioiX67zfsbrrA4=; fh=XmJJYHs/ZecGtAyKEoYKCUoSc0fNGp/XGIwECqgOar4=; b=DlwbFWeVd5cvSzFTF4mTZQBScUGekJi1YOHewTHB/kO29HtjrorRdYYYtEKuy1bSRA 5SEeQ96Q+bEESq673VCWhlN4wmx9BHBIbG1/5/8W3P9xayaDWWc4nkwL2ypHzrkGxmV0 GcAlPHcmaAT/oSVuHDO0DnFB/JRfr4ZCCvGProtnmZ7vGPTLmCktcJrkCCwcB3UHyUrW 2KgWduz6qLtmL5I7ZlhGc5PcVwhyc00u8I4+KhDKgqyIio9LAaxWyATxmSENcn+R0Hwl EVlEc5w/t/uSHPBQOYfETrXDd0eNdO1U95OY8jPBFPBo90WsIgmRuMHcqCuBqkO9PRpg KSjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TOM12QAH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k2-20020a170902d58200b001c5db1e47c3si4375051plh.553.2023.10.04.12.08.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:08:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TOM12QAH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1E6988411D59; Wed, 4 Oct 2023 12:08:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245264AbjJDTIZ (ORCPT + 19 others); Wed, 4 Oct 2023 15:08:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245510AbjJDTIC (ORCPT ); Wed, 4 Oct 2023 15:08:02 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DC0110DA; Wed, 4 Oct 2023 11:55:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 728E0C43391; Wed, 4 Oct 2023 18:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445729; bh=6tfj3HOEQmDgdX2NgSnu09djalPJMC2P1Uz+ScV29Q4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TOM12QAHwzv8YtbPRSnMFATJw2O8jmXWKaQbiIXHQHnKWapStR+dO8VaY0Cw7vAkl v9frED7m+7uOtb9RbmUBZrqQ+XEsG+cIrl8JLShhdBRHTPdYSoBlATHHWGbl5za5MX zrr1NM9QjtN67oeU3v4tBsas2Gqa+L9fPB654KZfsl/yx3vVHkBuAote7xpM7Iy8Z4 oZWwROe06YOh19VVA79qye7xTkkKrYRkiLrgs8oejGZPmVDGPsxgBYVakJ2fnARFOa egMW1d6bkFqPd+khH9FIAqr3fb6lG5P0yKJPRac+xWY0X8An8U7jBrvZ7Mtgk5nMFX uhLMb/z1sTHUw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Moore , selinux@vger.kernel.org Subject: [PATCH v2 85/89] selinux: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:10 -0400 Message-ID: <20231004185347.80880-83-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:08:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778853116905093493 X-GMAIL-MSGID: 1778853116905093493 Convert to using the new inode timestamp accessor functions. Acked-by: Paul Moore Signed-off-by: Jeff Layton --- 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 6fa640263216..6c596ae7fef9 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -1198,7 +1198,7 @@ static struct inode *sel_make_inode(struct super_block *sb, umode_t mode) if (ret) { ret->i_mode = mode; - ret->i_atime = ret->i_mtime = inode_set_ctime_current(ret); + simple_inode_init_ts(ret); } return ret; } From patchwork Wed Oct 4 18:53: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: 148564 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp355382vqb; Wed, 4 Oct 2023 12:23:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0Qj2kbIpq5RGsWx+xU6S9EVS3A2a7eRcwIxtdq+2OOMyA/zoY4DZ3XlMgFvGjiLkPQI64 X-Received: by 2002:a05:6358:98a8:b0:140:f00a:ee2c with SMTP id q40-20020a05635898a800b00140f00aee2cmr3927349rwa.11.1696447413454; Wed, 04 Oct 2023 12:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696447413; cv=none; d=google.com; s=arc-20160816; b=MHwKcpGxT/GsqRrJCz9gvKtS/U8G1M8pYhZzu3obs8Ny9yTTug7KG4qctJ/WUygsgD hmEYQHfLD5EQGvErHnMohRiGuCstL4cvFy5zfRYgV8sAK/muf5ZxO7C+eDDs7aLEXa5J PSJaP8hXY06YbNVLkaDFpaAXmVMnY91uE68rk6JfNh68y1SqXO962HbdXPzz0hN7+NoE gyoRoC6vvIjQpOq7leLJ2ifA+DW8Xf9H5w3q6HYFaFI5ZIx4dPERde+hT4xEexIcpqQt RZIm7IZTg0RnGIISpFr93VjT0+VeLsdoSxDgGbFBJhj3duE9ZECWryxtkbjswbITJbYJ J7+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=Yt5ZevHN4X6RmFHcMC2k6yblk7Bg2HBLL0GtLg2WfoI=; fh=zuIeB0re4qzBlHDW8j04esOTkre2ps5Xwa2OvCTWxzw=; b=kBcb9TrTvDR5qA2arBOnnQww24DKpZqeRUKQCEcd36qj2iKWXS3Q75+W3RHtUNCxPv YQEBy3kjld0GXQm9IMct1IOa1Bc2IMPjsKhnKKEVztnXPAf/hnSrFz38UdfbSkhrRLJs LmCALIIzyKu0MaSgiMphZeeSWxhudq35jyhM9tJmG1Pnr5t4GiJOtBtNZ1b3ocZ2JLfo PPrLz+stBRAiCOy+Sru9WpNmRWoNlume/491PRkAK6MjxBNr1rMZj/sEHnZsSM/fKAhs vPzDL/olTisrk+TZLLDY0KQvonEShTzhyYL4DofGAqFrPSwqul7PX7KIpbK+bYCR3YdD MZ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mj23CMF1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c29-20020a63725d000000b005740eeadb59si4191582pgn.518.2023.10.04.12.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:23:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mj23CMF1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CA01A827175D; Wed, 4 Oct 2023 12:23:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245253AbjJDTBW (ORCPT + 18 others); Wed, 4 Oct 2023 15:01:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245244AbjJDS7U (ORCPT ); Wed, 4 Oct 2023 14:59:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 140E510D9; Wed, 4 Oct 2023 11:55:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F738C433C7; Wed, 4 Oct 2023 18:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696445730; bh=CrI2oE9zvS7rLm3o68ETT7yHLDkYN2B8nD8SI4vNyfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mj23CMF1wPG5z6bEMvvYf+X6rPahpOrgAsQU5jbz4pVIXc6QGhXgd1Ej9CoclvQfG zqg3Gv/qCiVvi4w8LOEzHJDS9o18NAokf23yk1cuVPRGiIwZtfI3Fwx6aW/FkBxPD3 ig2WakoncNMFhlEzh5Dj4AuyaBYePBslTp6RVsPqP4Dtx4RVaEgXRf50pPpqqjf8vh ngkQxmeeLVADAKSN/oMmyw6A1mk9UcNJEKTDIxiEP3j39K5Z+zLYQ2txRZeDIY2DIT S8vLeFRncvS3GXwPZsAtV31xssViXmbWDzusPv6eoGQ36h0GuKhYudDbB8rxq7xLBF +H9+ji+iezkyQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Paul Moore , linux-security-module@vger.kernel.org Subject: [PATCH v2 86/89] security: convert to new timestamp accessors Date: Wed, 4 Oct 2023 14:53:11 -0400 Message-ID: <20231004185347.80880-84-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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:23:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778854042884461824 X-GMAIL-MSGID: 1778854042884461824 Convert to using the new inode timestamp accessor functions. Acked-by: Paul Moore Signed-off-by: Jeff Layton --- security/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/inode.c b/security/inode.c index 3aa75fffa8c9..9e7cde913667 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_set_ctime_current(inode); + simple_inode_init_ts(inode); inode->i_private = data; if (S_ISDIR(mode)) { inode->i_op = &simple_dir_inode_operations; 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: 148540 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp345297vqb; Wed, 4 Oct 2023 12:04:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFgkl+twsGwHuXWCupOKWBHNUS6Dm7cdSlyjCUSYFHUGYHe1wZkeY+8X96DlAI5GlEVmKvZ X-Received: by 2002:a05:6358:5e0b:b0:143:5d3f:f397 with SMTP id q11-20020a0563585e0b00b001435d3ff397mr3121986rwn.16.1696446296909; Wed, 04 Oct 2023 12:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446296; cv=none; d=google.com; s=arc-20160816; b=jZE8+26oYVYqzgT7+heVZh9qfeGazxW+B83dNjn7+oGOr30L8LEUPzKoBAINJ26AxJ ApnIjVhkWvr4sa6rKSuQTG8+0ph5Fp2TdOTQosVjcaN0h6hT4dmCnRethKosxn1wfuva ssHlKJenE5pFxqYrF2YnHPgT0nii3PsSbIigxyESuI7ffdj3Wui5XX5hhGE4RKaS9hGd NDMkI6AO3NFZCQsFgP4XTWzTh6OjVYhuVy/HVZZiHjkGlw4iQ6s2qKfpn70szHBW0hh4 5IAvOrsT6ojAF8FaA9JJvahaJoTTNBx4Er4ILeLf6BjPQUML+FsqKqJ/zQnXvdGYfIL6 LkEQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=DqCEz/v1NIFQEdA9M9suOzM+orY90TuUbymMwTjHgsE=; fh=Mu8cExWZ0ryo+xXd15sIvDuJ/P4rEjrt9uTues01RKA=; b=Wqs50hIQ/2zSgfFHKPB8Ol9epv//rbxTpLWPb7ly74P6GkUKdIRGCEWt1bn5Hn393H Xc3zPk1j9qWb+yQX5IklkxdVuhpnsmQLGzKfM4eDMmbUAYG52y5b35+xWO4GxSmxWCZq Y0p6q1/pzAD4gqJ1w3LjWYYmbt7+Ad6yzCkFZ19xd+VDlw1uSH3XfTWmj/VgALxK0qZQ DTCo6SbqYi1pI3nNczTDntLHkwsz+tzqgjjdYQVp+MsX4KO8kEe2hJxexrjWyWYQmi4l 1qJSWbI61dVD3V2QAuJEDRhZGzgEHk+CaK1AtDt2CfhyUBuU/1hy6R5hOtnS/5TmsRRZ TjEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U4cHhSwb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id cl13-20020a056a0032cd00b0068e4704fd5bsi4073581pfb.346.2023.10.04.12.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:04:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U4cHhSwb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 22334840FE3B; Wed, 4 Oct 2023 12:04:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245309AbjJDTEq (ORCPT + 19 others); Wed, 4 Oct 2023 15:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245333AbjJDTBA (ORCPT ); Wed, 4 Oct 2023 15:01:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E1F12130; Wed, 4 Oct 2023 11:55:47 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:04:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852872232830395 X-GMAIL-MSGID: 1778852872232830395 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: 148543 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp345367vqb; Wed, 4 Oct 2023 12:05:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsr9zfXkOoUy0pQjJcGvqheIpraZa1+2L4b9uuWmLBfY8BVed97t/1i03WPGTywePaeu6x X-Received: by 2002:a05:6358:618c:b0:145:6e16:fa86 with SMTP id w12-20020a056358618c00b001456e16fa86mr3603852rww.22.1696446303020; Wed, 04 Oct 2023 12:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446302; cv=none; d=google.com; s=arc-20160816; b=ldkhPh4OJhAiVIyQshgzpqpssQPVPh26es/037dayVpnjNrnadmUR4cPlz7saKds6/ T0/Dx/NDnGoTyAaIu9n9Vj+2U5vCevMPlxDmVYOQrbsaMdRHnDruJJX40dse8qvLy7fB mUSau+e9R9tKGeTY5pCC6jflTFC0JBfxeQrIG2nwj+y6vLv01tJnGfWc94jAGv/MJo/r dvn8m4loxeygZWU2wpGcm6gexkicA9yVRCRnvcZ1XXzj+FTGYHDZyxv5fXbyWiQkZO3C Q3Jme590weZG105Kl1l4bi0D+8YvHp8vGvZF+S7YcoBj7NXLN3ehCtGpl9JHjh1aRlRh 1Mzg== 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=futZctVsmURmQGZ/KDgafuW1qDPP1YKGtvIp0lF1GQQ=; fh=Mu8cExWZ0ryo+xXd15sIvDuJ/P4rEjrt9uTues01RKA=; b=LPaRcH0XwYXeswQEFeVEvDBU6X7PrG37isiZChxQANa1jE4tpbnge9t6Z7LJrjKFgJ hRg9MWjiwZ6GTFE08TSpkKfftoqAXu8Roo8h1C2E3Q42FLdevHZ2X71sJGje8Y16qa+4 Lapi9H3rYBjfSNIpxSqwdLod20xQW2dGVcfO7sf+mx1VgxXZEHO05wv5tOlYq5eJYPuj 4Jsn+iF5L/iJ8uIjG4AlVMKJmBf8Tf0YxIYRU19+gOhj1849Q248mFIv2APTRtoknuAW Se8Ok1kGuQ+IEOki6bWGGN8uBJjXT30mIGUIjRkbJD3OuZmQ9KouTLxOPS3davXtU0eZ an5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SDZrwTkR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id c186-20020a6335c3000000b00565ead2509asi4381572pga.199.2023.10.04.12.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:05:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SDZrwTkR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 561388411D51; Wed, 4 Oct 2023 12:05:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244827AbjJDTE6 (ORCPT + 19 others); Wed, 4 Oct 2023 15:04:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245486AbjJDTBq (ORCPT ); Wed, 4 Oct 2023 15:01:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4BC42712; Wed, 4 Oct 2023 11:56:02 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:05:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852878822979178 X-GMAIL-MSGID: 1778852878822979178 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: 148539 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:254a:b0:403:3b70:6f57 with SMTP id hf10csp345175vqb; Wed, 4 Oct 2023 12:04:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRtbeJ+D53YfhfMzfWRLE52jRZpr+Sy8MUnJUodj9iIW7qZdOP7yA6EwXPa1d/ztvcZqPV X-Received: by 2002:a05:6a20:1615:b0:157:877a:5f5e with SMTP id l21-20020a056a20161500b00157877a5f5emr3550028pzj.61.1696446286953; Wed, 04 Oct 2023 12:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696446286; cv=none; d=google.com; s=arc-20160816; b=QJHWjgZpMMR/bUMhwL92r0QrnqzNEPij+a7Nra3eQKN5WCgTwbcjptOZ3xDBMm0AlX MjKAzcZkbkNt5XxrBfMVXlyk1QqIUEZvQ6qH9IyLC9ZkftCWqAl7Ow0z2ABW8W6wyngV ld9FntwREOo+zXTIFimTXTroprY3VMvyS3gzjpMRDjhDPiYSzIWlmtOo2ahrUB3jZ+5P M/Gd0eWF1v9wjU8kjjuAZ8b9YT1Nd7BY9E4uHHw6ht5lirDsG75TL87WEpWvn5elMpmO /o+NSqbR9NNrougOKia+enhDrQsDP+zbF7tDM+EDzVABZZSZLue75gsUGZpYtIG6dSoI LWdQ== 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=bas1HH1yNprEzYlUdRGZTq3Olr7EjY5TS7D6MU0JW7o=; fh=Mu8cExWZ0ryo+xXd15sIvDuJ/P4rEjrt9uTues01RKA=; b=x3Y39I2aKLim5RZju683UDvIvev6n4R4MB/EPbSZyUfubMUI4VNln9vRRaerwalR5E Z6DAAnoqlJgWrM/c7ZmL9wcBZ18mxH+ZfdeUQqcHtF+OjNIT8tFORApXtiISIuqCnWlM kvBYBtGzVwrevHbAzOXl02KL2F/9chGGZfooczg/qUDdXPCtXwSZOg3aM//XUSjZ4Vya ZT25tS3ORMQZS8R+79+wvnKDnlGCfjgGzrEfHeUDn6QRdQ/keBMnPPGQBW2+yv6XzRC8 IQ3HSrrfGaZLlMqV6DOXCHAZOClkfoSds5o0DFXK66sbbqr+juxeiDzYBDNM8cM/l3v4 j8uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NqVtdmXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id c8-20020a633508000000b005774c943feasi4411894pga.735.2023.10.04.12.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NqVtdmXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 12BCC840FE32; Wed, 4 Oct 2023 12:04:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245211AbjJDTEd (ORCPT + 19 others); Wed, 4 Oct 2023 15:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245664AbjJDTCA (ORCPT ); Wed, 4 Oct 2023 15:02:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFD8030CD; Wed, 4 Oct 2023 11:56:17 -0700 (PDT) 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-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 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 04 Oct 2023 12:04:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778852862142340433 X-GMAIL-MSGID: 1778852862142340433 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 */