From patchwork Thu Sep 28 11:03: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: 145973 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3232791vqu; Thu, 28 Sep 2023 04:18:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvC8gHU7G9WaQzjEWm/NntbheJmuV/e7iKxIzXG93UNgPN06vW9/+tNzYLZdwl25jS7mLQ X-Received: by 2002:a05:6a20:8f1f:b0:153:39d9:56fe with SMTP id b31-20020a056a208f1f00b0015339d956femr927410pzk.47.1695899916383; Thu, 28 Sep 2023 04:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899916; cv=none; d=google.com; s=arc-20160816; b=gkwvYNJTK6+segFD/yzZ2Kaq9mNuESJneE2AjqnUmw+3sQy4JjRUPfCsk/un7jswez d0yPW8I2vJvnFv4WucBv82Kat9G5wRJ01/PSovN3+AL0PmxMVho20ZVuJLPkB0TLxi2h YUhK/d4da+CWKWXoZxtFdzbfN7WAm+KzQpd0YdryPGqGr3pHcvGzoz0TiAlNjWGUjzd0 cI758wGs/eWAAj1ZOr1fifko/Agx+HIe9m2AShf0bCyenuuTOd7R6UVNt8POYYFo+OBg 4lbCAwv8hUIHfXoujAD+qoIXl67b8gVrUk+2ZDMJwuUXPgThC+qKrbH51cH6V0nsTOxT QWvQ== 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=4WjQgRNMdW3j3sfcIHlzIOpBIEpILEBwQl2Kii/SrPo=; fh=/7vYR5sTG+QGIoCUJVP5WAp5vyxYNiSsOPrHUOdylJE=; b=eR7fzQUOFm17I7kuvBZb3gZstDmToywfsaI2WEnxwJ7lS2uuZogDicHz9PB1Mo33a7 syunirj+2J8sIioNgtQEkbm2ch+BQo593c8OZBYo+yBOZ1PBfcj8S6mgTbOgaeZb+6FU mn3KVP+Q1pzjuz5NEkHWqltzhq3BaGNF/fUDlHXzxka0WwHY7wZIf8X9bqNOVeEQUW58 h1pyuT37Lu5sH6iYi6cK8a9gSpdEhpfvFc/gW5jJRGMgEhT9r9eQMvIldyicqAXQLXn5 zFAjR4hhJOIRERtQBg4w2pJ3/F2AXZibBNjpX+uR6V4pAhl++RgD8i93UBwiRMRycO79 Babw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cgJqBVdg; 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 b8-20020a170902d50800b001b222cd9826si18979815plg.349.2023.09.28.04.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:18:36 -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=cgJqBVdg; 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 78AA5852D1D4; Thu, 28 Sep 2023 04:04:28 -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 S232131AbjI1LEJ (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231997AbjI1LD7 (ORCPT ); Thu, 28 Sep 2023 07:03:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0989DCDC; Thu, 28 Sep 2023 04:03:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBF2CC433CD; Thu, 28 Sep 2023 11:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899012; bh=2HU082C0O+wshN8razE9iX9Rxehg6mRJCvsU5n9rFmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cgJqBVdgRTRGPcB9AYO9nuxbQNU/aRFlsoq2/9IfdhTUxto7jaIgTs2iK3Hh6VNmI PQNGXum64iBmE5gmxTB5fzhsNqjzKt2sLpABU1iY4QR3sLG/3TAi2tRkz3bK5NdR2Q 5J/x2S1ciuMIVP8CxOGFxyla+hxGROy5UoKNIuzR78QFdYK0UlmPcZ7xnSW65TY0z1 d09jqnFZdRWx08/ZfFzae3DcpVgwGYgcj94ylvD+5VeIqKKaZOw2/kkGfhLURz1SoJ LecijjrtKtsZor5I1BxBnr+8zBdASh0oRnrtfNreKI0opyGPJWi1hjF5WHyNrggNrR Xz99F3TmopI2w== 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 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 Subject: [PATCH 01/87] fs: new accessor methods for atime and mtime Date: Thu, 28 Sep 2023 07:03:00 -0400 Message-ID: <20230928110300.32891-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110300.32891-1-jlayton@kernel.org> References: <20230928110300.32891-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]); Thu, 28 Sep 2023 04:04:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279336905769486 X-GMAIL-MSGID: 1778279951090262202 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 | 13 +++++++++++++ include/linux/fs.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/fs/libfs.c b/fs/libfs.c index 37f2d34ee090..f5cdc7f7f5b5 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1912,3 +1912,16 @@ 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); +{ + return inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); +} +EXPORT_SYMBOL(simple_inode_init_ts); diff --git a/include/linux/fs.h b/include/linux/fs.h index b528f063e8ff..12d247b82aa0 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1553,6 +1553,48 @@ static inline struct timespec64 inode_set_ctime(struct inode *inode, return inode_set_ctime_to_ts(inode, ts); } +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 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); +} + +struct timespec64 simple_inode_init_ts(struct inode *inode); + /* * Snapshotting support. */ From patchwork Thu Sep 28 11:02: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: 146064 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3260413vqu; Thu, 28 Sep 2023 05:07:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkwARska7YnDJq3szsW/HvZCUGlwu4nYDdRMbnKlF1TdF3rDvv02OUe+8ya+243un6y5ny X-Received: by 2002:a17:902:e881:b0:1c7:36ff:1feb with SMTP id w1-20020a170902e88100b001c736ff1febmr1890373plg.17.1695902868683; Thu, 28 Sep 2023 05:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902868; cv=none; d=google.com; s=arc-20160816; b=H3gcm/SapZIktmPgLKPpoWlJQeZQhdVHq9HVYmFzYTj32HVRuIBC8o7HFAt+inykGo WPvaGqQBCMpSCz41sW0XiwK30BCg8Hw2QzgzOPSdMptsdI+cKajCpv+qOWOQvUhLqSWw j4P+26KoVZqQ1XaJ9FmuZsuOLT+oVSYFNrNJRLpNpjWqpK8qfOUlXY2oBdbl7OGEuxBD X4AUIiWkO296L9c5yt6o0nfe1GVWVAoa8qU9Sv2nPgOI/K4b+AecuxYLGSX6SPPOHW6X 4M2IKR5D+GJAAlPNM+gkYWNEA+sxxzg+shqCvVdWEQ1i4F4h7u1lI8D9ej2mq+MpmCfc g5Vw== 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=26QZJkXyCteUGIdsYDAprJvEMbX5nG5qrG3vbj0j++g=; fh=FRLbtCwnE2QMyYBcgoz83YFxCqWi4OZuxocxS01WDvU=; b=KR//Gz7ZqrRayHkB4i2k9BwnI+kwKrOfY2cdeJ+4cqqIlLOo2lUgrEXeW4OLElT2Df zafX6xoq6Jp+cU4Xyn1J93eBQwmYm2csJn81e5Sf00Pp/QWefoLFF71pQGDUc/2+e7QL wz/KTEdPblpib/CwuFxY7p/TYPru+BXjgtanpZmt7Yeq5B7d1QgwfSl3grVOnsmOrvy6 Cg48iW82fxIQgNzb+Vn4DUi3QRGzgZ8d+1ZyJ2Cbvt61PowfdnWI8JJLUjMlg4A51jCQ SdsNFcrZOcMud3OYrM32hn0nj437TPgDdxWIpXsYwY2+xDcB4wpQCPzX4gMxpqRqk6o9 kCnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V6CAZGur; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id r20-20020a6560d4000000b005855e5e2f98si3640334pgv.75.2023.09.28.05.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:07:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V6CAZGur; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 77BCC81A9A5E; Thu, 28 Sep 2023 04:05:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232103AbjI1LEq (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbjI1LES (ORCPT ); Thu, 28 Sep 2023 07:04:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 974BCCE0; Thu, 28 Sep 2023 04:04:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 810CDC433CC; Thu, 28 Sep 2023 11:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899055; bh=UA17NieiKuJUQtAvlfYpTNXdsMGRKLLOw/Cz8ngzkD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V6CAZGurZISIkQMn+b7qANzD5KkJ97vaooKgKjDX0Cks6k8TEzUpepVAKk4oIlWwG +jzZnGzmicw5BtfxrPApbAGLtk/nvnTQ9Jv5ftuLQnDZfLM3d7WMfTSLDLANOnprnD D/mwlEpY82WLyYRan0BMiKRvcSd4JFXXqoXYLCSAZDxaDWLf2nc6sEoEg8+eUfCBAv 7JWU5Ug2iCxLmiKovVzNi+U0ye7uC7YDSrGbPNkjbeysP1E8oTSNAnrj2sLl7jo+Sp 5PrpsKTxEDXT9eYDzu2B5nmLgbMV6ozOr+FCNbxbj2dfcUC4IxYnKsLUmfp2/y31CZ mKGPuQvOuScJA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eric Biederman , Kees Cook , linux-mm@kvack.org Subject: [PATCH 02/87] fs: convert core infrastructure to new {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:11 -0400 Message-ID: <20230928110413.33032-1-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110300.32891-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:05:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283046631661172 X-GMAIL-MSGID: 1778283046631661172 Convert the core filesystem code to use the new atime and mtime 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/libfs.c | 32 +++++++++++++++++++------------- fs/nsfs.c | 2 +- fs/pipe.c | 2 +- fs/stack.c | 4 ++-- fs/stat.c | 4 ++-- include/linux/fs_stack.h | 6 +++--- 10 files changed, 53 insertions(+), 40 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 84bc3c76e5cc..0612ad9c0227 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/libfs.c b/fs/libfs.c index f5cdc7f7f5b5..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); @@ -1920,8 +1922,12 @@ EXPORT_SYMBOL_GPL(direct_write_fallback); * 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 simple_inode_init_ts(struct inode *inode) { - return inode->i_atime = inode->i_mtime = inode_set_ctime_current(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/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 139190165a1c..b96a5918d064 100644 --- a/fs/pipe.c +++ b/fs/pipe.c @@ -898,7 +898,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; 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 Thu Sep 28 11:02: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: 146038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3245079vqu; Thu, 28 Sep 2023 04:41:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZVlyyR02TiMnMnRMGUC87Yx5RoTC23g8e5LRcA9lgiDrbJIq41QTIDKb9uVUD8ZMjmEdm X-Received: by 2002:a17:90a:fb50:b0:267:909f:3719 with SMTP id iq16-20020a17090afb5000b00267909f3719mr876641pjb.19.1695901314523; Thu, 28 Sep 2023 04:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695901314; cv=none; d=google.com; s=arc-20160816; b=BJ94VUI0If6Luq42UDAPr/ma1blXkTvKgYM2UtNJf1fBV8bjNSvzEVrhH1l09Y3pBI n0EsqGXVbFqs5f9KTDS9x42aqrtocEazYeJkfHs0gloP67/kDEus9UMQGnAI1E9roa/W CPmi81Ap0DLihWFYvaVwrTuFFSM86BNdj1ekJp2vha/42g22ezubbCRLIgrUwaRZIj8C eINgmj35D8yV4puCqtb1MjorLRqz604+IC3Yy5a1ECg9FplsBd0aMeVPbhHnFZWRnMZY QUWBaFj3tQJyXUzmW1j8lT7Eqia2J3zfQXLMM/kQ8GNVIA6WwzjRJfS/fqLhX9lwSbfq ebeg== 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=apx+eZbGk4NlVtf/CGd41TupZP2VzVzcRfU4Hvtozlc=; fh=Br4sZYkkHPCGn6Gc64OzX/zEQ/Cpu1eLW5N/aT160X8=; b=XbYi8zvF/RCdczvmRs3Tyfi8xRPjzK08JKKk/RqUkgqT8/B+mV57c6mPNasfVuZatn w/CJmpuplbAfQSY1rRYD2B1rzUPfQeibbqsLaLWAidAoNcR02bTkWDCfJ9cfRoxpmwZb 0kZfVeTeaXiwhOohijHkfCvyXeMxT4ZpZTEsTAVcMQ5THnCSOeLzC9Zn5W71mX67168x I4QkGg+YkpfjUS8Guql7U0aWiBCvgi1Kg8N/7CxbgRi3iYNiUtwWY6E5DHt/0vW5+gQf Oc3rJ7HIPJro9JWTYAjcpB/B+83z7hwDDuBC+KgfEnd51yiJfMjrYLT7p+OehKDVHrLa aE8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QtotdQ5V; 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 t23-20020a656097000000b005824bad8f83si11086194pgu.846.2023.09.28.04.41.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:41:54 -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=QtotdQ5V; 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 652F0801C0B9; Thu, 28 Sep 2023 04:06:16 -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 S232009AbjI1LEm (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232007AbjI1LES (ORCPT ); Thu, 28 Sep 2023 07:04:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6D54CE3; Thu, 28 Sep 2023 04:04:16 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD4F5C433C9; Thu, 28 Sep 2023 11:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899056; bh=vy4iAqS+2cdTey8A1Hl+Z+9oNsRq3NaJubtqW8MD3oU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QtotdQ5VeXWt9qtlPLzJfVS978zsBoD95Vsr3Vwe3/bMBUfsDw7LIoVItXc4yuUui 0qVKpaE8LAbipCamK4hwvmjgx+8OTbSajy6cy+Cb/UWvpUFqHhxDcjGopD9HYL9sEZ hP6gCGRPRf1rQWybWszN/Jaa5+//XTPoPeDe0c7hSOLw08DlfPAJZC+AOyoI3eCFlQ sqLESoWAUvzT8zYinaBp7EptGyIyiRmXptcmpIHirb4q1/8BDwNyy93KnnUV9LEAtG MiZBgYvA8J2zUuauvH+sD4dAU+Gap1cvQNcvbZYoM2uRbh292ukBO+PRtJ9GaOBEjP mvTBnCVYZthRA== 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 03/87] arch/powerpc/platforms/cell/spufs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:12 -0400 Message-ID: <20230928110413.33032-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:06:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281416805423003 X-GMAIL-MSGID: 1778281416805423003 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 Thu Sep 28 11:02: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: 145972 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3232693vqu; Thu, 28 Sep 2023 04:18:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdMQcadGjy8mXjW5Lx5bq7AZfyF4oOceLoOJiLNZ+LfqY3f1UxQPlQ+UgN5I/GkzX+X4VU X-Received: by 2002:a05:6808:2c8:b0:3ae:511e:179e with SMTP id a8-20020a05680802c800b003ae511e179emr829250oid.54.1695899907304; Thu, 28 Sep 2023 04:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899907; cv=none; d=google.com; s=arc-20160816; b=Y3NobnXk21IIsDKEfCdQ2gyqq1mdj39lftBR8EZoKDWEu6AjqI/QW7CtIyEK8yS+uc KqAh9DxvnKMw6H4KhDuiLYbz5twn1CO7R1/TN7g8j4w1rYc9DH3SafjaCAgpNmby6zOA OkvhWysgYMlgVvw1XMnaC0KQ17iQOW4MCEAE+O266juIxjSE6RdhHKFWFW3hpygHiNH9 M7wKCkSywnI2EvWGDcULY+exBHyKsNNnn8VW0a5RW59fRBbwVqbQjtV0rjXgWD9HpuEC 4i8WvZS9Oy5OHVrz6RPaPUd3L8VOWxFxT81BKHYkl+1t7bSvDwGJfsimW6p9tRFvMFz6 YgJw== 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=U821WjvtUzBeBQRAwhxtlW8jNcUJpGWus5eNptaUHKA=; fh=alN9iiYU7VU/LyDGC48ggoW9bbwq3WwAF7zkwWi62ns=; b=AcND1sNVRjAsJguE8shSae5J+ZbSIoDmDqRWwZWVDBqxKH85vw3CCpiKM7B78S4jqJ rM0kfNRZAskHQY+Rf/ghMxloY5RYf0LfoEatmdNQckYjNhTxwcEgyRH6iS9JC+Qdlzwj 4xrDqPURZm972Anp210ZMIAHtA8ASq1nGnWAvsZWP+y0JtqAjNDv1iiSlQ7okfqFpTvu YCxKtqsAj+dn56v0BOrNyn3esqYzHLn4KKxaQdan9BM6tVLY+VUDfpe3xRUb6uNpTtKC fLnR9Shky42YY6EDXkov7JFE6RTjeJYRjx5b2xHQhljTgFvTv/xwW/8pDhunwhnWw1w+ NnfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m7yc9zRc; 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 a33-20020a056a001d2100b00690fec2f3bbsi17858023pfx.85.2023.09.28.04.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:18:27 -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=m7yc9zRc; 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 8A101852D26E; Thu, 28 Sep 2023 04:05:08 -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 S232166AbjI1LEu (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbjI1LET (ORCPT ); Thu, 28 Sep 2023 07:04:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A50ACE6; Thu, 28 Sep 2023 04:04:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09596C433D9; Thu, 28 Sep 2023 11:04:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899057; bh=U6qTldvG3fnDRI2mBCZNMHraM10PPaH0RriqZeKhZ6A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m7yc9zRc/odRQoso3YxHFM+NP/EUIFaS0rMXd3b2VBxPHAcmvyIcGYNB+9jyU5vAR tSY/B+A/l8NBBUmla4ygqg/8Hqj2TgzSv7S0uDHLTWtmJ1U+WYNTi+W8Rnds0zE64o Z+ttMm/1ejLfeOUEfEeRB7Q7j5FA4ez/S65LspZtw6811mfKd0+SaDkER9iLdgRb42 mU9uzo6A8ABC+t9bWsEndtwI0Ocpp+k58mAcGbM18r4ak9HDXOJ7Y29+QEauZbjia6 mwT/NqlaIfBrNZRf3PqwteQay0XIUSG/4ftoYIpb2LHrtRQoAVPRGdj9dXFfZcMwGS oeJcCnAHeellw== 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 04/87] arch/s390/hypfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:13 -0400 Message-ID: <20230928110413.33032-3-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279941329038226 X-GMAIL-MSGID: 1778279941329038226 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 Thu Sep 28 11:02: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: 146013 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3236483vqu; Thu, 28 Sep 2023 04:25:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpyU+ovv74+Y+4COMwVnd29lJxc78iBkrNdqljyGFtczqu30JPl+1xnvK0+OK02GOEoP4F X-Received: by 2002:a17:902:e80e:b0:1c2:193e:1126 with SMTP id u14-20020a170902e80e00b001c2193e1126mr1329064plg.28.1695900346435; Thu, 28 Sep 2023 04:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900346; cv=none; d=google.com; s=arc-20160816; b=cS0eXGyQ4qEZUxkVKIOGXwzNoOlG3qkSNA+0yle2O/RTPjYQa12lfLJM9PcKrg23lq 8FvpgGHmAPPkmQwuDJI+DKjnFpnV4WNvoylZ6NRwr38k59aTw8oI+oxSgqPS0bhfif9h WHtIiDdiOTek+gaVvaZHhtTrtx7NGK9DzdHUnXniipogZ3Lhsnjjd5AR21798TDRKzpd IDqigdjZUA2bLbMVwIF8Js0Ea7O5j5I9p9nMpTa0rVG4TozE7F3gcRjGOlqSPhYkXsY3 KD1+1mbBknaUJYCD2PMC7g5MdxoLfnj3YtH4OifN0zzonwdHZOtuPK+7PD+UE/kihhF5 1KTQ== 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=KOS8HisMkVyC/MJ8YAvZ1Tb1+50n29Ldgiq8V30s40Q=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=tDyxMhPp5oW3bngH9ijxU5yA+i/X/RmCgTbGNgbdE49ElgHPdSQDHUR0ZwuODVBUU0 ghaByac8evp0wUprbRRTl5rMPPJxhxRN56nzCR70frFv0btYX1ePbSiUWHL8r/iPJn1/ Gkd10lUrztIfyKcA9IGL7eKXtNvFhJD9xD+NgXkXp4jeXp2kbrYt6BRbVfGheTRCyk4y DL2AY0ZaJnGh8eHcoIMooF+JoVjkcfSQQkaX6bvnRtF+wc+IaoD8mT4GJ6Bg7Nmkf2Sf /QSR8Rvfcg8OZ4tqMGrICPKT/d43inT1gUObjUqOW9dfd6cWNLWFXVqARjyqwPTR1sbp w3rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b6A+2xaI; 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 k9-20020a170902c40900b001c60c552a66si13652856plk.302.2023.09.28.04.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:25:46 -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=b6A+2xaI; 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 D9D9A81049BF; Thu, 28 Sep 2023 04:05: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 S232186AbjI1LEx (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232013AbjI1LEU (ORCPT ); Thu, 28 Sep 2023 07:04:20 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15D9ACEA; Thu, 28 Sep 2023 04:04:19 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42E05C43391; Thu, 28 Sep 2023 11:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899058; bh=IWRS0sv4F2GhgvX85r1nFL1OfwOp4/XyjcH6Y3xdgTE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=b6A+2xaI6pgQN+3dsy2mCOD9PDx411S3Ydu90LNqns7K3ssWCUiNw8xy4j4adpra8 qSn0vb75mY/qesopcA++AtWow4hoAv7r4LdYDurC7my3O18PkR0dtESNg4bTHET0Q4 3Ahy6fdOdNesktoORpFHDvBl9hkL0DV1HfvCyFNArLgZNSbZBo5ySrlzwIAQbW8Q6O czYwD0UdpJlXyTr9j9AArkgt49zV/RBrtWDJSXGVoxKT0YduDTN9hm+fHLsube0FTH n7WYM8LxzBpT4EcUrzycR4IccopqT4Y70wKaa4bJg9KZ9cxI/TFpE0Hz0HAv5Aaczg L68gy8O03b8/Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 05/87] drivers/android: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:14 -0400 Message-ID: <20230928110413.33032-4-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:05:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280401735289511 X-GMAIL-MSGID: 1778280401735289511 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 Thu Sep 28 11:02: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: 145974 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3232816vqu; Thu, 28 Sep 2023 04:18:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHqHmgpAfw+RKtcSkpKDoxp4GTClmocmrVHNeL4GY2vTr0HQNrwik1mOj18jxmJ/faojt9z X-Received: by 2002:a05:6870:9215:b0:1bf:50e0:95d9 with SMTP id e21-20020a056870921500b001bf50e095d9mr823777oaf.26.1695899920587; Thu, 28 Sep 2023 04:18:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899920; cv=none; d=google.com; s=arc-20160816; b=Hx+pHSLBMUHwRNTcSwn+3XAAaoh6GrV3PF2fKioFZPuOupDj2/P4rqImlNSLmY7txy mqLxTEVoEqnngCXyT6DWfLC3hcSZsHWd7H7dqjmYRvk80gG65FgmNPExcXD/Bj592PVK 9/DlZPp4p7ES2f/wiZzoPIt7BFexdLH88zYTkreUumLxI0QJv7kjz4AkcoyPEIVzvNLg XEOPeRdxua8vFGGTrmBdhlzW/D2BSHFdYRSzWXQac7H3N7eKqHpE+gFowCtmRSJoRzaX kU4tU0jXvoGRUEStGSwADbnV9mud0Vqk1ZO8lrHtlzSr/AmEe/3sG3y6GmLu2SsYbCDT j3hg== 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=liWUIdSSfUFf2mfMbaeH/qPtDKYTQmKDozfAx0lbLsk=; fh=+8yfMUekUhCQzg47WX0vwKLpcMT8BNCzX6xaRcIjE9o=; b=R7TL8sJ47Uip1ZmNsCGrCq/rO+VHwUtV5sow6iNHuc8+BwnJ+vUV18DU6Qyhb0cuoC +AqamYAauji4WCVoIRq1ph8mKguBrs8apMGkFmpCp6gXlNxykQ+ii7xkw74xFlKIRKVE EfLY4b8i2P4TC1Ngtfvmt/GxTG4t9ueulagJ4U/0TCdQI58hXFLHVWfgc55bJ0RhPKoH rdb4VZeAVUIkn7yL1TGDMsTizQHsNHSokal628+OtgbIxAKc1OU6O/oLE4ujcJMlnlEI aiPaYASa1dMUl/oJ8tk5En9+XNmwBxkrAl3rCGBQvXayWKeGTUVk/yusgeAIA0muHI9j EK5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nPqwZD4C; 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 m16-20020a63fd50000000b0056c0e3c77f7si18263047pgj.805.2023.09.28.04.18.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:18:40 -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=nPqwZD4C; 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 72D7D852D1F1; Thu, 28 Sep 2023 04:05:23 -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 S232194AbjI1LEz (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbjI1LEa (ORCPT ); Thu, 28 Sep 2023 07:04:30 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F575CED; Thu, 28 Sep 2023 04:04:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FC8BC433C7; Thu, 28 Sep 2023 11:04:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899059; bh=F/2vXVnF7RSXFfWEZqx0McB1XYKZ9a+y5sHO9ziDwMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPqwZD4Cy7y9WGVms+U5m6Hk04N6LpWf5Jpospahi+28gDJ/vF4Gd0fN34gydOKPu /q+Ln9ktX9ZRyI8aVL97aQuJJPAkNIeoIRda2z6q7tpjFVHS/C3pGa6G2sNItKsYw9 e5JdgqsSnD4gtN5iO6fHdAPtuXSiOyW05wBc+SyaSTkp//stXSjoyzPqQHJmcqh6Px LfYGtJyXrcA5gw0QJviu/XKptE3BYohx4HgXXOEw74sShXA1Zbro+f+vBh095sOLVu /QMe9UOALNRXBMZvO/Qz6PDfTSxOoF5kUEk5VudpxKjloQyX3MepG4cXSUryYYdTgS 442JKz+LTgtxQ== 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 06/87] drivers/char: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:15 -0400 Message-ID: <20230928110413.33032-5-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279954933860361 X-GMAIL-MSGID: 1778279954933860361 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 Thu Sep 28 11:02: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: 146002 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3234443vqu; Thu, 28 Sep 2023 04:21:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqhGmpSrgNhtPZQKAe8OCdM+aTOIgH5mdBJ1JZ4sOTkEByOTJLSzOnan5yF6YFhQiMt8TO X-Received: by 2002:a05:6871:8ac:b0:1d5:9ae7:ec79 with SMTP id r44-20020a05687108ac00b001d59ae7ec79mr962533oaq.12.1695900087676; Thu, 28 Sep 2023 04:21:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900087; cv=none; d=google.com; s=arc-20160816; b=gBOYzc0aau/qO6fpUOTK+r1U2L8geC22XA/RS44zgbTtDzwEysvaPN8Lb9Vn6vVOmZ 1D3Yyyh4CaQZYt7o6UAs20nmmlYWk5Z84HXhAhSM4zJwhVmBhszRPtBzT0CNk7zEw4kz r9Vl+Hgh0mK5n4UrEqwT29Qf/9dABF+PW6rYv66OCK26n5VkpoPBeBK0s8TIb5kZp0j3 s6/xmfG6VFA6FFmMPan2AqShFuh6QZaQ+NJ9bEO6Gi9MmCZi2UkTijWdtjm7tMEKW0gE t5L08HbjuQSkWGzu+f8Q4+AIleFMZCpIkfg2wAXSyAce16QmI4KEpV/i6bdputcteYFu egRg== 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=Ll1eIvfe9vIBpsZXRnTomIYoOtFDQvM6pvANT4USItY=; fh=4hjXy+Ew9zLbKbPcMTIRIHhS9JFJb7yUsoehK99e63k=; b=P0u8kiLrfafC1NPiWuH3Wtc7lFLq71+srn8YSy1lFS5fWQVi7ovGuO0qWjUrmRyI4E EkbzoS3iSuz7GIyZShWq6YM25H4s1KvYNZmzcxR753pORHoiUPu88/TpDZuRKzOhvAsR +0BCQ3ajq0wi9d4wNXV+szh74Ajr45xRjvoGi80p32ShlQhn+Mcs9zJJogBlcslZ0Osm 3nwiGVfLdnHkUdvap0RhCPrKCtbmv+oiStsp+5ispMWSHmOY04PyiXoBOvTVrcSNBVSJ wILYILQaO9oBBhJ8cFc9uCZ/gRC5JkZC/ZoolX2lM+/RkgN6xMgjnQ53FgjwW6USfd2B dIQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qi1QD7te; 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 i69-20020a636d48000000b0058555ea0a21si3927970pgc.571.2023.09.28.04.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:21:27 -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=qi1QD7te; 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 C9D8F82F08E8; Thu, 28 Sep 2023 04:05:18 -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 S232204AbjI1LE7 (ORCPT + 21 others); Thu, 28 Sep 2023 07:04:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbjI1LEb (ORCPT ); Thu, 28 Sep 2023 07:04:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4772FCF0; Thu, 28 Sep 2023 04:04:21 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59EAEC433C8; Thu, 28 Sep 2023 11:04:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899060; bh=p3gaIy18L6Ez/8RFoleMZQ9oJz9uAXoW5EHVT1EV0+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qi1QD7te6ipGJErObR0mgV/ZUuN6Cezsxu4FFi0wzpOdAfpIsp0V8wZOO3vofB1Mp X7umPRbV/U8IF4TMDv0T/8AX/QF2lEmTBdnYMDDSPyWYu7QU2RAj/ND+6Qmt/mW18T lZpB2p2ZUf7SJcjuPGQRzrgnz3j5O9SJfSSJsDnk3cqpcinLDThSLgxJV+HMjdlbvD EQ89HSB22rugBcz3xhb9XJOUG/hx9j9pxKbCcE0Ve80ZTZCjCad8EY42AD4IXQxDCs fCj4BWMRB/6tOO7/UhvtMziJdLTTX9UVLKBtFb6RHW13MYBw4NqvGqNs3bXuUSXLKE Y0ESkwlGhr1aQ== 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 07/87] drivers/infiniband/hw/qib: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:16 -0400 Message-ID: <20230928110413.33032-6-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280130076747423 X-GMAIL-MSGID: 1778280130076747423 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 Thu Sep 28 11:02: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: 146016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237295vqu; Thu, 28 Sep 2023 04:27:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFf/q4/oyNTc8rpw4RP8vdiHiYHrXUENeAb/5ChzC0INQXiPNJ4AMTIIEiJs8FaCew3aDkA X-Received: by 2002:a05:6a20:3945:b0:14c:4dfc:9766 with SMTP id r5-20020a056a20394500b0014c4dfc9766mr860245pzg.46.1695900436696; Thu, 28 Sep 2023 04:27:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900436; cv=none; d=google.com; s=arc-20160816; b=ameA/QizF0ruHjknCJPvUUwRbND1QPoiB11MiIoE4isT2UG5E1o8S6R2W6eLZVxhmT j60DdVhx7A4GZiplZ6WZ8V45wcucsv/hvB3xhjJTO+HJF5a3GX67/2oO0Rjnz/XA/Zne qGoJt8+oZj8oZ4i0XR/cSAjWd8pdH2tNVsm70IrTh0BkfPzdVCLOWC13DYMav7XQVP40 4sUFhcDfAVFgPUEyO1BvI6gTnWFY5KdIJYp2M3oH+FYE5YKoIg1Deu+2Plvhqbtag++0 IzoqUBP/CPqUDQdaE/qsl3GMRXMfI5ZpPS71ZO3QKzvxta0nfB+GQe2qGP8uHxlbW2zZ bDAg== 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=Wx20YVLPRo5ACCguBZeOqcXs8SAJccR2TVwAZDcm2Ec=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=igIYGOTAbIM8DiIzS28M7oyCAISyoPH1kbPY+KHhkgALzUnl08KqDcoSPgo/pqUje6 QfnGPJbgMwlrdg7qZ/szoM+u3kbMf/eXtgSbWQf/2z/aHS2zctQCDJa4cXdDbcZcJhCQ a6+bhL7DUSUNUQCiwSwxOgRHlfHRWcLBJb83G0mKNWaADQf67kkpaxccTGprdyrezmDr dAa2du85bZF/RAV1itVkIzwv02nkXuAI8MW5FpUQvj42FExwfYIJTV7AUmiTCuKSkPyz M2dqmRYLZuRDU0qqmeVQcNBAFy8M7Jy8zIjKnvLV3yHVJbBvlkZ9Va65xOnc/aoR9In7 e6Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OEaWy9rw; 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 pi7-20020a17090b1e4700b00276c22ca6a4si5158561pjb.147.2023.09.28.04.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:27:16 -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=OEaWy9rw; 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 9C046810F0DF; Thu, 28 Sep 2023 04:06:27 -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 S232058AbjI1LFF (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232038AbjI1LEb (ORCPT ); Thu, 28 Sep 2023 07:04:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45D06CF5; Thu, 28 Sep 2023 04:04:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D01CC433CD; Thu, 28 Sep 2023 11:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899061; bh=3ALQnVOlECoxdHtAC/FoUF2rGDdvF2VfrJ2fGjtK4Eo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OEaWy9rwkdDpoRIztwChRCTZrAEBrOEnWg89WwylxaBIO9kvN199Lm4Swvjrme7uG WjWBpyZXY1wLgWq79or7mK0GZ08aCkTAjMiGJZz2dxOGDJzOjv8lO5fzOvA5LL/tN2 V54d0WWSmPyB+/PT+cy16Aj4W3p5uhVPeTAr8/ph6f7UEITATOL+EKwtQliLO4DGWp IGYZp1fq7rX4M/GV1XiOfqTwbW/7+bUaYv5+jmWJCL7Av2e4wpzVAqXxZu+TU7DxSi 1ZZLOkBIC8yuzMTrQBnIpnGyP749mkPkWHJThdcLqToOdpSb+zfjQmoRigk/nVh9dP arV6TDYYVE2EA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/87] drivers/misc/ibmasm: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:17 -0400 Message-ID: <20230928110413.33032-7-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:06:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280496577606258 X-GMAIL-MSGID: 1778280496577606258 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 Thu Sep 28 11:02: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: 145978 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233286vqu; Thu, 28 Sep 2023 04:19:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwlcTrltUQeKnuw09pdakADVizyaJfsoNPjBF0qkVIk7LCEjevLFtupmqQNwNlqt/nqDCb X-Received: by 2002:a17:90a:e548:b0:268:10a3:cea8 with SMTP id ei8-20020a17090ae54800b0026810a3cea8mr769377pjb.9.1695899969886; Thu, 28 Sep 2023 04:19:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899969; cv=none; d=google.com; s=arc-20160816; b=kfnB5GdI3FJQrwnfztBhvgKxrNH1wjKZvTcu4Y0hHixECxTpoVnUgUkDCX9cp5KdSD lSDahv4cecWuA/5VT6IZRmGUqjVESNyVAsxODhF+3GKmKYdnJBwQN5AajFJsMx0FWd50 m3AqZAZJMe8RR6LgnfRGAodzR4E9kraz4cHqMUqOKJTIDzFzdUfSwHONBFL8uM7IoVqc OeKmjqLr6wQ6oGcOSZE2A8Lxu8D/cV9Qr7M/+5jDtwrx/5ZpSc2cBBGO4Q9T5e/gUivL o9Uu5RrjCdOfLORa419pcsiU28Nw7kHZbXeRghO4l/fkIYVdQDBdfSDhpSinAc/tGtki MCVQ== 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=w8wD8i6JWVdepybH/XXrmK0s8AzBJKaiq3bGoJOj8Aw=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=o2DvFfW9XMfZPPuq4uVjcUzKtdM6tXZLZWKJqkxqXottNUoXQTXHLnPJOl3zX9hCru p1y9HAOdtpqYC983bxdAs12TsHdUBDUZ6YqeaKGXRfkrczLB5xkiL5tH7Ty2LKerHLxk yghrx0Na/Yk0gKAu7JV+Eub5etrnWfjlM1UFH/WC9eleVfJIWqjOhXg+XLbBQ/611ILV yLTc5xmq76C5kP62ZMJ+Q+wLpBCaK87QwCs7EpJ46fewmbLt6TXSJIaAarL59f5/rNr0 cbo16vxCHd3yw493qFHv0lQrY3RzWLdZn8kw0hTlbvvmo4fnQcfkojyM09SqOB2/9EFl 10sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ACE6Sd1u; 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 s20-20020a17090ad49400b0026934bf746bsi18054543pju.62.2023.09.28.04.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19:29 -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=ACE6Sd1u; 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 B7B36808BC90; Thu, 28 Sep 2023 04:05: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 S232218AbjI1LFC (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232037AbjI1LEb (ORCPT ); Thu, 28 Sep 2023 07:04:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A5EFCD6; Thu, 28 Sep 2023 04:04:23 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73054C433CA; Thu, 28 Sep 2023 11:04:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899062; bh=a+3ckfaB+PnX6AyXrn1j+tvzd0IksJ7KOkM6+jjc2gI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ACE6Sd1uOoavzEstAZ6ei/eXOLQaRjtHOww4ZsQEyD3MPwkxBZ9P2k6o/6RexIDWF n08t7TNpuHkE5cFSFKten4LZp9cRemyrytOSWofYEwiT2/uRaOTs5R7UtnEHd+gxbV Ul2UBzYh7AxnDz1e+BWGQXk+l4NvCcBl5WBBqsAc2kCwxRF5fIOa66aNUdLKQ6SnRN 9hms3x5G1lCPNmKffC/No4vVPAN/7UXT/8Px3Gu+Msoxq/2vnieavXQruZ/YiS6d40 Ck1MArK4nWmMosqP2SzhI9QzrVZDpu5wh/atRAsnTgJqwSSK/cHmF3CbQvsVVSsBL+ Yk36i03pBwGaw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/87] drivers/misc: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:18 -0400 Message-ID: <20230928110413.33032-8-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280006836569271 X-GMAIL-MSGID: 1778280006836569271 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 Thu Sep 28 11:02: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: 145977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233274vqu; Thu, 28 Sep 2023 04:19:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFj+kaOCYWTo6CSKp513hvSI78/nqh3lt97hoPubM2IUZLcnruPmXHTjfozlo2u1NiSXRbi X-Received: by 2002:a05:6a20:8f1d:b0:161:7a0c:3c37 with SMTP id b29-20020a056a208f1d00b001617a0c3c37mr904621pzk.5.1695899968726; Thu, 28 Sep 2023 04:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899968; cv=none; d=google.com; s=arc-20160816; b=KiVqVdndZ6T/X6mJVtZHeD9FDxyVC7j9pibUm+tzVU9Zcj13XKPZIXwNtdsoLtyISs 14X62ED9wTxmrv8kWpeLcyyLVcTm+qy2ZmDRQ+Z5ee4YuO2bfKT/qP9LGLCXwtMdGeLJ 9TLeiQkKE0Aiu6rYbmcjnOGIGoCS/lUJM6ivm/uMCaNNxoiEkLRIApmXAViuL7ZRw1gp L4ZmPrTy/3eY/MDkVUV/bb9ZvmP1GgLzow+PxCA29K3LdABTb7WVu7sbxtQ71qZWL+wp eYiTcQDBiFz/13Q0Fi+daid1VOKyVib2pIeREk+j1RFjQ53yF9BQ+21Y94LHGz2QI9vU tWnQ== 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=/8E0rN8hJsVPt8Up7JfSKhldHdB+mj4ircRzAL7YpWw=; fh=+8yfMUekUhCQzg47WX0vwKLpcMT8BNCzX6xaRcIjE9o=; b=y9985AoJEf2rJd0sFBWxdQsyj/qtDlJt1ywXbvAKvKsWppbdAgUjjZky4pJ/Xdtxqu SG0bRcqCAixczxC+UKG1I5GdMWsejsKgdMT24O0hqLtBBscK5ZU2EKTHJyILqYw+q1J9 NIg2KioycFrYpWYiYp1DV2KX4IukeYaDLs28lg1YomLOUm2PPh2CCfwvjEwUYfbneaHg xTdI/SSjw15BJDYwh6XbAUVZJXNV84OY0Yn7TIhD4xUGnPQTFrP2LyNkWvcRbiEjUWVy vt4g5WzvAtfYKAiNxzvZH6mAB0SA4Gu96e/raZF/MBREoVymxtkEiib0ZGUTiUyCy9Da stqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D4BXIqJk; 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 y20-20020a170902e19400b001bdca6456c3si10790563pla.46.2023.09.28.04.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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=D4BXIqJk; 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 ADEBC806E4C2; Thu, 28 Sep 2023 04:05: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 S232240AbjI1LFI (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232039AbjI1LEb (ORCPT ); Thu, 28 Sep 2023 07:04:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67210CD5; Thu, 28 Sep 2023 04:04:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A785C433C9; Thu, 28 Sep 2023 11:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899064; bh=eVFhQkfQVqf4gs9M/VScIe2dy+KCM8XqSfbuDTEEv18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D4BXIqJkjIer2J36/jjuS1leb1eoLK9uMn1alq2qlSE8DIQWS1/4lw7PHC2f9rSbY ME8jaBaY+iopsg34w4B7hJt0vCl3tfO8VxOzJrHx4dVAqrfd8B8RnmRmqrbIwPO2Is FNqowz71cjuB2n99b36G1bAQ/pNKxqZpS68fmueK2Toq7OnChcWkAIekh4C5kPhMd+ Vp/sANvkx94Z9zHDGSXXiJCI9bimsqi2U0Pb7/C+dpMv7ueCHXb/SdmasoJrppB9Ih 7leftXu/tEF1LDvqBsF5SVlnY7/Xu4G2pkYBTlmIM6nCaVhHUVdmNPJeCTE8Lf0yhs zZJmbqSwoAw9g== 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 10/87] drivers/platform/x86: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:19 -0400 Message-ID: <20230928110413.33032-9-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280005758096767 X-GMAIL-MSGID: 1778280005758096767 Signed-off-by: Jeff Layton Acked-by: Hans de Goede --- 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 Thu Sep 28 11:02: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: 146003 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3234656vqu; Thu, 28 Sep 2023 04:21:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHO4l4JWn0Zjy5rHf0QxCXVC+QMLqj3pkw8qHVR6MJpi+h3hKd3F1b4a/LmodqSRhuHNPTX X-Received: by 2002:a54:470f:0:b0:3ae:4cae:8803 with SMTP id k15-20020a54470f000000b003ae4cae8803mr889329oik.16.1695900112194; Thu, 28 Sep 2023 04:21:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900112; cv=none; d=google.com; s=arc-20160816; b=UpZRGbLYXin1hNpRAj5lwDkiDVzXj1OPZrE36EimYk6VHJuy+CKQR+xYaKZc4zfls5 c171a0qXd508PMpfVCeAaMdox0lK7eUbSvLsBQdD793a/HohAvKh0/EdgD0K51tH3ImZ oEfzK4vcE4WPx8iXJc3jTQwiGR2cZmHz4qTwItgSJMHwfAf6w25NAjhEUVzWx0QiQYb3 a67EjDbMG31If1y4RGhsPggTkV9FsZSxgXu4uUlctPje7gQD+Eh0sJgCGVOgkLdPPOiS n5J1Y3WzlNw+rPZePuq/FUukQ6GOkZrq/CMZEuYcU5OccWVEQ08iWYY/uwRYp0SkFPgQ R6dQ== 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=GKXANnYgStHpijT524HZ637Y170/CJsMU8YYLb5oiq8=; fh=xIe+y0AIA/13BB/Cht5aiJtIw4tu3ICDozyOO0XAK3c=; b=z9mqvEXHTb7rLDGER8DoE2cp8S9L3KZwFlKkI3DL6iGz7W+LstLgN5VtlT3cWcwiJl eWLxp+5MwuZOGb6aIrh7MrYITphnYZmt0W/KNyw9gCvIjGARPHW7aM2PUDInEo7QD0BK 5yX2zbk4yZV/r4ooS+lv06HmMxL5i3A9yzx7aDvL2gZolqnbUDb1K3N2iP/vJ1O5jNOd ck2w0d+mR9QoKbw/H0v82AsmEATfZQcBoeCtPtsonDtYXIlKb/zr2N9StkFh6aWKtZpV JdDnoiaV23hblQ3PyngA4pDJaaVcDoYgVz9+1CRibpDKK0tOW5Iv8weAZ4/ImortDTNR 349g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hdz1GGMD; 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 i184-20020a6387c1000000b0057d7cff25b5si15686262pge.258.2023.09.28.04.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:21:52 -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=Hdz1GGMD; 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 3A80082F27D7; Thu, 28 Sep 2023 04:05:30 -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 S232248AbjI1LFM (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232045AbjI1LEb (ORCPT ); Thu, 28 Sep 2023 07:04:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F2C2CFC; Thu, 28 Sep 2023 04:04:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E37FC433C7; Thu, 28 Sep 2023 11:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899065; bh=cXvhQkkGpOgsc0ELKlchqmSPWWV4/XY2qNHuw52SmqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hdz1GGMD7Vkz1trWmZe+MAIrycsD6w+ykdbjJl/6qtBpgAOWCWWYLP0E5KCgjLLyN 6F6GyR/ODAdFEaO5JLfy/5T2ugxoaQXBU8QZKMkrOnws+vYgO+mdSTvRW+1GweRS7G 4f6BG2PzRVr0NamMXpGuUQWR9mh0UkecaEZyb2NP8YGjopQGKnPba0T612ARuYvF5R quDWh15wjMATCYdswtWOt7ChygA1/6S30LJaY2MSAnZSshTisF/jvz9hTrwpH0gKiC +v6pB8bOuOEwDn73gQ1XFqCJYho2w4WD1hAQhjrIicBHXYuyjIEMoR+1zy85k1XYyt /IpwnIC7DQl5w== 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 11/87] drivers/tty: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:20 -0400 Message-ID: <20230928110413.33032-10-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:30 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280156159064044 X-GMAIL-MSGID: 1778280156159064044 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 Thu Sep 28 11:02: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: 145956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3229763vqu; Thu, 28 Sep 2023 04:13:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV89At/jMtOdXCjp5oTRLSaKbeug9l6cPOtpk+EWiGCE8eFdJp27tXCr5KECUHVAyFBLpV X-Received: by 2002:a17:903:41c7:b0:1bd:d510:78fb with SMTP id u7-20020a17090341c700b001bdd51078fbmr1577293ple.3.1695899585549; Thu, 28 Sep 2023 04:13:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899585; cv=none; d=google.com; s=arc-20160816; b=h+FgjsDjbmThD5KQI6ZIPTnO8w2HDVVCuH0JmiZiAycXgL5yyGLBnYEf4/P1f4LCCn IoQxFZZRGZk9yb8qIPVFKDXD9yD2Lk1svtZzNrN6FIHLBO36y8tVfOXJA9XCvzORZ1j+ hEUe3AYxKZ1mE5a2etnG6ObaEkB8TeLO1d9r7wkEVKomca67fof3FvNDYjiDddaVCX0z IWXMpdHfIKidLKlCJS4+M6i8Ll61ozaz+KKNYGmwlBGHeoXKGLPj4XwmJyMBscmC8I1p wn5X1K10aC3QoI9TBaPg0YArc0WV9pne23wXfgbOoONhWMuGhnnTYK0uI9dCCxjOjIhR VCZg== 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=sVOXLYt8HtPspk0KxKKSgK+3+67Sg9R5Y4iBx7ATbz8=; fh=aPoMQYeH3F20yp3HXGkR3ALuDT4a0EJUzoGf/IQZKok=; b=YHqM705shEH8PhIYiTdAr9d2HptkPBgdmY7/awJZaDynsmVam1wun9g+rZQStphsa6 ejn+4CGnxa5SYZ/lILpFkXLwvw6zsGqd7W+OP7/0uoQ1fs/aBX3SdrDiTl8Fz9olvOZv a3xEuOD3iQYIQynnwzybwScu3Yg9FnBzJZEJefkm2lhFCqFbB5GY8hXNM/c7bx8F75qg L4fYC6rzOWRMUeOMMau+z7Mc0tLVLzSRnaxEerH2L72kbIrq5SLcWGiavq0lIxjmmnZp eG+XkTpHZQtoxy+3U3kSccGPHoJXJlh81WdBuf/6HJ/S62kesrd+l5Xk6WZMXYQfgqMU 1TAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sOexUi2U; 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 c4-20020a170902d48400b001bf1d1d99besi19094655plg.423.2023.09.28.04.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:13:05 -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=sOexUi2U; 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 C251D804B3B2; Thu, 28 Sep 2023 04:06:57 -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 S232253AbjI1LFQ (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231995AbjI1LEc (ORCPT ); Thu, 28 Sep 2023 07:04:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8856510C2; Thu, 28 Sep 2023 04:04:26 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A31E0C433CA; Thu, 28 Sep 2023 11:04:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899066; bh=QDqDcn22I3Xej1wGpc6CIMNGkDGMknT+KKIDbqRGjAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sOexUi2UsUiUEzdFjJT7h3TUmmFDdKS21QmR3TWf1B1ebJNN5g/8VhArqRdCTGvoF Dv9GjuVn9x2qL8yfytC8GLPVAL76M48Bl5S1nqw9auCE4h59G4+EQ66ooS8JCHcFnb k4MiFRlkgCumyAbq5sBDO7XqpM2ezWvH8IQdTVqASN5N27aaBitLA0o9uc1LMkA/SW VAldE0DNZP4+Mlk4aPfsKoTZdq2fjFjaY+BX6hYWFc46R69YFTWUONwkvcz8y1///u z/lIMp4np91tl6rFnVWfObCf7sVZLWumHs44B0qy5aqYcVF061da130XqFqijxXLze kgmmLi6Yq5nng== 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 12/87] drivers/usb/core: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:21 -0400 Message-ID: <20230928110413.33032-11-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:06:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279603774496636 X-GMAIL-MSGID: 1778279603774496636 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 Thu Sep 28 11:02: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: 146004 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3234717vqu; Thu, 28 Sep 2023 04:21:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeXj5P2z+cAk5ITgxJRpDDoGn4XemfhlF4KCOjf+jU3ekx+JKx6DGTEfDdKn7pWl1PGc9s X-Received: by 2002:a25:ca46:0:b0:d7b:969b:f3e with SMTP id a67-20020a25ca46000000b00d7b969b0f3emr848218ybg.11.1695900119125; Thu, 28 Sep 2023 04:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900119; cv=none; d=google.com; s=arc-20160816; b=R3fCaSKZ0j7Rigv5nUh+SE6ZJ9JYzHvdVqz9OWfVSYz+zLyaIxuv8ynEaolnzJys8n bAZj50hREUQFv6U2ITmftb39NL4vqx3XYY1y8PHlT4bITV2aClacLe1lYURi7jnIulhz I3SEYHHJDN7Pp/kMEjeS23gpTE0rZ+DID/NHmGm5/FYVX+InHl2r2ywHzPf1ljAORNT3 rBULDOH5uwLm1Ip2hf6fJ6ni6yfzLXcZiRTKKHVewdOuhW2N4kiPurez+NnnIKphQ/jd iiNLet6UKiIXTHyZ3GTKUkF1ROTWFxUutwTXelu0FMow0RaEENKb68laleeR4Er0DGoI XNJQ== 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=39Fp+3QV3LrzqV6hyWVDf1Z5e+2c5xY6Yzjuh7y+wQE=; fh=aPoMQYeH3F20yp3HXGkR3ALuDT4a0EJUzoGf/IQZKok=; b=CJgW4IANr1+QWsGhCfkxYSxNYB3ibP7XuNJhs8tC/JrWbx97DT+fh+L+fQFisD/pCZ PcP0KC71PGSFMXYTX/29F8Hnrhi6l5i0I+9goJLjBfSHji1Gmyy6rsVckD366eOvrFhH KUKkP4I9CgnNtrlHqT1KhqlSaRtYamTMovk6AWCcjh2+BAMVqO3BapIEZFz61RQ+ncPE OiuTNc/Qv+ntZ2oRJp7BH7O6RKjqBNLQLYgzfUOuUoEhlT5D/NIqu8Y9PZ975b/W6arh CGKFMbbqqyhal39WX+1aKa9ctkJFeTohv7mG8SvMIIOJeWCVrga4mG2fY9Am2kFQFGfE OlSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tBRF09ys; 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 w189-20020a6382c6000000b00573fd75b486si4336095pgd.658.2023.09.28.04.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:21:59 -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=tBRF09ys; 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 CE71C82F27F9; Thu, 28 Sep 2023 04:05:39 -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 S232259AbjI1LFW (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjI1LEd (ORCPT ); Thu, 28 Sep 2023 07:04:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D36E910C6; Thu, 28 Sep 2023 04:04:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADF61C43391; Thu, 28 Sep 2023 11:04:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899067; bh=BjT5FOHm+eazmJSyqelvN0UNyLg8HYUUwJ3M3CdqJxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tBRF09ysU7N2igynCW093NVQflZFAh+gsZ3yeIMONpafyrjtuB5FRDk0jdIGxfBy/ bzy5MZTW/WBmqP7cJIpKOZQwqFtJdpQowwjd/RlVj1j3zhhVpALHNhkrzhqHdkMGdG C83PebiDEHuEZq/fRlMdeC2xe4NR9YAK/CwxVzsnK3U9H1fDLO7rCo4BPEBjBVuqJG 2jguEeIc4dODzqxPPUeOcrVr+DXAYxZSAm0FYGckqnVyrLnXrMZTRWJaGo1AN3Kctv A/Gg9A0rI7Ep6Oy/e0uxDaWgq/n64BeUoobMJTKZ0NK91j8mK7dFNgr5meU5JaZaHe SQp25SpvR3yWA== 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 13/87] drivers/usb/gadget/function: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:22 -0400 Message-ID: <20230928110413.33032-12-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280163450675497 X-GMAIL-MSGID: 1778280163450675497 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 6e9ef35a43a7..ec26df0306f2 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 Thu Sep 28 11:02: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: 146005 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3234839vqu; Thu, 28 Sep 2023 04:22:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvyQsPwdIpN2Z8f0wIq8TmeQlvM0kZKX2OMSANqYmYmTGlx4FqdLVy6nGsTUjSVGJ8mhG9 X-Received: by 2002:a05:6871:14c:b0:1d6:e8bd:5b48 with SMTP id z12-20020a056871014c00b001d6e8bd5b48mr846874oab.56.1695900133717; Thu, 28 Sep 2023 04:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900133; cv=none; d=google.com; s=arc-20160816; b=ikIR2BXYfzUIbgo7qEjyRRc2RS+wjk0k+HsfZpiU4ro0Mw02mNrqrfFqyHz5T5DU+f zzhp3DxvJvlgt3tZ5PgqL998ZzDR9sUwve2zgdFBT/AIQ6eq9HRAIg0Iwlo6mre2j3ko kpPS5d8bFsn2UNXCw5lrBtlPbvva3ffmVyfIKsE32S2hvdvMcsyIq/qQDYr79cpDAQ0F xEv0Qs/LjDRjNZTCosh+SVbH9EQue55p7nNs6P58g/Q8BHebJkkQwl7qSlwltjYRZb+e kjGym3K/gmhi5aVDplFgvzrVpBRVdS3VIa2139PdvTlJdQSVI/bOtFFJePnJBB0lOtvf 2Uag== 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=DV5ZirvMaB3QLBld2EE5eH/2VGWgR7Rg3N6aXB4EiMY=; fh=aPoMQYeH3F20yp3HXGkR3ALuDT4a0EJUzoGf/IQZKok=; b=Fk/dXwCO5jLJWELELzRAkLj/u4FpcSInrZjqP5+rf++l1sJgKmYwW5q5Tq0at58GZU yHPRIAWIBlH2jHS/9iE3V4Q3UmS1AnJdhaME0Gy2QxUqdUNqqhGaRi2V2FT8c8BRIcTM hPj0HA5I4RVa9cvVft+Z+CICc94S+CbUZjxS3syjjuiXwPqn0i1wb7PIdu13vnw7OAXL 438D5K+dspuud7lJ1V9zMIX0PLxur48kQhoW6dkQyinZGlYzVS/DvMgwQBnKRZJIWn5T aQuxzxh03R0A82x/BKhaTeu0F/PHAwYzQpxDPatcfmk7fF7eo5Bf+xZaVvVw1IRviOdI CTtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GI7swmbV; 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 az1-20020a056a02004100b00577461b010fsi18704892pgb.685.2023.09.28.04.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:22: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=GI7swmbV; 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 EEDB282F27D2; Thu, 28 Sep 2023 04:05:34 -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 S232255AbjI1LFT (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232064AbjI1LEd (ORCPT ); Thu, 28 Sep 2023 07:04:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D67410CA; Thu, 28 Sep 2023 04:04:28 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C46A2C433C9; Thu, 28 Sep 2023 11:04:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899068; bh=slu/w5rI+KXxDY+5fpzzCTL3L8BN0xD+uN4a6hp53rY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GI7swmbVibd1tjnpl/jAkDP9LmrrY1nhy3unkOrf0gYEvrV9e9PCt3H2+UCFavHjE U2ynj3iONb40+fZ5mpQ4FOwKUOcLuP02UXSoHignubFnOPEscgNc43+oxi3Avi7a/E yGSuUbxkLF99cgYAQdsuIahGPKcofVDZPrISq886MwofoYoXcFTDsaY0FsRWqOnwjA i8hFXvoUv70ngcew2yEjJ7BB/7ZcF4SHKXF4qMKUwRcNUEUMYQRQqRzorxu5he45Ru 61F7zWbFo9C5MNYOujXCAz427YNK1L1L/liwrSvDDgx3h0grwXE0mKxcIHYZrCYWDN yCZyYBzSzQmMQ== 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 14/87] drivers/usb/gadget/legacy: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:23 -0400 Message-ID: <20230928110413.33032-13-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:35 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280178634237105 X-GMAIL-MSGID: 1778280178634237105 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 Thu Sep 28 11:02: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: 146037 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3245069vqu; Thu, 28 Sep 2023 04:41:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSW0wnzb2WMLaGj5khPqhQFXWgBmSwWbdOpEJaSoiXJYVwWdyS9+DE4+1sxwFN8cq2neOy X-Received: by 2002:a17:902:d4c4:b0:1c5:f110:efa0 with SMTP id o4-20020a170902d4c400b001c5f110efa0mr1008893plg.30.1695901313009; Thu, 28 Sep 2023 04:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695901312; cv=none; d=google.com; s=arc-20160816; b=bBhdiWLWcAubYSYSq2VD+8S25FxnehnbiN/mPiZWk02adeWZDsH3pyqEpTdkV6Y9RN /fWSWqnnQp9nIInfGRJqvr3piQqOWPsD0lrRtTmYc8F1vBSrL2xI2ZqctOzR7mRLk5PS mb5VYKS7JZYg5elWe8ANgNH5/ia2Gv7J739uepXqg1M1DLxf8fr6yd2IWY6fcHKVi0KE vF47VxBz2XzvFNcRSzFYV9GEuCo7LsLycEzqHmYFFvPuEHN+HfdI3KL0p8CtVoots6I6 nS4g4uXPnt+dZHPCaLK4zv/EbTGqvXlAaX1sW5gGgOXKuTMe98vTB1rQYO+fOS3juQdK 8HXQ== 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=WnE7FOqTL+S0edSrm4Tj7EhJ4qzKE0CnnUGlwuUxbhU=; fh=0X1+ZWAKENe79Woy9vzy7Fij6FNDnu7TocbHc/JoZg0=; b=Txkge3XbWduzVUGsiDadgEr27jJ3OyJKXOXqobmab35ujSPqdVFAXQQ9c+ppOupbDC JKG2HwWWJS/hwo4eIKacb0gkX/xhfBCmdKzxcYUqtwXah+TNAaR1uGTdUnK5PeLC2tPo g7SvsRAsY2mnpkFQMISkggs3J3GEHOV7c7EBjAdkGkB/EjINpffeDJpWjS0V0AyxU+34 dOAb1AHnfIaY2Zf4L4H3DlVtkrI1UBsqt4ZHDwXr/vdck4UcAoxssVxsWd6jRsTdqiB0 yvgBhcqzZrnp5h0/gc1N+mnQjdRzezwPl7Nv5TQ1g2nL5let9RSYT26Y6S7dcelAC0fK JgDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jFqCDKGa; 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 a7-20020a170902ecc700b001c73489c6a5si2026200plh.484.2023.09.28.04.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:41:52 -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=jFqCDKGa; 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 C6CDF80D0812; Thu, 28 Sep 2023 04:06:06 -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 S232085AbjI1LF3 (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbjI1LEe (ORCPT ); Thu, 28 Sep 2023 07:04:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62EC10D2; Thu, 28 Sep 2023 04:04:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00001C433C8; Thu, 28 Sep 2023 11:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899069; bh=gMKvmRXp972OYt1KIoLm1NC/jDCunsGX2jl689W73G4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFqCDKGarV5U3VWmY4tvVnReKQ3wRK5JN2JTbyffcy75PfIin864DidI3nngnDFmv slLhZDQg1cP7vtJK8LnHhJuVDxFbqBY0jr2x/Xi1PFQon8Il4lYfgXFgd4cznXFjIM Y4v8Z/XGuW7TOfyqDjF38FvFnV9RmnDbcYD2BwD8kq2oVKTMeIUuqsqHxJfZx0prex FlH/ujcDZecDxg1MYOJkrtr5SjkWrhu1lNE7YZHlKH8xGOsMi/uXK71sMoElBPTN7y 7ZEDENfZ90v/Hvkv2x7qvVqiHTLET1G6QuxwVrL+RIiOAevVPjG0MWPFq63ldFiTQh P/QwYx85OUEgQ== 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 15/87] fs/9p: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:24 -0400 Message-ID: <20230928110413.33032-14-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:06:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281415167855656 X-GMAIL-MSGID: 1778281415167855656 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 Thu Sep 28 11:02: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: 145979 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233293vqu; Thu, 28 Sep 2023 04:19:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHInnLPu/l16x7oTk3f0uPn27Xmtci+v5znQTgZKpD/6igNINB9js64nyCBFE3R4/Rk914M X-Received: by 2002:a05:6358:880e:b0:14a:e358:f436 with SMTP id hv14-20020a056358880e00b0014ae358f436mr930120rwb.1.1695899970685; Thu, 28 Sep 2023 04:19:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899970; cv=none; d=google.com; s=arc-20160816; b=mu+XtgwsQSQ6QmbW0mKHSeCC8ig8Cl61G3zLRcMkFYIcLOVvLRL2PhpWWdg6b237cA ENS1qC4nfBcG/+byvYcGwf1561tTa/3VvVGDLWYwjz9vJChdrWZ0C8k8nSCenIThKM6M 2DzjwiWj7mP2uomTLXRpiGjL+Ym2Q+3mcE/GxkkPCnyyJQz8k4QRbyCZgF48MbsNogrN Cge32/9sSEdC2+EV/JSXtQnDwr8jAiB8ec3xLXQlQHXVNuY/9WJg4q/76wvYKGY7kqB+ ATXnZnqNc4tZkfOYzx0FRUHSXg8YZ9DfsWIcZhma3bZe18QTIxTPUWa7njyfPH+imbbd 9B7w== 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=g5uTbgo1XfsVA3rVb1XeIC6D7KBKmGgdKhtlV/CUflQ=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=ynvWZVa3pS+daB9q/QgP1Fsgn7FmngV7/S4VeLrjErCBEmB/NKweeI8DVnERYa7rRP /3tShrxuz6KmkyB2GyybltHqgk+jzaQ7W0rh0GZ+mDHFkf4pmWX+fMc1GFaqj3fQhuNW 1sqb1ZpVKR5MnP1VYtvXzrmPhP7t4IJ6yIvtUU5GgrKkh8PeItBi6P4eZDKEi/NuQVlA G+14FxO2pFcBBz4+orikWcSXkrtfB8MMhywMBILF4NFsgNIadAiGtNMbxDKSE6x9g7to ilgDpk2cOR1lxiCunGmAV4DEN8SdAzr7DbPvczhLJZacbclX4vpgZOQgCpR2ExWxLQWd ypRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="NjH/iogR"; 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 k33-20020a634b61000000b00578c9144919si19122935pgl.254.2023.09.28.04.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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="NjH/iogR"; 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 CA3CB853A0D8; Thu, 28 Sep 2023 04:05: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 S232246AbjI1LFe (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232079AbjI1LEe (ORCPT ); Thu, 28 Sep 2023 07:04:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC7C110D4; Thu, 28 Sep 2023 04:04:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 221F3C433C7; Thu, 28 Sep 2023 11:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899070; bh=dL6JaAiMJi3HT7tWmss/Ey0r47z4tWOLj7wgAwDVROw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NjH/iogRYz6SgUaKyOgKzomJjki4Q3y6ASQGKc6mX21XCXB7P0OGSXWQZf69ykW2J 8pF2jpXANCXg6IU/rM9+khNGxHsYu4Xf1+b78EIn5ZOnZVH4hH6v1bwnsir/kKV+f/ zGUEPStlGXC/+hCAeRkLzi3vHTMPQ7eozqG+8/y0SW14KhRMYeZs3Kqd59pGQG3Yit CSkw66RaE9mJwfryyi5e03Iyw+dRLUvQwH/Xlf8P26oy5xWxTtNqLR6uiaEvztJMSc hsKclpLRTonv6fm3zlILBcnjOAACov6zr8YDw6JDAXIRW/e8r700SQiZ+SMSwIRYKQ z92ev2yAnJkhw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 16/87] fs/adfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:25 -0400 Message-ID: <20230928110413.33032-15-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280007834379874 X-GMAIL-MSGID: 1778280007834379874 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 Thu Sep 28 11:02: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: 145980 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233389vqu; Thu, 28 Sep 2023 04:19:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF3tMo5PcwGQM+hoPv5dHJ350zABNehqP1x2ac7zJlbgAf834rvB60RHgPbWuUv0+MZy35p X-Received: by 2002:a05:6358:7209:b0:140:ff29:7057 with SMTP id h9-20020a056358720900b00140ff297057mr962385rwa.7.1695899979054; Thu, 28 Sep 2023 04:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899979; cv=none; d=google.com; s=arc-20160816; b=F0hKM1e2gbaSHlxuKIKGGme9Yh34P3ohb+1tcX1RJL3UjfyrzrCuEBY/XfpsRc221u Pp/LtfE7eycYMqagu1jzF+TcajbcDEnUX1zucy625UDC9S9DlONhuPtQDMERHNDxNnBn Xplq6CFDHTz+DadhJUVZCFuRac1D73z5S3yB6RRvNNKQ21OJJty96OrV8X2XnCk7JJOE Y4/HUVdawCR2ro+sz8T3uEiJ1Oe7tMDA5AznCHNclgqXuVVS0nssSGnJ5zOUHPBMZLjc 1tP5bulrH1tjyPtIUb8XjEyopWL+BLgA+izS7tDSnZ/N/yQxaDNIqLdvWuR4ZhGU0mtZ bEsw== 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=TvrF68eVZWomZOGHHkAaqhEEI4B7QjuLYW7ApSyeePQ=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=Ny+TSjIzTeH5pd3zt4rMOOoPL5ayq3IAFdg9cLLhoHXQ1lKcum8Jgy5KEncMHyTXv8 vs3gHCyugz+R3nOkAFM8kcmQ7yP9Q+bXUYKzzzFCRMvALO/6sQrzZpxPQqZeUheWBuAv 3IlVgMpJSeME3qFgjHYN4zjBPP1fHTzV7psXbXYkglGCwmE804tbtiCXZ674QvkVgRq5 UAM6WtFOglt7r6JV7gUp/uIYUuCoADdoAVkInCJ2JBe2m2gUUqQ9zX4OynnFlkgAscSD 47mqyEubv+YZCZhsl/uBgCXAYuZZ+r9bCmIs9GvwB/ankD63f6C2+cP1p4ASfXHsw8YC Klwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RRpyQs9C; 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 y63-20020a636442000000b00578e4816c9asi18736588pgb.19.2023.09.28.04.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19:39 -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=RRpyQs9C; 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 B72A88539E28; Thu, 28 Sep 2023 04:05: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 S232250AbjI1LFg (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbjI1LEe (ORCPT ); Thu, 28 Sep 2023 07:04:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F33C41A6; Thu, 28 Sep 2023 04:04:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 333C9C433CA; Thu, 28 Sep 2023 11:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899071; bh=MQbRQV1pMyXoxMI32Jaeh4uSSWTp46z3JlKjNlrpA8E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RRpyQs9CXb5e0HIifUYeN4lpcynjLHWwCeXho3hyPphN9ud17Aw2+d8dBj2AgQZtg klXJ/li8hoho1bYLvxRehgir7nnSvErI7k7CZ2EY7ycAgaNHQxprEK5lC+fo91YDV1 PcIt2ZwO1tfDV4GABXM57si8BWobmzqUs8qF0PkGlZQJ3rnlp6oP4LyLy+6WGDFglp LIBddSDDeTvxavtPQi1+Oc78XJio1cWXoFfVSVKWfTGpTqw0qQT0XR9rKCM/5GdfZQ eeQYYaeUXIBxzxY7+9Zpevc5DzBDtqJBm2p0vTEKohyGu9TOI62lOjATZ5HulCRtAR k5LMoq1/VtoGg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 17/87] fs/affs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:26 -0400 Message-ID: <20230928110413.33032-16-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280016623044009 X-GMAIL-MSGID: 1778280016623044009 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..95df8ce32d3a 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(inode).tv_sec, &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(inode).tv_sec, + &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 Thu Sep 28 11:02: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: 145981 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233430vqu; Thu, 28 Sep 2023 04:19:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbWOIgpgn7H/Zj2YRvSc6VoC1u4s3QpLN3plWSKYuuAwfWBV5CZCCH9lgKgwtujkjw6i8k X-Received: by 2002:a05:6e02:1448:b0:34f:ced4:7895 with SMTP id p8-20020a056e02144800b0034fced47895mr915463ilo.8.1695899983768; Thu, 28 Sep 2023 04:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899983; cv=none; d=google.com; s=arc-20160816; b=oNJjLg4hF0SO+jvnFKk1phRjmWkAYwEvDH6LVCexj+5lI5puMSFDT9qttkudmVPCCt 3YaqUNVsgkJJMo1hTWmq0BSDYFBAD1rA1WDiAFCQRymbcu+9IqB0KUerWbB7sdx8/jUU lDs4XzQ1rfsg9td+clvCTmpVF2yqCrWbpn/z6AZ4Rl3NC184eEC8uk5Wt7iuau0OpfCb qTnaeTzCYs6b0DHUTMrzNyVZbkTASmYrrVhxvvswflZDMbK0vrcPyEkYNp5e5TGy1veW ZzPzJdgeZALfAX5ARL6ULhXMjivCCP+r+sV6I1lTM9shODJyDEtxko3dzP7xMCkaAWCe S/ow== 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=Q4qeyVIN6JymXOHyLs2dJeyiL1rKduj/uWJH2Y1dFsc=; fh=vEni2MBgs8NOTTBLK+Ol/uiLcZUCulMCJxVvCzIEaXk=; b=ntrlwipi4/haMxTGlvD5xrpvlgzVLOUoy1i5KRCyR4NR2zFpyGBXq5/KboXg5wo5Jt vZpXSSBgU+KF4FXnSu32WskY9hUP5HYk+jfcCMxoD/fqxzBtrKIs2HPqHhZXZBx5Hbz+ YvaU5Fdx3rL+kWg4TBX73VgdvzQExFFtOoXyHOZDyBT1rokUbHGp+YFdJKNZaW6Ab/iT ECPctyw5qWfixs/ItjpKr3gnIbZHQ3V8w5qyuKzsE+JLKim35xbC7cADqA33onbjv4pZ NZfv2wn+22G94/PR9xsCxegw1l5H5qUOGUw3HfIrflild6iqabL6X+XQeRn3kwYjwF13 CwvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CMX4cRe7; 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 j64-20020a638043000000b00573f6eafd25si18340100pgd.572.2023.09.28.04.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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=CMX4cRe7; 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 491828539E06; Thu, 28 Sep 2023 04:05: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 S232304AbjI1LFj (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232083AbjI1LEe (ORCPT ); Thu, 28 Sep 2023 07:04:34 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4201A126; Thu, 28 Sep 2023 04:04:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EE23C433C7; Thu, 28 Sep 2023 11:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899072; bh=Iyo6HrfMYk3wC/qIL2NCNS+ijgdQoNLu5Do0CwWIXAg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CMX4cRe7nYlE6JP+CkqNiPN8ZwdDGJzsk9x5J3OMxOU8iOzDw1x1GxOVztk3OslgZ XAO5vMX3k7auNx4st+gMh/NWnzoGWHlR172/72QVzJS6H//mcSahIaW2uMlzV2/2kd SHznbgkcjp4DVsHyX6FzumPspz4E8rArYICuA37E1oOnL3JZZTfcZFkiduNvs2wWRR Ci3Qq/XLejNEVUXwhIl4ecg5M06bU7E5caGAWZ1Qyilvx94imMsDLfhBcUHyP7MYSf NPgeRMwd3NdULhuNxJ7x4km331u+AjPvtsu+kEDiKs/k8c6Th5DqJjTiwUnGNSzlsd uYg8vOjl1YQ3g== 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 18/87] fs/afs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:27 -0400 Message-ID: <20230928110413.33032-17-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:05:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280021420591098 X-GMAIL-MSGID: 1778280021420591098 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 Thu Sep 28 11:02: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: 146067 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3263813vqu; Thu, 28 Sep 2023 05:12:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmIHSDKRTbzVHD4kpWTQsNW3SSpWHs9+011Rs+YF4e4JfvLdskq+ZIHlKj82J4sZuLn7Ux X-Received: by 2002:a05:6358:3399:b0:13e:bf50:73af with SMTP id i25-20020a056358339900b0013ebf5073afmr923462rwd.18.1695903154076; Thu, 28 Sep 2023 05:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903154; cv=none; d=google.com; s=arc-20160816; b=rkbS8HpBznflu7xp4aOs/beNduWCOq1iBtxt4LJbSQUNO3eVwhDFCUXJDishLjHSgA wtlKMCsSZqsxOFFUQePzofrkIStoauQmtGvDF5sm0HwvgDIwXAiiC510RBNwcckoXfnu rratla9ZGKRKSgmJJmXwG82HHd5cxEgkUOHRUZnA8BzoCWWJ1VVO4gsf6c1jyY0xMeAg Badqu7GmL3WRsOdHOpC1Cc21eup6CPVJXYTtOtRHizlcRDORZfweFPNVeN+ruQuvo+5Y wLRmYnw5ohpEOB4Y/4aQnhZ0G3h/MFp/WlfqZNA76GxWOm5RNMySQSyjVPkO0gdFw9Ks aULw== 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=pw8CfLdWM8RSXQJD5vCT7IVRJlEQqqV4W/22WY1iXnc=; fh=8sRj4pXGeWd3I48ZGssU2MRGGxH8f7IpW7BNWZdmlJ0=; b=LPhs2B3fwMMvEkghCU4g6DQp7yGvm+eQROkqNjeI9ZnWV6RJg8qJTF5wO4yuGTp9+u cALgjpizXq6fcxIOmqH0VeCawEiW5lrBfgGJUjIvWtsb6QKcpIklHfnwk1GuIx3uQ22J otAcKLJpNBhUv2RwJm0ok+poQtlAF8RnT3wlFTvC8drtKvvsLQg3xCvzeTx5ZMhnCvDB qsREoK1tZEPPwXhdee11/6xpv4yjNsmqXiyOh0lV2tQSmheBL3uKiukgYG+hVvBgC+Qa 3SasDYRf+DTFxYAv2VhBrdVU4U2O74vc1tdD4TYTRHwRVFm4o9gIBM10cYO5Ro1OJ1bR MF4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b2+cr7Wd; 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 f20-20020a637554000000b005776040b2a6si18869581pgn.187.2023.09.28.05.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:12:34 -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=b2+cr7Wd; 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 56904804E453; Thu, 28 Sep 2023 04:06: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 S232029AbjI1LFl (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232086AbjI1LEf (ORCPT ); Thu, 28 Sep 2023 07:04:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 648C9191; Thu, 28 Sep 2023 04:04:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8283AC433D9; Thu, 28 Sep 2023 11:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899074; bh=Cd5IZGO0KaRk0XXew6oC3te7WDw6FBiIJ+bgLrWp4AE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b2+cr7Wd8m7KOd+0wU+WrRDz+Vwd6hzfolzLZux2pxW9cFO9Nlz2ViMgqkl/Y326b uN0A7XfZ7tXg/zIjeGrKE7UVWAcUhTff7JRUJdoy6+ytvDcgy1uWsu8xUrHbfnJ4D6 K1QWJ9Py/9J2YPeDnlc+5FYf3dYu+irbG+3bJn8C6yCFXMjl+yq2Epq4EaTfXc2RiT FDSpJG9M34aNJ+tTP6nxCiANIzwFy8aSaLOmsrKNA97fnE1yfPeiUV8k/Gph1BN3fp +dzkRdJeERifA6LMe2YRjdL/uZOFCIGCiihdanrjBYP9inY0mrzJoho+d9kmFB7VSK szNeKCqRJeeNg== 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 19/87] fs/autofs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:28 -0400 Message-ID: <20230928110413.33032-18-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283345282512294 X-GMAIL-MSGID: 1778283345282512294 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 2b49662ed237..9d06aa350c31 100644 --- a/fs/autofs/inode.c +++ b/fs/autofs/inode.c @@ -370,7 +370,7 @@ struct inode *autofs_get_inode(struct super_block *sb, umode_t mode) inode->i_uid = d_inode(sb->s_root)->i_uid; inode->i_gid = d_inode(sb->s_root)->i_gid; } - inode->i_atime = inode->i_mtime = inode_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 Thu Sep 28 11:02: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: 145976 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233181vqu; Thu, 28 Sep 2023 04:19:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhseJp8sRv5ATqry5AGrVurBtkGMtCtmg9omZudL7eub/0SF3JHlb7JpwYwGxIHyH5Kfs1 X-Received: by 2002:a05:6a20:3259:b0:15e:b281:a33c with SMTP id hm25-20020a056a20325900b0015eb281a33cmr667189pzc.56.1695899959987; Thu, 28 Sep 2023 04:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899959; cv=none; d=google.com; s=arc-20160816; b=g6I6DM7oGVjPSjx81MitCh94+rDPi5iU7Czql7O08z6NZNB9En85McxVZqHC0ggruY ImgDe++U4TWLlYq2pDCkBIQU11zCHu2YoJckgea9Eh5CmYQTAd3vM2va3a04HfKrNXza dFPyV1JaNbSK3G8caO0/8+Lez+7z+UZa5X7AZpyznORUzOZVVDjZcZ6ZZjG07KZBXjUz ZVXQI/e1GqwMvSRdJ6HPFa/z/5g4h/LSmFc2g9a01+P3ithnLd0Nb4LTEoPH/JXw4qtK QoBkHvFtHzaJCTJxWoUMAgu6ZIE+0pXPgDmglHNLlXeC/0yMG45HoHdBm090XQaourp3 h+rw== 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=GZsaxN1mdyVXqGD5dmyug97nNGisN8Cd+Ro8xNMHT0o=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=WmC+l6ZsikmJZ60xNOyc/faltBQsKr0jxYDAcVDBANihRRp2Q+pzmKNaf0fBtEZ6bd /PJQmeIETTxhF55E+D6dWjCml3PX1edIkeHhJy58W58plvGevX3TZnEKrttL8eXGZYl6 hnfadAqRCsmEnd+mhG0JnQGsQavud+euWaJ1DglE+bA1RNGDH4jxkS3YQovyLV4FEiNb L3OpuCDxPJMr1Wj3jw9ed/zAvR+Y/QcomKDhSj1QDRInnjwLLsKCiYF05EtxfDWnUbjX GHRPTo/jppK2AIlYPl7uvl8CHCNDWnfXLtP1u43N0P5eM/DdUzYmJT7W2uSZyLxG/+yW GfRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Us0gigFI; 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 o7-20020a170902d4c700b001c3411c9b83si19199980plg.454.2023.09.28.04.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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=Us0gigFI; 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 0398F853CE91; Thu, 28 Sep 2023 04:06: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 S232191AbjI1LFn (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232089AbjI1LEg (ORCPT ); Thu, 28 Sep 2023 07:04:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F58412A; Thu, 28 Sep 2023 04:04:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9624BC433C9; Thu, 28 Sep 2023 11:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899075; bh=FSkoPS2wpHGRikf2wCbjVJa2Td2hPo0FwgxsJtrzOEE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Us0gigFIQ2FJf81+51xlE+Hw5y2wuAJCaWZ9qjjdfANYud1X1ohoIg+f3NH/qEjWk R0PvjRv7r+HVePgBUPuLELsHHdlQxCO/kE/o33nDcjHld3K3wlkjRvF9/tFXuAYd1Q sbg9IAEGdsc7bWHg5k9ruxBBbYKGPzPzxt2Z7F0UxmZ/vJlWK0LvUFL6uRlfA5Pr7Q dnhf8mn5vzLrPuuYen46rMYzak0NkyADGM4jcOBNCUeE0o6nyTAGRlni/AROnDDCPz ABwjYILEYSJvt7irGkZ1li7y2Py7xxKofBNqs1y0Z6gI7kN0rtNk4mTKIDbA+2CPyz S7LvbGo9noW4A== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/87] fs/befs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:29 -0400 Message-ID: <20230928110413.33032-19-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279996755123955 X-GMAIL-MSGID: 1778279996755123955 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 Thu Sep 28 11:02: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: 146018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237434vqu; Thu, 28 Sep 2023 04:27:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3JYHoV18JZ8546BdHFzNhhXQz74cDOx8IsqTHMcOJeSm9rVSVbaDyAvHvfeTsQAwxr64c X-Received: by 2002:a05:6358:27aa:b0:140:fbfe:d941 with SMTP id l42-20020a05635827aa00b00140fbfed941mr825937rwb.20.1695900455644; Thu, 28 Sep 2023 04:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900455; cv=none; d=google.com; s=arc-20160816; b=Xziw+i8ZyMrs1b9VvjWFH+wS130byZShlcJ5Q62x5Ak0/iCSfZahA75ULynTqLGSwn k8M1OTlz5RAE+1syBEf27k4s/2p0U9GDJ9pYO832PjU+8h7WE/KAOecYw49TaApgvlYo tox8zd2FmAZufRFjD04CoGTkaVTaEWrvdfmDM5hc/AyMvi+bmFjnPp4ZMD6+dQrwgeFv sNFZmvHUVKBI5rGgQIV2LF/s1T8a4q5V19Amp6b57rsOd8FGAyiEENem/elot6xWdOgP qbGfkJgroMRNaTSvAIAz2tqIZFL9cFGcxgPIM6uELDEGLEjxRMDEFaH7jTy0o4wNKek4 0m1g== 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=QtKdQ9M0/pqVWBFUaFdQlyRQOagAJkWrN2dXv9VKoJk=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=eEMX2jk/a1u7ZnOfpongVwKPKkQjxsPertWI8pghEuynsqsbOtlzhP46CStW7SrQeo wu1QRsPnYYTlYBIOkv2JVC2USoOsU/1zkKViixF0WSjCIIpOPJkRPlhEWxh9VUFP0uHL cYGBwxEEWVxTmHr68jSboQDLzFielK9zdkR7YBsQx2Bv2+c1pwQHfFMquPYOkSR6o3jt aLPgCkzFoTO//jXKdSWGoY2xhnQZ+VLyFKmelx0MG1TDVouFNR76p/FL53ahOgYR7iDV P4I4B3Ia7l1UI+qHaEbSTdZeu+T26NOKvyoBnLdCRtRoGL5DYP050kNC+QXDBpLm6WUr XPVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fW92e0ov; 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 w14-20020a63474e000000b00578da80ac3dsi18217806pgk.80.2023.09.28.04.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:27:35 -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=fW92e0ov; 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 B0F218135CE0; Thu, 28 Sep 2023 04:07:28 -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 S232115AbjI1LFq (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbjI1LEj (ORCPT ); Thu, 28 Sep 2023 07:04:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7818819B; Thu, 28 Sep 2023 04:04:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8B67C433C7; Thu, 28 Sep 2023 11:04:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899076; bh=3cft9/flkVHUeMw9oc2cUluGTl+0HKBhpa4Y5IShJPM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fW92e0ov/UsBwbEllL296kPvjipgHX0QL4oDw5l4I8eIsGr3umCLYYBFg/SfTaHpQ TRsUhiBLgzLKbvl0+01RGJ6Rf5cl+XE/7KOnRn9GE+O32HgPTn2TBOiDatU/4hrbsw ZbJkKPXpeg1lbNZ4lQ6jpsgYV3d5f1TN7QKN9HvFHyWFQK6fzPsodB6PUEOznLYFpG xRqXpWrYfKXpNecLkxrxYy75abMoEJQES8JpsbvItDsC/2pqEMxoRQulAcPgDJBlDR EfL2vrf4PUtMWTymrQ5JgJzRSGp36OLxnH5fjINiZjl9w1+lrVdeUwPQu2W8ySh7Qr p43bjC1RmTeTw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 21/87] fs/bfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:30 -0400 Message-ID: <20230928110413.33032-20-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:07:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280516021480437 X-GMAIL-MSGID: 1778280516021480437 Signed-off-by: Jeff Layton --- fs/bfs/dir.c | 9 +++++---- fs/bfs/inode.c | 10 ++++------ 2 files changed, 9 insertions(+), 10 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..1de3b3611ba6 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,8 +138,8 @@ 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_atime = cpu_to_le32(inode_get_atime(inode).tv_sec); + di->i_mtime = cpu_to_le32(inode_get_mtime(inode).tv_sec); di->i_ctime = cpu_to_le32(inode_get_ctime(inode).tv_sec); i_sblock = BFS_I(inode)->i_sblock; di->i_sblock = cpu_to_le32(i_sblock); From patchwork Thu Sep 28 11:02: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: 145982 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233482vqu; Thu, 28 Sep 2023 04:19:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHy1OqJ8zMNVJ9nrkb7H9u1+uMLI9JDvWhIRYyA7/TSwLncUw2kaxN0HAKIL0S8TmzNwXeU X-Received: by 2002:a05:6358:1ca:b0:134:eb97:ea01 with SMTP id e10-20020a05635801ca00b00134eb97ea01mr821058rwa.27.1695899989216; Thu, 28 Sep 2023 04:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899989; cv=none; d=google.com; s=arc-20160816; b=0y4qLL5wAOTiKcgG8dEmJK7Tpfy2uo0XTxpPp6hSqiC+QWeYmoaDSf0lSL0j79W4me 2oqCAYdFvtsDABsgk3rkfa1iEvb44pMdzivxD1w4QKp80blQCZlf5Xm4FnUHGkvlvzT1 SIAZ8+/Ho3oVcN5qjwWQGEH94R06zY8CEiTC0keA9PGdbzAZ10yti68VvkUxFTM9GbCO IzE8XhmLaDdqI/2fHuQgjNC1FSP34rXt8hYfmPRnQ+kyzYdKcQU6bcUqk9W+L9gScEQ9 p40ij9FDngBRNuSaXy8US9w501UPTICupMYKaPMmQU7mfABStIcyHLg6SwBnWT6Gb++t gDDA== 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=0hwb/rqhZqRUxpiytPaciEZEx958T5AUFgJmX+PJXmA=; fh=UIStBJvlqOcG0eJXpcE4hrsP5r3uHd8xntseFyzSDLA=; b=B84I44ZTAyMxIoz/88PtX7OWxlwhe2pygKMDYDbk9reb42ZZQCoR7MC1lUJ+OeIMnu MCQrXeVHxGCPLNJTYmHpiyMSbE0lI1ii3rrislblzBwMHYbfqUTfeRscCYW8fp8ie+aN w7ZYDPLg/5YLZ0HouXc9LkO85pY9Q7yZDkmGMXmVrCnjczBkYqb7H0TojXoVeFeylrH4 uFqSZht32zZ5nFBZTENGZtc4asWtt4uKMZK9i0sg87Gl+jYQbI+XBvV3I4r8pWsONDlk lEqoDAUYp/30rF6ZFNVAsPeqLHhNa1mbdGeODmiOI3Unq+LSfzmmsdYblkx8caC49YNu qUnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BiewGpLq; 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 dc15-20020a056a0035cf00b00690cb77d5e5si14883343pfb.394.2023.09.28.04.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19:49 -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=BiewGpLq; 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 5CEB0853EB7F; Thu, 28 Sep 2023 04:06: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 S232322AbjI1LFt (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231981AbjI1LEl (ORCPT ); Thu, 28 Sep 2023 07:04:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D442F1A4; Thu, 28 Sep 2023 04:04:37 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FEA5C433C9; Thu, 28 Sep 2023 11:04:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899077; bh=ruBVBlbxk43QmbfwYylX+XKh2opy3/NQx5bRlLNo8m8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BiewGpLq2Ju9FF4X5MfXOLjuyzPXKBGx+Dp4rMCgVoZr8X5Nhm8d142DHdibiaZP+ ua5iyJ+YAOv4lHl/ygQTjt2hzLx/vaRiJF6DZHRTju11SbID1WA31rEZHMATOqdYBO IVhB23S3lFZvugNAb0+RfA1TjpI6tiZcc0GefmMD6LOQBof/r2fi5n5x5pyQjIRzs7 S8/dlv8sr4TEBDdj9yuyZAujIM65oX5Sk4W7ybZeYbuAOfSwtjq255CjVmHyo7RO9z 5oonsTrCFKd4T51EiDXSUjpOm61C8IUuUVhumDolbhEEA6PV64+EVnAy1rgrDN/AMj igRYnN5RZgMpw== 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 22/87] fs/btrfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:31 -0400 Message-ID: <20230928110413.33032-21-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280027260210940 X-GMAIL-MSGID: 1778280027260210940 Signed-off-by: Jeff Layton --- fs/btrfs/delayed-inode.c | 16 ++++++++-------- fs/btrfs/file.c | 18 ++++++++++-------- fs/btrfs/inode.c | 39 ++++++++++++++++++++------------------- fs/btrfs/reflink.c | 2 +- fs/btrfs/transaction.c | 3 ++- fs/btrfs/tree-log.c | 8 ++++---- 6 files changed, 45 insertions(+), 41 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index caf0bbd028d1..c578a6fc796c 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1834,14 +1834,14 @@ 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(inode).tv_sec); btrfs_set_stack_timespec_nsec(&inode_item->atime, - inode->i_atime.tv_nsec); + inode_get_atime(inode).tv_nsec); btrfs_set_stack_timespec_sec(&inode_item->mtime, - inode->i_mtime.tv_sec); + inode_get_mtime(inode).tv_sec); btrfs_set_stack_timespec_nsec(&inode_item->mtime, - inode->i_mtime.tv_nsec); + inode_get_mtime(inode).tv_nsec); btrfs_set_stack_timespec_sec(&inode_item->ctime, inode_get_ctime(inode).tv_sec); @@ -1891,11 +1891,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 361535c71c0f..278a4ea651e1 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1108,17 +1108,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)) @@ -2473,7 +2474,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, root, inode); if (ret) @@ -2714,7 +2716,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, root, BTRFS_I(inode)); updated_inode = true; btrfs_end_transaction(trans); @@ -2734,7 +2736,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 7814b9d654ce..e35939e68fc5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3754,11 +3754,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)); @@ -3922,14 +3922,14 @@ 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(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->atime, - inode->i_atime.tv_nsec); + inode_get_atime(inode).tv_nsec); btrfs_set_token_timespec_sec(&token, &item->mtime, - inode->i_mtime.tv_sec); + inode_get_mtime(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->mtime, - inode->i_mtime.tv_nsec); + inode_get_mtime(inode).tv_nsec); btrfs_set_token_timespec_sec(&token, &item->ctime, inode_get_ctime(inode).tv_sec); @@ -4133,7 +4133,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, root, dir); out: return ret; @@ -4306,7 +4306,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, root, dir); if (ret) btrfs_abort_transaction(trans, ret); @@ -4956,7 +4956,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)); } } @@ -5600,9 +5601,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; @@ -6277,9 +6278,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 @@ -6444,8 +6445,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, root, parent_inode); if (ret) diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index 65d2bd6910f2..13ecb4f85941 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -30,7 +30,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 c780d3729463..38a2775c5c7b 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1860,7 +1860,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, parent_root, BTRFS_I(parent_inode)); if (ret) { btrfs_abort_transaction(trans, ret); diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index cbb17b542131..3f33e18f6d3e 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -4138,14 +4138,14 @@ 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(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->atime, - inode->i_atime.tv_nsec); + inode_get_atime(inode).tv_nsec); btrfs_set_token_timespec_sec(&token, &item->mtime, - inode->i_mtime.tv_sec); + inode_get_mtime(inode).tv_sec); btrfs_set_token_timespec_nsec(&token, &item->mtime, - inode->i_mtime.tv_nsec); + inode_get_mtime(inode).tv_nsec); btrfs_set_token_timespec_sec(&token, &item->ctime, inode_get_ctime(inode).tv_sec); From patchwork Thu Sep 28 11:02: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: 146070 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3263908vqu; Thu, 28 Sep 2023 05:12:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfZLfWb+utzxKIMRE2ASPr9rEhwede26e5Z5ooZA3Ose0NTH+6dt9DLD0rucLr7tnRcCC8 X-Received: by 2002:a25:a545:0:b0:d62:6838:74b9 with SMTP id h63-20020a25a545000000b00d62683874b9mr887867ybi.55.1695903164867; Thu, 28 Sep 2023 05:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903164; cv=none; d=google.com; s=arc-20160816; b=HlXp2azFXzIImX7DIYCl4hzbzchfj9Bmutn47TcvBdiVxF4vVJb2kUK0gFCDQxRbgC ESoHozcBu/jAcIbyKZ1ZRCkOSoQTP26fZ1Vzlq5fZyjNyt6CZO0QG5mgTP36BSJhv39J TCfYYCPhDRvOKfItQvuMHufodD8qW1OiBgOrNvXhuv5RDBgup0R6EhtVWV9aspNGvS2I vc8/EOWF2PgUM76vzxApo9PShJ5imOMeCA1GIMo58msC5HztvQdYrVkaD+eycETEZpo6 P5Nm6ypRVUMupiZSLGmzsIIsrL9gyOxKBBIH7ShxFS3WmOOX1NbjjtQ931kMv2yjOykt wGNQ== 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=EycTDP/9KkqW0vwHbtMoTCuOpzdWewGK0g6QN4VOCpE=; fh=KmhyYBQEtbQbL/GTzFyZaYa8PLHD/0mbeD8flYs9mpA=; b=X9K9n9nj5tjvR53Wg0ijNy2KCzzBp3lZOcxzn/Q+MfKT66xXtSHK4cjoSI2h+GeABr 1izFFE7G877uyDEivzDrK8R269xac/lOi7x65GJ6eWCHMiYUudTUaaYxjaycZb9icBCw PjiWjuvHbRG0fGwd1FpalvTtjig11T6gpvY5kWyaEIHCXRr5g/qUUAHIDcqAFhifkguV ElTWww0z3PKvyvgW10BDIj2noKtjji8YLa2qXOxprBIilh2KRwbuasqG+EpX9cOHuFrJ JimJ/+OV1hPPM9o6/n2zhV7ngXTAtuuCzyJWLkYr522LglIYWg7p6SUCHepWVgOXjrAT XkVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YNrUSYYU; 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 l9-20020a654c49000000b00578b37ad24bsi18508528pgr.619.2023.09.28.05.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:12:44 -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=YNrUSYYU; 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 CEDB480B1D3B; Thu, 28 Sep 2023 04:06: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 S232171AbjI1LF7 (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231984AbjI1LEl (ORCPT ); Thu, 28 Sep 2023 07:04:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 682E81AB; Thu, 28 Sep 2023 04:04:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B68B1C433CC; Thu, 28 Sep 2023 11:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899079; bh=f+KhDIHOxIa1n1MMHNaiM6YmAE7E9DXw6UiXfKfhTa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YNrUSYYU8jNgpS5scvoKJxnSx6tH8i6Jupyb+gbEF7HUcxycLMAq+G0EZ/up7Eo3g E3GVhL6duynF+8d1epGM2k4duLdAmpn8IBpBaNs0gYNihfNMo4CATW8g/ISkcj75dQ FwZEgEKsPq94vI1sE/pN0XbvDziCcIS9dCVIiqX2tjCWF3691sx10xeoXTxzepiYg/ RbnAFGfD7sne+NILTxyRkfIhk8RwCf+vDapaOGQL7P+uUvUw9FZ9mTZZDJrcX6ucww sEmE/DcL0bqbnDsXOKwqOLgtF9lyiDcT/Ntqmm5n3wW5Lb0KeXS2LtkRqE7bG2Uqtk PStQcL3CU7QNg== 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 23/87] fs/ceph: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:32 -0400 Message-ID: <20230928110413.33032-22-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283356958613864 X-GMAIL-MSGID: 1778283356958613864 Signed-off-by: Jeff Layton --- fs/ceph/addr.c | 10 ++++---- fs/ceph/caps.c | 4 +-- fs/ceph/file.c | 2 +- fs/ceph/inode.c | 60 ++++++++++++++++++++++++-------------------- fs/ceph/mds_client.c | 8 ++++-- fs/ceph/snap.c | 4 +-- 6 files changed, 49 insertions(+), 39 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..6a51db29ed57 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(inode).tv_sec, + inode_get_mtime(inode).tv_nsec, 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; 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 Thu Sep 28 11:02: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: 146069 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3263901vqu; Thu, 28 Sep 2023 05:12:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWzJGfTwAucTWyMa0EucH8ljWbYS/x3u9wHKY5tymID8ghxP913Pek4wNVCrjHgxuwggkW X-Received: by 2002:a17:90b:480b:b0:279:5e3:7f6c with SMTP id kn11-20020a17090b480b00b0027905e37f6cmr945403pjb.7.1695903164498; Thu, 28 Sep 2023 05:12:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903164; cv=none; d=google.com; s=arc-20160816; b=yaaMCgY36S8x+VvtSrmRQegZERWDmWR5CUnmsKBg59xEYL16gmezDdtEtQCZSs0lXX oEbn2VmKxGiAcBYCN1TKsfdJZv73gwncxI5MuDh1k1MuRfrnlLaCRW0zuQCCSCDeJeWR AfQwWmuDF0EzvMnZ0XYrk63P9PVDgU9nsXptbNg4IDAftQz/ntKqo8P4i0PN3lobxvEg 7TTXPDticcA48TB5u0ofPKjecuIWyyFgQUAzcJUxck4VtiIYcqy/MWh9RIboAUYMQNzv tKdtSP23r4N1x83ASeTxDka0pVBk7sfs5Jd/PkMVOgG6oiIjECwsbBUggcBq8Y3ptot6 QZwA== 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=L+wZYuMa26mYCcVfT1bwdfVJlsqzeo/bQD/XPb7xZc0=; fh=U00o22A5guAsQ/H7sYA5gASj7ckr5iMwnVMfCN7Dj3k=; b=qKq+G3zfwdbGwB0YqWPWdIdHOMHg3brbA0IPhRt+ZrgfHDyel8fS13FElBg0Ifsgvi 64MoTqtDAzb5+s9/0v2W4g6EGhOylv2UXZhLaY0SrjlKS5yXrFSgXVOlJuLLhlsO/oUe iJUQqhNMvnnpE6QXqPIpyo0968KIoG+virP3B6YUIZNWWPVH3u4ahsIQgSnLW90k1VZ1 6DD1XvY2cI3J0CQmyciQgtw6vDrvRp5cpRpFeQE0UOvtKoxWd3wh8NIYqqEqGxbRIcOi Ad8MXPd/XcVs80C/vF2JWzzhZOKFWn8U3LnKvov3wyBwABOu+vPQdNLAIUCnZ/o06vty olCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uX76QE0d; 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 pf6-20020a17090b1d8600b00276ea6d9ac3si19606107pjb.182.2023.09.28.05.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:12:44 -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=uX76QE0d; 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 CD2B880ADF2A; Thu, 28 Sep 2023 04:06: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 S232268AbjI1LFw (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231992AbjI1LEm (ORCPT ); Thu, 28 Sep 2023 07:04:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D29C91B1; Thu, 28 Sep 2023 04:04:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00C54C433CA; Thu, 28 Sep 2023 11:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899080; bh=S4sRsE1wLpo3VwGf3CgTXlsPu1I64UUP5fmvH2GmK4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uX76QE0dms8j4qrF6jLKkDVrujBi+DNWy1Q4R4UH483aFhKDGtzgBRbFRqwrz7zDr MELI1/86CHOxbNGYhoQ7O+1ecd0i2equ2uXLZWxH++B11EOcjpVQyQx2UOv93XUeTS wIJSvSf5sp70VsbVWoRGL1+Mvnrb75kbpF/8ja9WlMEJ4DMZdjGTqJS1bhSSENsCgh vBMa73jZg2qUxKIJMfCLVNPoT/J4550mwj4RagMw2eL/Z6MVP0OzqCyCwfvcx0BlUT fVxb9bJklVSM6IyhttfpeVwLrgF2UJ6f5tiZqynSVmBlI3/soMzIfKb6O7uoqfewb3 vp0EpHzJQiVLw== 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 24/87] fs/coda: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:33 -0400 Message-ID: <20230928110413.33032-23-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283356931973134 X-GMAIL-MSGID: 1778283356931973134 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 Thu Sep 28 11:02: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: 146068 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3263873vqu; Thu, 28 Sep 2023 05:12:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8iX31AnQldJRcqaehHEqpeH/zMHJQydeffnT/E3ThtaJy45sXDWlO3OfBVW0nE5eZPWl0 X-Received: by 2002:a05:6a00:1703:b0:693:3cac:789a with SMTP id h3-20020a056a00170300b006933cac789amr1128938pfc.12.1695903160646; Thu, 28 Sep 2023 05:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903160; cv=none; d=google.com; s=arc-20160816; b=QBTCOOLu7uu7IiyCcWq9SFeQCUkTDeqOCXxVDxYBLGmrLs5Xg4cXBvtwofTrCGKI5C nJANILlxW+ZuNNfv6yl2b1VZwqeuO+1p/wAjCvlQDYZsRn2Fz70mujejggNJ8j4E2w/N pfbqUBL6oKF/SOzbrTBxfJW3bevxhk/uCZ5G6GP5EhQWwLHpoQSz/zSEUUzvbIZpAJpE LGYd/N25DcuC+r2T4WKISbRyX5+03otpG21nchm3BEa0W9C7OtdT/bbu9RBny1XiBiIS G2EajkMYclIyiZpWrwqROW9B805dZ6Q4mnRyExG1ond2gWvhoQpcImZYRS6zIYMbDjZ9 jLrg== 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=CoVNIPIO1nzPKsbkodviNA0gs3jsCOY5af3GE3stblg=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=c3rcxW7ZcbYZUFszGP+v0UYIfoY7iYIgXV3nPsMBVQoQnW/Tl+InujdkgQ/lW/305N +klN5OvAmhb/tfpya05QA8jj27S4Ie5dOMVIksuz7QfNc6QMhzZOYXMjEMayGC+JMHNY iF97lbJ73c9/dkIfwITgCLzRp1fLE2Hkb3tOITJBol35kEsZVU/x6ZB2JpT2yk5taKyc j7gkRX8X5XDtzpgw2/sW4gmJRRbe8UN77nVOHTozBrruefDkhI1ZYsimMftGxItbjAnB WXB2L+HeCMsvRHtCSFUT7Hu3Pt4PWqMT92bSYaJKwxAIXNnU7gyceO5sUa482tdkNcg6 +aAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ht1vnVyW; 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 k31-20020a634b5f000000b0056536fc7901si18201478pgl.593.2023.09.28.05.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:12:40 -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=ht1vnVyW; 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 CE7EF80ADF0F; Thu, 28 Sep 2023 04:06: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 S232339AbjI1LF4 (ORCPT + 21 others); Thu, 28 Sep 2023 07:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232014AbjI1LEn (ORCPT ); Thu, 28 Sep 2023 07:04:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D8F21B4; Thu, 28 Sep 2023 04:04:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DFD9C433C9; Thu, 28 Sep 2023 11:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899081; bh=+GMC4PjnNkP7Yi4b9udX8bXyU16DKLRsXZYo4cptrO8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ht1vnVyW/c4zmL5Lt42VSykPHnoEj7AdgEUYbSusR7nMwwPloOhdvyU9DLfeH/wWj GBU8OrrwrxxKHRFysO1RJ8Ijd95p6WQ8qW2Rn6gLZt8VhWBpscsIFYXkCZF6gCnNyC XndQPDS6+tlc+g/G8taFL4EXoYYy0sHFFUOMni0CvoiF5rUw4rSpYep627g4pkj1s7 aMC3FEuUXL/nd3ZKT9PJIXETA0kmVzmzeOstP5Cp0wKTqYsOlwkZBiG7aJgMiQlWCA cynEX+MtFsns6fmP0I4EaqftzPr3Me5CZLzyB7a72FlBMoihhcEtm5ZM8wmu07qsb+ SVuXNU0+JcA0Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 25/87] fs/configfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:34 -0400 Message-ID: <20230928110413.33032-24-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283352759163086 X-GMAIL-MSGID: 1778283352759163086 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 Thu Sep 28 11:02: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: 146071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3263960vqu; Thu, 28 Sep 2023 05:12:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcOftSa1udO83R45i7dFsE577ujEdcuzaW7er6qCp1rmCwBbqWuYz17kR44HqYiQUhfsIY X-Received: by 2002:a05:6a20:244e:b0:154:a9bc:12d0 with SMTP id t14-20020a056a20244e00b00154a9bc12d0mr960482pzc.13.1695903168805; Thu, 28 Sep 2023 05:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903168; cv=none; d=google.com; s=arc-20160816; b=n6pVBRaDRyyd5nuW48H4RXXKRegC3E7nejnxK7efHIzOFHsIiJ98FQ1KlaEMaM1xVu PcAcVtbiYUtG6SCOEqH10elK+Z4Ee+uv+V20JdVPvg5ZRJqtyE5YtzpRdjJVeZQ+cxnY JXnSROGBpSa6QSMAhLI3aqdHEX+YUivfR+GMrw15Df75p2WIbbu7q8jJtZJ5VXxBB6db ue46OahuJg6K+r0wEMbhMmXxs6aObTzHOsMsPQ13PiU+gC5Yy7ldHz3BsOMSb/3R1P8g QmCatYvPTEOwmac73Ol3/T/dMtdUweeqkBEM9is0vg6/UtH6pq5aCeJ4EFqgR9fZSpiC J/Iw== 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=ZJyLRra11WeWd6QOcwd/GZDkPhWBeNWhz831+YkZn1E=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=xbycgKNJAuFboThALc9sRRpS54fSS8rOTzoSH1ORQzHyIZ3NSOhWWJe86EgIOpvRg2 LQYbQtc7aLjCXOUFPEeuTBmx8BWkwHqMBFWTNC/Jmhb9B8dQxYebiJa23++HhwGfaOLc PfVbO9Q6oeFQLqQQR1t9+eirAXV8XnGb1YryshqEWds3xx6YGdlStV6bG9E5Cch0d3op V/OWbA9SRofLrLFIxOwvGmzQTijGpd4j49e+UVcd6mc8EapjPKGG6ng5yXnCqZJmOUHE kaHClBL5z4Sn2A/2ngoljYrXYfR2giYln4Q83HDmh6Jc6Ubq7c1FipYLtakF+/9B/B+j 9fLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m4E24nlc; 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 y17-20020a170902cad100b001bd9c43c896si12577634pld.287.2023.09.28.05.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:12:48 -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=m4E24nlc; 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 E2A01821ADB6; Thu, 28 Sep 2023 04:06:18 -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 S232353AbjI1LGB (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232098AbjI1LEp (ORCPT ); Thu, 28 Sep 2023 07:04:45 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE9081BF; Thu, 28 Sep 2023 04:04:42 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 076DEC433C8; Thu, 28 Sep 2023 11:04:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899082; bh=HiIKHh5EcW/iS72FPhqe/DHHFDkon2IkVvSanOATOiU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=m4E24nlcsoUVf3iXi3sNHBBkxoN5T5YrnZm9acWarGGWm0NqFknQHcE37lDrpXATf dVapd/Mu1gNACYrTYBPTtLxfANwQ1c953/lWmA85n8KnOr6mcQk07SiT/nliArch6e YRyJvdz5tWja1IunIUcGDzt7oIiefCDmfljgyunhH6JvjkeCvtsgt7cmGlCcvpov7u BvRPRSmMvsZr9Ih0bKoev3o1OQcgS5vV8nkjlu8BOCZ9j/56bqLKRCfjfmaFm7kXJG 3Klbm+EI65J2J16Tg3oOSy0O6a2SI49BWTDnqbsqJXlmzMxbTVCe/SYpOKQvTa1HDC RBzotlpNnbbAA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 26/87] fs/cramfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:35 -0400 Message-ID: <20230928110413.33032-25-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283361007264010 X-GMAIL-MSGID: 1778283361007264010 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 5ee7d7bbb361..9168b2ec9497 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 Thu Sep 28 11:02: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: 146072 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3264151vqu; Thu, 28 Sep 2023 05:13:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEA+7RjkBZe3cKTFVI9xjoLUIWkkLCCqan0tjfgzmnBL8zBBdZhqseX7pBb5mraJGeDrcio X-Received: by 2002:a17:90a:f2cf:b0:26d:5049:cf48 with SMTP id gt15-20020a17090af2cf00b0026d5049cf48mr900396pjb.40.1695903184582; Thu, 28 Sep 2023 05:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903184; cv=none; d=google.com; s=arc-20160816; b=j0jDdh5BGIq00rv2DxD8hDTGJ7NRdMG5BpzQVu2wHgdOugrYVSATLHjqNavf+hRS16 V8kdueaPivRVCyVX572JSvUlQtq3s+YKD4bzu98VaxVET9aK653lpeweApN9dGQfmA/3 B+/hGcS8QIHFpomf+vItpWdGOEW7C6TmHPfu8H5pNTaxPzMAKvqSOmPZ6zzBUXlExEnJ 0FQS1FdyXvDnyfR64Vs1TwD5Tq4DoTGyAJMUR3XaUBpRzt3OkmIXG3Fx3KlJz/ZqQaLO DPVECGCWkbGB4DeLkQ/fPfzWcDhfCxqqx8vn4vGTA1lXBcta7HGfYeDw/if3KQhSST0i UiRQ== 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=etXdnYIfsA5rXUKSoixPxnnNeBV5BhaJ42NhXJwNuHg=; fh=x+1U+LJYd0/ljzTnC8XLOei3LVvo+3LKL7WiISSQ4P8=; b=rofSGHKMi2LrUywNCAxGxU9IndBrmUJFz7GG78KAsK4nFIzd8400wU3YNDv6zYeWgC 8bqwPf927bNRB2uCJ4Y33QoFzLyraeLfG6d0rb2BAGSSlK5lNgfulDscOZcU69y20zaJ QrQEkbVVUdCmcRh0Eu3TisBfHv+zHhkxTA2daRKv9zDrXSHPcCLcfLm8Ax/fXdUiyXoC OfE6xUP6eljQab3lMjml3Rn2WIdCX58PdjcV/dyGMx4MgP4N59R81FLaPc4lPCptJOI8 fADiNifRQhOICLmlgQLSzHZm4IkPdEge83SfXtEVpcwAJxAA/uIBqedGNxX2QcbyyWyp E3CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sprPS/eJ"; 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 np8-20020a17090b4c4800b00274d3f62044si21347118pjb.111.2023.09.28.05.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:13: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="sprPS/eJ"; 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 E79FA82F4E09; Thu, 28 Sep 2023 04:06:36 -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 S232178AbjI1LGE (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232107AbjI1LEq (ORCPT ); Thu, 28 Sep 2023 07:04:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E5CBCC5; Thu, 28 Sep 2023 04:04:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AF72C433C7; Thu, 28 Sep 2023 11:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899083; bh=J5LLSTFm1D1vFFNx5ZBt8xQQCcwQ5onLAqAizpMXWR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sprPS/eJlqGW94D18GotZfCdrkwyf9fKp2FHDS0LNbulwRIOP3NPW18QPk1v8i/rt cvQniSz4oIxJi//zB5mafYKpnEF2ZaEV/jdxSZrzGQOWRg6m5I3ou5hu0hZepyzJR9 KbVM1atjUBE4iDwOg47uUsYGgpCbKlCHMOKQwPpJMmKsdxEOvc1FCl7i037iobGK/+ 4t+gGeRezDxaUXx2wybj27+utW+C65J9tur8pcCARhp2QXHMr/WPhPv7pSMRQPX6oS b8jR2CJEd2VigZaZYLUGdK14k6ts/dwt6PAcwzf8sSVyTReM86PgcyBNpkwuoDBum6 HYLVZbNYtoNyg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" Subject: [PATCH 27/87] fs/debugfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:36 -0400 Message-ID: <20230928110413.33032-26-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283377588540492 X-GMAIL-MSGID: 1778283377588540492 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 Thu Sep 28 11:02: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: 146039 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3245094vqu; Thu, 28 Sep 2023 04:41:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWozetRbfJPzOf680oNaM1ASvtVzHFCCs1YP6jfVyf962C5SFK+SOYpi88SzcqwFwxldGj X-Received: by 2002:a25:cbc9:0:b0:d7a:d716:233c with SMTP id b192-20020a25cbc9000000b00d7ad716233cmr839062ybg.41.1695901315835; Thu, 28 Sep 2023 04:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695901315; cv=none; d=google.com; s=arc-20160816; b=kqO7fMcbXATb85waWc2gvxZSO0eRDzQtmKsrqiyvaGirEHK7p2q3r5kX19zU9yCVG9 kUuyissnXYryDd7eHyxwaE7D63qquKLALglL1bJwLtlxy/RkGHNCoMg8TlItu4/C3vhx r8hoT82M9WN+ImY/TlPzFceIZUJehbtXZB29+B9JTIITIsslUDgHTyeZTDsPzTklB5Yq g/lsL8h9e+b5TKFP5EPok2s+Q3fpaw0SNLypZ9S9xZXY1kdusF8L8wROShSwpzJ3FFQ/ w79RdCg/pY5Pz622H6tgcEiWVqK5uw50YhVvdRKTXyYFfffc0J4VLitcU5uuLNX0HPLt fWcw== 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=0+HmNiK7gV7X96hqfUBxcWoWKRXgNBLisrudLv3C4CY=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=K8uyKjbE7ROW1D8VMMl77iIjEtJ7leGwebC/YyWl6ls0gFMxqpotgI1zsk3l1IevAd WfaF/MciM0nSGZX4eTYh3aqtFwLT5WEOEFkqw8HzY9KgqS6mzDtgovOu0MgwjiMyaWLP Qe484Ike17oqs1groGfY1ih7HK9Sjn+4zIWGOrNFJbpcaob2HKsSMPixueBP8PmVHdFk Yo0XFHEZBZrCXDwIDLUqIqjm84fecRFwbh2ZwwX9PFt2f9MGV+UA5TT6hSD3cegVJwHH epXDeTklzWnJIDcKFgeEsAPghhDA4dkfGsy9CRYtETAGR+nx7zs73Wb0ATkzji6TTk1d s2EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="uS/q0iCZ"; 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 x23-20020a631717000000b00570a4303746si18070466pgl.560.2023.09.28.04.41.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:41:55 -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="uS/q0iCZ"; 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 943B180A414F; Thu, 28 Sep 2023 04:07:05 -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 S232208AbjI1LGJ (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232120AbjI1LEr (ORCPT ); Thu, 28 Sep 2023 07:04:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15DB3CCA; Thu, 28 Sep 2023 04:04:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 217B6C433CA; Thu, 28 Sep 2023 11:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899084; bh=v9z0/wIA3lMrPUrVgPV8jMRrEFIBVBwkDnpYB974b6U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uS/q0iCZHBe6IGy23Du0wVWD8QQsRkuTG7RxzFktFhu7pgdsbnwuQYvKVarlvP6Ts nMjmSm5UqJFJgoT8y3VPUhcXNWRc2oBK+FIsZmplwzeC7CT9bhts4cqBayR7abovdR c7AbIPtVInwXUk3DS6abCJB0kG3e5ObBy0LITQBc218iMDkucusNYfZFH+4w/vkTju G51nThxSmxgwVJAmFVSRp9TcxYqjOyYYgdwsj630geIfo4Oyzd+DdhQfX+axVp/S3a tiFxBp/eorY+k4XZ6mW9Ba2Mge1b3zeVQ8NiD/v59G3fkivQZ8ya9VeCCrYY9BuOc4 hRdX9y75iKghw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 28/87] fs/devpts: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:37 -0400 Message-ID: <20230928110413.33032-27-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:07:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281418400694949 X-GMAIL-MSGID: 1778281418400694949 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 Thu Sep 28 11:02: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: 145960 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230376vqu; Thu, 28 Sep 2023 04:14:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMu2vBLkdPwUr6J3DQhcKh7J9XlIMXPrJbdM1uge0M+EMG5AfSGz5uFuksxue97w0PZZVL X-Received: by 2002:a17:90a:c70d:b0:274:4b04:392f with SMTP id o13-20020a17090ac70d00b002744b04392fmr719640pjt.24.1695899650402; Thu, 28 Sep 2023 04:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899650; cv=none; d=google.com; s=arc-20160816; b=m2vVHSRaoq+JnnBJ0RfInwFYBhSaygaa8wpIaTk0Ly+pg6U2ywSvbw0yL/ucFFefDX f5W9R7XmR9QIfplQU5lrwOUc4z/I7Gp7vDZ2e5URhib4Sk/5xbDzjqP1Bpxk5tBHIeDl 22P4VXKxn7pl6mxFS9IjWDia3Vxo7kKe++hNm65AC8OEXu2wT2AOComnGPcUPO46YfKJ mRcy+v6sV0goCZhU0SYTeqqzTXtnO0N3o66M+ehcPeyZhtyr+IS3VT5jtO2Zlb7B7HlA tkWkfauL9Rw+u7O+RsP5s/wekbchzwxxrdPHE7U4PA2eTSjrtSbV6pT5Qgtm5JAGBTyY V/sA== 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=kALHOePNs8+8G34HZ7dOrJQG5WxdojbQ89+Z20X3Bl0=; fh=orFn1WGA/+L3XOU5eysx2TNcnjC3zPbCOH52pqzS4vU=; b=yuwG5DQKNtEP8VA+pNtv7bwXtpYoSsowlSBY0Rl0IVd+ILfy3q2SSs/K3AOpmA972q Bz+heooJ0/EuRmgIMT/HWxvXpnDd/rV0tzq2Spm+HUQgJjfa+c+Ij05W7xSCLr+AZxLQ StTvvPA6K0tx3AJJnND44j/0RgRPbXTDOpy8sgt7YBXebk14rT33nKvvl+NQt+4NgiSH ZvrtNGXbxg6EJZTkOCnaZml7tdX86kN+jo6N4alzPxC2Adn0qTWMUEZHGKZVzTCNK4tO VIVcgtRzg29qEcSyeSCcAiuL74jsVWQCpNUN21G0kO7+AxKN5VkDefNCgK2EuYdIA43q 22Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k673oIYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b4-20020a17090a800400b00274a5edad0csi6177758pjn.139.2023.09.28.04.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:14:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k673oIYN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 07960836C01E; Thu, 28 Sep 2023 04:07:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232001AbjI1LGP (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232137AbjI1LEs (ORCPT ); Thu, 28 Sep 2023 07:04:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD50CCE; Thu, 28 Sep 2023 04:04:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28129C433CC; Thu, 28 Sep 2023 11:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899085; bh=0dmRPya3lrFlUXe2DLjSdq1n3kPcC+fqGa64ivtV6xQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k673oIYNz2jENTBcISeNoaRbLpgxnUW+0VJmClnsLgtaL9y5ql1V+OFhuYIv9YIbc s4QvBZbu+M7BMigZ2hOQx+r85c3RImDaACEXv1Gv25cLyA8LMPrKarBAfdiwRImank T3RDmuHCZ4wNxsYMbQPj3wWnHuF+RxMbJ8XPWylCJYTQXEFOnBkLY4TpBXHreLSB/1 s2L56TJopgBZQPZsMrCh7wVJ6wP4nmtaz3jLfIapvSFomUVZAW0yX3gdk8zhMfkEUi teu8K5HDMgEKMGynK1MtL26EtmeQwtCp82DmjcvBo81wHjuj6OgfK0Kjai961qRnJm 1bCNCvp860aDA== 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 29/87] fs/efivarfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:38 -0400 Message-ID: <20230928110413.33032-28-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:07:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279671981515485 X-GMAIL-MSGID: 1778279671981515485 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 Thu Sep 28 11:02: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: 145962 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230432vqu; Thu, 28 Sep 2023 04:14:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG9ggRochbUF7vE3XE88hS5QXhN9m2Xsngc0V9Y9KLZlQYIN1J+/+vpqzE4z4iv9xsD6Deu X-Received: by 2002:a0d:d651:0:b0:59b:e5f6:fa2c with SMTP id y78-20020a0dd651000000b0059be5f6fa2cmr833032ywd.15.1695899655603; Thu, 28 Sep 2023 04:14:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899655; cv=none; d=google.com; s=arc-20160816; b=HuARXvDFrw/OelybzXkrGLDutQaPumCcfUo7kzKfCU5XNai1r4ZjvzN+jw/37H1GIm 9UAsP3dzBJvVXDVsc2957evisEeoo4jTmxpzYdlsRRkE+Lu5knQLe1j277k6RhJaAt+H oGc9QjuQK8829OOOLJQ+xSFzvXVjBiFGUitaAixxvYdHOiMqX/33YjUL+78S+mI3TMpy EaRKvrhqZZKy9h9b9uku/Znv0D9isYldND3pbqr4wg2+1Ul2FVv0Mpb3HDyA+fdI3F71 7F51ddKbnDuJ1F4xGUMNM0fHNbUYUUciMWtN7fLdCFhpE7y7PTKYCWn7FmeWCBxIraLR g5/Q== 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=Lt/lYIIK8SXqdVywONTahd1JUVxFCY4qJu6QfmhhoH0=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=rNjqxHIH8siwBV/RO686IDJ7AwPe0SpW5VxcIrNr0OY1IbPNI5gxHLEWcrofPciYcZ U4DDXl/5JCml5WUgY2X0wFp8u9xbIZVu1KTTqzkkxaUXjB7vykPyU5Rce4eyAR9wL4yP q7Q3MglYs3DMOwnxTMRv/QT2cCb5yaBB79eu9nAHstZgrtJyfMIxlFnDpwMh6jdyJm++ aC4IZdQ+4ZKRM1u/zV8tYYtABV4AzPfZ+G3skDGPBP35F+43aMGuLpt8erQQzJ8yV7F7 VM3oRlFl1lIND79AxCAIkOGSSD2qAVh+eTCF3Ktv78ftBhuL7O8GlWNYlIHrxEBNx9hX 7M0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S87i2JjY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id v15-20020a65460f000000b005704979833csi17995311pgq.855.2023.09.28.04.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:14:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S87i2JjY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id C3C6B836CE60; Thu, 28 Sep 2023 04:07:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232220AbjI1LGS (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232147AbjI1LEt (ORCPT ); Thu, 28 Sep 2023 07:04:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B2D0CD3; Thu, 28 Sep 2023 04:04:47 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 384EBC433CD; Thu, 28 Sep 2023 11:04:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899086; bh=QLHf7zWWMBT60c6zRtT5TfN5WGtreZu5GZ/416fDY80=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S87i2JjYqc3rRTopHRdDhhFciOONkPQbMvFX5CTPDpJNE+nsOmSRpXL/rGx23ns2A BnUdgRDbARyYO/Xf7MPiVv7SBPf2u4qka1BV7MPb2tX+ZVVt+6d+19Iw8CcvTo7tUl otqTRpWI8FelcXoY3UXjg+V/uH8sce/1ZkF68xD48YiGYSiA7q2WLe8t/7KcFnzfso uTF+6dAHSE3dB3Iy7dO7R8GInGQUdH6LeVPtV6Wl++j88T3dkZP/+eNtyx7Qt+vWpK pXsl8HEKeHh0YV9UTxrVcgfXz4xrFLAa94YIWjDLs9g4XtvpUmVNryW2c/919gtkDO svJtjIh5BCEIg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 30/87] fs/efs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:39 -0400 Message-ID: <20230928110413.33032-29-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:07:59 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279677020202331 X-GMAIL-MSGID: 1778279677020202331 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 Thu Sep 28 11:02: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: 145986 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233561vqu; Thu, 28 Sep 2023 04:19:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHICKRhlkvdD0qnrMRzX9G1DF2ax2NdNSKoxwFdK7YSK9efeSbw4hWzVcVfLSRiDWQJpOUA X-Received: by 2002:a05:6a00:190d:b0:68e:2ef2:3379 with SMTP id y13-20020a056a00190d00b0068e2ef23379mr832854pfi.15.1695899998175; Thu, 28 Sep 2023 04:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899998; cv=none; d=google.com; s=arc-20160816; b=z+FhDjNDRnaRHk1NwkQ0HvMZrtWGp9H3pRuY7GEXK+mod0dyyfsBI/I4mfkVxVguea WEnZCgBhvqt/KFU6sCeaLDlVqwAizilx3j8p8EG1H9EFC4jj1Gl8vcqW8HQun21g8mwx a8mgvd2V4dRgoxkdio6guYmqQgd18wM7O4TWrRMvcOISmB+zevvojX0FWIiG4z1XZCA7 t6nQoMZSMpOIOh0+AzZLmCtYdkw6OFV9n/tkEa1akR8jf0Kz84O+RTPewSrBj3V1LLvc bR7bprjHSVg4jLKjWs3q2NSN7syuuI0FsdQ4haFSzVPMpocXBysv/clMkkBKo900UIGE Adfg== 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/09miteVAIVpD0b9ASo5qw8fMwjAs8qHDm+sMH9vcc=; fh=saQy1qmSLuCOGrt+QoyBOB3OaXGklLJfNj6dMfZ9i24=; b=sOcRGuezT36j+r1z2oHfhfgkpN9iLAeP2zdinzFT2krejGw3MpQPFoPEZxrKUQ64Et eRmMPsgkqEJQsLqrRnewGvEBcfYiVtNpm+xJa44coPHV5g+nnmO59r7FGlKWdSS66Oyl 3H9fumPT/4pX5uiejsmkHC9jzbWS9WwfNP95ZzKDGgoQckldevf24H7DrSjEeQNclt4V NMyzM818GZQ+71/kmXOMWp9HmXqghIV147hKl9qpdO37HoDRV4dWEHBZ/8GoWXlD5wJ5 fe+IVb3pJpAMFQKA96Cb1AMiohrVxy9BGnt+9cUfRH+6AlafmOUnjhInv1SPTkDB29vm RRFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B+LiYngF; 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 o66-20020a634145000000b005657ba564bdsi10528857pga.826.2023.09.28.04.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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=B+LiYngF; 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 8D503854225F; Thu, 28 Sep 2023 04:06:41 -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 S232227AbjI1LGV (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232154AbjI1LEt (ORCPT ); Thu, 28 Sep 2023 07:04:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 695A3CD9; Thu, 28 Sep 2023 04:04:48 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C7B7C43391; Thu, 28 Sep 2023 11:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899087; bh=xLy8ovC/T/DJkHAEAuHt2zyXkBkARonBG5h9l4hgO0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B+LiYngFvmRQJSi8FMS9rA/4kkZ1X9bA5G4LPi7q6jnThxNY8Xq3HC/urRnR2qAiL JHvqriASpJ1H91QoeNbEM1ZaFMQrMunUWdE8MjbtWxamzNeIEE7R8r6HXliwW0NNQB UnQnoyL/b+fRkjeOgV+wOfJKUjXEx+hTD+PXptAQZ5K8x0BFGrs7qurgsxz3yvmMVt GgI2twG3wZUmigYXw/dIaoMnUMGbzqs2ow49shRLU0dwXY56zd3s4XZvC9E/n/hUX5 ifNrA//wb4zsSWj5I6RHkHjqGp/0RRxK0LUdieb4g0/XR8KimcqW4rQPfj5lqKs2fv 5FaZa0ddIgoBQ== 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 31/87] fs/erofs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:40 -0400 Message-ID: <20230928110413.33032-30-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280036272399287 X-GMAIL-MSGID: 1778280036272399287 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 Thu Sep 28 11:02: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: 146073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3264187vqu; Thu, 28 Sep 2023 05:13:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvFqeUqDa+yy2ljxkRGtdmq8Jh8BeEpwqj1dsJTySz0+MvZ7F+kpGaDbUsShSep2ayK0+4 X-Received: by 2002:a17:90a:d515:b0:277:81f7:8169 with SMTP id t21-20020a17090ad51500b0027781f78169mr936005pju.9.1695903186851; Thu, 28 Sep 2023 05:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903186; cv=none; d=google.com; s=arc-20160816; b=ZvhsTzL+VwXjGGu/8ZbYuq8BCF3DaUSwaikeW7ajC8oVTbDrSLvXx6f3ul5dd9kw1+ VNF54MdNwRmw1sLxG/TQhvo/9heO5Vf1PnRhb6pipYH+t4DdHYLtKdxyQXIhEOFHkilo E2dSTfEn+MGXPMzIMIRebq/ukUMLbHFpKO8Uec8tGqomy+ju/+8soppF54Yqe0wJmTPp a60xdMsiBlH5YrwJv1r/CUVC5c9LcgP8HFGVoaD1FLBN1CD6HcGfxUcL07vBsP7aVw02 Xw9ogMpqZ/PsC6YNqcDo2mNy2oNZsikMXG2IgUUaEsSbJMT2WC2fZqsBywOfwQL8pfgL bZ9w== 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=YFSNpebnXcQwKo5drr7J6gvOqmC1k6mWfxPXLithxOQ=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=sxq/2r3JVPoFCsYXNKFp/AjZzquAiguXbpwrcVURyYPY57WJTHyEDlCnKZcGbHF86n /iNHN5PtjiPJ1vFoz96/xv0mLsXaytFHMx4X+th3ocyD6IjSTWdPv+3wisHPTbciYkOl qbvd0gWe1qpGg0EvMwdGivQhT+y/WuIlCkPnfONuwV1tb3sy2V7H1i7iFCBRAiJBwJnz Q9tsuUTwrLy001pTYMwo5659gy/fqP2Vs87pk3gITAMXdiU5GyLjKyok+yy3yBCh8wJe d+wOSc72cuIE1RpqPb4/eTg8vCjLpVtn7l57IOzpPbOGnXdjpewYRcgn9Kr/dk88E0vm r3kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=krfVbC+A; 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 b4-20020a17090a800400b00274a5edad0csi6286731pjn.139.2023.09.28.05.13.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:13:06 -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=krfVbC+A; 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 46CB482F4E04; Thu, 28 Sep 2023 04:06:39 -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 S232382AbjI1LG0 (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232177AbjI1LEw (ORCPT ); Thu, 28 Sep 2023 07:04:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD41CDF; Thu, 28 Sep 2023 04:04:49 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA214C433C8; Thu, 28 Sep 2023 11:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899089; bh=/jx6v54okv5rWUdL7DXV1/JPVZXBFihxPBXGVAifEAI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=krfVbC+A5UJYZiJou/wpRVYzcYwLL3aVIIdzaykXDg9QVNW0Qh3AgNBpvtAjTqErO MnLftgQldgru27kculVvKhoHtKG6HB+Hza3ERjacv7SXYIjEiXeglgtDIbGAHmQuol Ohanmy4hA8m0DKoJZy1v4OD+2QAynC1meUsAN1SmGOQxxN2iG59zxyqwjQqbPMAPI8 1jmA8FHj2c928me27hkE09wRuFWr8f1wwR61K1ShWnB0+2j3f3bGkF7qxhhGdSS6+A apaXdbIVbNhaVWtFw0wZi9cRqjZqDvdJgfqqVjyE5i94PzgdEGMyxwBeTovFk2ZsyJ ukvc6x3B2qtEA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 32/87] fs/exfat: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:41 -0400 Message-ID: <20230928110413.33032-31-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283379768192293 X-GMAIL-MSGID: 1778283379768192293 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 f55498e5c23d..f78b614f44dc 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -549,6 +549,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 32395ef686a2..30ee2c8d36a5 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -22,7 +22,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size) if (err) return err; - inode->i_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)) @@ -290,10 +290,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 1b9f587f6cca..b92e46916dea 100644 --- a/fs/exfat/namei.c +++ b/fs/exfat/namei.c @@ -569,7 +569,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(dir); - dir->i_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 @@ -582,8 +582,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); @@ -816,16 +817,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: @@ -851,7 +852,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 @@ -865,8 +866,8 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir, goto unlock; inode_inc_iversion(inode); - inode->i_mtime = inode->i_atime = 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); @@ -977,8 +978,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 @@ -986,8 +987,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: @@ -1312,7 +1313,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 2778bd9b631e..e919a68bf4a1 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -370,8 +370,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 Thu Sep 28 11:02: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: 145961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230406vqu; Thu, 28 Sep 2023 04:14:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFq3mea0ulNxw6FAPRtc4tzZ2d+Q1EbUxCT7KkFHRqNNkqYxY43+Rv36OcFqkUY9vXTbOA9 X-Received: by 2002:a81:6006:0:b0:59b:ec10:915e with SMTP id u6-20020a816006000000b0059bec10915emr832897ywb.30.1695899653456; Thu, 28 Sep 2023 04:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899653; cv=none; d=google.com; s=arc-20160816; b=puigyZ8zr3JdbzpmAjJr9Gdz93T7tANbirm7aY/o2Svy94OyGs4eUXgHKHzv5RmJmV ctgD2thMZ1hRiPngo/rtmng7JqJ27+QWIMk54Wdk/MTS7ICZxyR/Mb/46frDDWmO1t4a pmbwldmxaT/Emvrkl1RIhNEXoFaECpYUt+bh0ZP7jZHjeDixJ7k4Oveeg6Syk/gk9xYG IRurjU9Y8JmO2/1NoDCH6WBtB0G9Ok0tHyFe/+URvrfisYmdw/S4AKcu8LzymfjlpavY AXfolxqBA2507An6YUXnIgoQgYSuNBKVRlwJ7acaS/XuQ0PA1JduIN6Jy+O6YxRBn7vr 56mQ== 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=lJIYo3aCsrk217UL6Mixu+Rg4lsDZUcPXJd1vzORCGU=; fh=aD1RA/mx6kHR1Kdf3Qx+6NOt32D/zEAMDihfEgEurGQ=; b=yl2+4s4OVRGmjvUonoPRVUOfIIdYTPMT1lrP/6NfaNkTtb2QDQF8ZqNYwl9YIZx4CY UKnYkmeppwh7O4NMcpa8K9Z+KPffUiGMkVIPvo2apyNQVCy4RzAIL8mN37mO7HPqWntr SU8awDNL4TUKn8jpx6sBTrgllrxpiOpAP2lRh/O0oLxqP3/rtV/I5QarHfdvyysWLVuA Rnj2ZWuj8+ecOBMowEvW6n7EThOIO/bOkyxNWRRPwivfeBCwrODa2vVioyO/vIWfTOiu mrUxw+ub62tKD7/ZqArOPLU8jAqlEbFOzVy196OYv+v/XGuCkpOz+REQzovlcwaChWpA MAbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=seXE8k23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id nl9-20020a17090b384900b0027677087be2si6372045pjb.108.2023.09.28.04.14.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:14:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=seXE8k23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 786F7836CE53; Thu, 28 Sep 2023 04:07:27 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232242AbjI1LGi (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232198AbjI1LE5 (ORCPT ); Thu, 28 Sep 2023 07:04:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28C83CE4; Thu, 28 Sep 2023 04:04:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 275A2C433C7; Thu, 28 Sep 2023 11:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899090; bh=buEnV+Wgc4pn0pkfok4z43YPFhAqoFE2sQ0OTWjvEdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=seXE8k23ubQh+fcr3ejnY/+V/XKY5rKosQptvSFDxf2yJJEZtEnmwwGp7OXXgM1rx 0Dg56KVr9Nm6oQP93rHHlfB8EGAySs6A2fQZlXBTvq2kvMCxRC57rgoI6Wv2v31RtD QydqSZk23W34l5e2dH14bwmLkMFhavQrlEAwgwAifc6Zj78sbntBIGq1xg4SHXKugR ggr7/o7r0RikMpzwvYmZl+shWH2363RzWaJuESszmA73lW4GpU0DqH1Zy6yQ+9JmI9 6e041QlZw7BYb1GVNOZ2DH6soQINvGBhYr7g0e878yttwp809CGoVNf4ulYrrypwrC eW7Z0KykhIFDw== 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 33/87] fs/ext2: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:42 -0400 Message-ID: <20230928110413.33032-32-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:07:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279674826533000 X-GMAIL-MSGID: 1778279674826533000 Signed-off-by: Jeff Layton --- fs/ext2/dir.c | 6 +++--- fs/ext2/ialloc.c | 2 +- fs/ext2/inode.c | 11 +++++------ fs/ext2/super.c | 2 +- 4 files changed, 10 insertions(+), 11 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..d8c9eaae383f 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_atime = cpu_to_le32(inode_get_atime(inode).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_mtime = cpu_to_le32(inode_get_mtime(inode).tv_sec); 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 Thu Sep 28 11:02: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: 145987 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233562vqu; Thu, 28 Sep 2023 04:19:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIO43v1GsjCk4ltwnUz3PCzWF9R+XLtotdXOjx4YNL9/Z0L5bZpZwT3mjc8+QjgoLXyyi0 X-Received: by 2002:a05:6a20:2446:b0:135:7975:f55 with SMTP id t6-20020a056a20244600b0013579750f55mr961621pzc.47.1695899998230; Thu, 28 Sep 2023 04:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899998; cv=none; d=google.com; s=arc-20160816; b=WNnx1Gk4Xcd37qXcTy5OuLKWZI80TV/G2optLYy3SETt6hCBWya/HMe4fN5IZKyW1e FWu/7P8IOb/yOpxgOzpX34Tc0pyKpCmMYIJ8WiC9GGvgeMq0zgLUfKgPX0JnvXbv71lB R58vtqokMBEqtLJCoq1RLJ8L822sw7WpQnF+AJOxfFbg1RY4Jnm0qBhVvSrdHnIeUx+4 pAWx3dg5a0mk34cixq3eOlXLN5Jp5CF45aoRdVurmmvGDsbdZ0KDJW08GwxwZ79xlv6Q kqXikOuaB1J3CfPo8CQ3hkD3qppKoNDnnBjBkJJYpvnNAzmqaRh0QtzUtrzb5mH+STwK /m0w== 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=4C/YYZpIcQo0669IslHM2t7E4UlUgP5zCJ9D1rd1Yxk=; fh=aD1RA/mx6kHR1Kdf3Qx+6NOt32D/zEAMDihfEgEurGQ=; b=LQLHC5LcAhJV20mRwI/7pW9I0DfqEq4eeA5q4y/eahHapIyHDy3UWiKWWT/re6Krtp eLwVORcbJP6m6wei4dj1HX6UrJgbImzP0cp77vLWhFCLAtHwBPn652+Zn/6YXsdF+zYR Q01an8mPw69wFMLT5XsL1ZFhfd4QT/ZlxABkJ4jxoJIfefijJL0FNNCRNhNkBPaGbFiM XPG6kXGDFLFsFt/++kCzWVP70TWrD1LChMk1JWamGKq5Cy1n3PAwYixYKK+GlTPkqKGe 1aTSPoFj5Sjmtp1N4KwHnUDSrmU4qog9eZZoSlhy4s9v6OtX1k6BBf/Uzzi2E6NrFzdw MYvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XErhx/Z3"; 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 y12-20020a170903010c00b001c5f9de7a35si12855832plc.109.2023.09.28.04.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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="XErhx/Z3"; 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 A16858561641; Thu, 28 Sep 2023 04:06:58 -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 S232421AbjI1LGn (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbjI1LFG (ORCPT ); Thu, 28 Sep 2023 07:05:06 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA1BECF7; Thu, 28 Sep 2023 04:04:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0328BC433CA; Thu, 28 Sep 2023 11:04:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899092; bh=zfLZQBwCPcSVTRmRv1LTQ8vuJlCSE4hXiH9A3kpwRTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XErhx/Z3jAtKVHvXkabF/QrzCHHOm1ySfubkYRlIED0TDTgbD0ATEIIVWjAm7/wJJ pgs8y2JuJKAiI0o73YjFS3oVXApzDOgQMz/xR0ZiBxAhYka1R+FsRPaNg2BAQE8pGh b6vyz+8yOAl0h949nSM+LspGjny/3tGTGoQEYdrcPodbu5faiNCEgXLwkxjXHR1H71 dAGxEFmkb1YbqHJt0ulSDgLVl9kqZZvSHWN6yWWvKSRdqzZOL4Rv5EjsZVd0LotbDO FPA6rGLcUkzSigFnPEK57aGcsnUxGGpitWxvdE26dejUrWBYSl9oeNBOZVK7iEoI0X ZZ7naoxix0dzg== 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 34/87] fs/ext4: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:43 -0400 Message-ID: <20230928110413.33032-33-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:06:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280036530132245 X-GMAIL-MSGID: 1778280036530132245 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 | 6 +++--- 9 files changed, 55 insertions(+), 34 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 9418359b1d9d..df58577ecc3a 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 dbebd8b3127e..c642adf54599 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -7127,7 +7127,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..7980348915e3 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c @@ -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(ea_inode).tv_sec; } 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(inode).tv_sec)) static int ext4_xattr_inode_iget(struct inode *parent, unsigned long ea_ino, u32 ea_inode_hash, struct inode **ea_inode) From patchwork Thu Sep 28 11:02: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: 145988 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233590vqu; Thu, 28 Sep 2023 04:20:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGuTTK7cLE99wzUdwdPkoscHky3qLotxI+UMFt+yxQnDbY9ZJij9//XIKEjkJHgWC4FaRE X-Received: by 2002:a17:90a:ea86:b0:277:1070:74a2 with SMTP id h6-20020a17090aea8600b00277107074a2mr822180pjz.23.1695900000065; Thu, 28 Sep 2023 04:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900000; cv=none; d=google.com; s=arc-20160816; b=ppNycSr37trTBsjgvimIDH+zl8MT6ztq6fQ80R1CCTKa6q9CiXvpNk2XGq6WTIV+Z3 v80SGG86wFG7NuQ+pkakaEZRakJfnPvi4dAHcSjV3362ISUeFcDxU8UKwfqq0m+Ona4i BAlD9gkkyqhzhg6+OKGtyv2VTvXWxi3iGVziCaF7QLF515klqp80L6zz1Ev0jHeCwXDc 8UVRQjLjALfuPlWfWztItJwfrmJeA8nV2kRgUqdubtzBpkE7ySslrBwSVxCbUMn3wquL 54tkQ4KzRF6Awig8dsQ7HkVPuXaH24vmcaOSIwuHPaDL9D9lZxWKCVJodc0kWNs8i0JT 0f+Q== 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=chUwOc4YOWgG9eXasFEYtE+V6RNq7iEDm87KK2GGUVY=; fh=tvWafCFc5Ppo5rQybla6n6b/r5mFKKQAGAEZsnRXV94=; b=oc2ZZY4njCQNRwB1kdXXhVsYUzO1+qcJZnKT1Ibxblces9Wr460MQgPraEOxvrZTso Qyofu6wWLtJa4f1HTibso1PFZTf5PMzD46+Mun2IZsjWjnQVwPQewVcJKn7X+bx7kDih H+5LvH4ojHjZqWeX1+K5IOre7oPtIVtYpCOYfM8C8jWZYLdyLpQ5TNsMH124EWFT9sGR iXafkwkEv6UHlnkdfZa0GDuP0TWzxBfzEDJZw+oUiODxV2Xxh4aUj3qTJjRYsIpj6Zfz +fXN44QFqqaEUltY6aOgGEH19CJVcVGDh9L2t9JDFYbyHbLxp7UGayZKPANWe9G3ShFV 4LKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SGMGyOVC; 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 gb2-20020a17090b060200b00278f7d7cd43si4937791pjb.168.2023.09.28.04.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:00 -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=SGMGyOVC; 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 A98098542265; Thu, 28 Sep 2023 04:07:27 -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 S232426AbjI1LGp (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjI1LF1 (ORCPT ); Thu, 28 Sep 2023 07:05:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82B8910DD; Thu, 28 Sep 2023 04:04:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E970C4166B; Thu, 28 Sep 2023 11:04:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899094; bh=xy5xKvOS+FaMJlr9U9ud4gSCBfgCY/a9XrDzZtVtdX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SGMGyOVCBdKCgBZ4A3f6v/hZUR1RojNXfYsTtjVGcpOSxLbcfeuvJRoOM2iBrgd9T n0s5MyqAsWjA1i8GVguXBsUZg2fZpdqxMPjmX4ujyLh3IIE+kylto/P3YriIP+FGAH IQdw2sx+3FBRl7LrTIa/4SP1p7imrerFqZuKj8/bD+H2+kiNsdyQOCmnEa5rSaUvi5 mPglltjeaXXO6XdXgtjHJ/xG8/SVeGM2cC+GGIsi6TnN1Nym8153znemWCTPjfFZab dPo+3KlD2doTWqAdDpIQuuVmN7UiPeYPqH8tBhBYLQsW86PJquWGhzX8f8Wwj9axgo Y9D7tXVa3aD+w== 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 35/87] fs/f2fs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:44 -0400 Message-ID: <20230928110413.33032-34-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:07:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280038589934557 X-GMAIL-MSGID: 1778280038589934557 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 | 20 ++++++++++---------- fs/f2fs/namei.c | 4 ++-- fs/f2fs/recovery.c | 8 ++++---- fs/f2fs/super.c | 2 +- 8 files changed, 34 insertions(+), 32 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 6d688e42d89c..cb9927a6d0c8 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3317,13 +3317,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 ca5904129b16..dd99abbb7186 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..96e578b008b6 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_atime = cpu_to_le64(inode_get_atime(inode).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_mtime = cpu_to_le64(inode_get_mtime(inode).tv_sec); + ri->i_atime_nsec = cpu_to_le32(inode_get_atime(inode).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_mtime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); 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 a8c8232852bb..ca965136c09f 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -2710,7 +2710,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 Thu Sep 28 11:02: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: 146006 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3234866vqu; Thu, 28 Sep 2023 04:22:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlZ/deS5tek8682AWwvrwDk/0GmnIc13I7NOMhRVE2P0nHxXHyM8/0TrK98w9zBRhdiToZ X-Received: by 2002:a17:903:22ce:b0:1c3:cee1:cc8e with SMTP id y14-20020a17090322ce00b001c3cee1cc8emr665712plg.68.1695900136898; Thu, 28 Sep 2023 04:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900136; cv=none; d=google.com; s=arc-20160816; b=Bb2C9HRg4mWT0DROkas2APBPKR0cRpg6XZgyXDoC9A97DRC2CHMKv+WMXgi4zu+cQR 9Hm7jDFvhtj79fx8wfazYy9qvDgUZt6Z/Ok1yNO8ROOpNAKy3oYVrNA1/y+GHRR96gOo 0/P/fu0ANLHeeQOSQ6Q8x9tJTUhuLZ/ACN6uxYjbQ84K0ldQIIlaDK8LbaNzfkhLcKGb 54TgrQmrRKrUdbs0NItQV/8IHURCGafD9LcQRXjBHPjduMmCjUmYgqKPdOc/jJQ50/er FFrN0q8ra3e3FqbYyuIwXdOI9vOF14CvmURuz9zuwQICEmzMcoAWGEknxIBWpEAWRe5C eRbQ== 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=CICgy+tiSSF211JXqYdTxRL5yiJ8DGmCiXKa5XeGzc8=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=sLHm3EP8ge7ak+UA3QqQPrnKAyAva/QYdQGBFkNRqI5IMVdYJbA5jleA7GswP9wETU K+ZGaXjvFPwjWXU6bIfbOTFgWPNiKrUGFGpOB3i7G8ik4Ynq0sxGOT2lNsz/vb5dbWnM zH3fFNLbhaD10RfX2D3IRHNE3yoErxtgMSIKzZoxCiQmD3HGSRivK9KL3qO21TGXt0uo QJEB9Y96I342dqhD7G4WNNiPAEYMlJJUpRuqPt996Ki7L2DBrXQns7cx4Q2GczpPCDpM 39Q8ct9Ghrqc7KrqxmfN70EhQp+yubsKgkFNapooH+KO6w9HWMJWeHeiBgCE9urWXj33 rv2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="YD/Je98w"; 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 y12-20020a170903010c00b001c5f9de7a35si12859899plc.109.2023.09.28.04.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:22:16 -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="YD/Je98w"; 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 49F2782F7F89; Thu, 28 Sep 2023 04:07: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 S232226AbjI1LG4 (ORCPT + 21 others); Thu, 28 Sep 2023 07:06:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbjI1LF2 (ORCPT ); Thu, 28 Sep 2023 07:05:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950CE10E4; Thu, 28 Sep 2023 04:04:55 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7C7CC43397; Thu, 28 Sep 2023 11:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899095; bh=/4u38zrIHT4H4rJuHYzj6iHq3abwIxPz2pUOPVzS09Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YD/Je98wuNprpf4cjTZyE6IwYPCYAgDUCZErZqdHCK9qsBf+xBLe9ipZ+SohaJgCN OMHKKUxW4olBgdcqgc9EMhdhIT5opdTlNc1hMY71VDSwCiClUBHa31TUm+1/2H9W3W RdalLk8Ohtch1SJ3Fl/Vcoa8z7xFT+OkyNmvtQs5sZpehfO9dy18gkmaTw8CKzrkpg OJBx/t3D2wSl+qFmZJyzVG1SXChaPMGby9UE7QT2g44UEUidD3XtjBZxcf5sTCVaPH 675Z/LQRq9M/kLCgUfF6+Y0hD61H2D8snmTEd1xk7LtVSa315cdT0RiEE6st1Kdd+6 Hg6sIga529+3Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 36/87] fs/fat: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:45 -0400 Message-ID: <20230928110413.33032-35-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:07:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280181601394019 X-GMAIL-MSGID: 1778280181601394019 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 Thu Sep 28 11:02: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: 145989 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233663vqu; Thu, 28 Sep 2023 04:20:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlLhqfvmQSV7DhdjI/C6ihol/uER51jE0tVHfCbPKubQjf9hr6n50mhMpDeEXAlYdWCISA X-Received: by 2002:a17:90a:7525:b0:26b:219f:3399 with SMTP id q34-20020a17090a752500b0026b219f3399mr712164pjk.35.1695900006977; Thu, 28 Sep 2023 04:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900006; cv=none; d=google.com; s=arc-20160816; b=r8X9m/BMIg//AsOZ3QAJ5lL/ps+nBlvnnLF8nJ4mpBvu5g5DiTlN9MEBSrCTZPSLHt rRCrrY8F4OQM8V6HFLbZRGza+lcZkZWJgEHq60d9yDg8+Kr3habcsoUl/Ndm/rxNkreI 3iY/nUSY2shU+iT5UgNGOcDglMp7ReSETK7XfqkMwAtHUXA4MlYE1adTiUKmrCbQLexX gcSzCoS9pDMzTgzPvV4Y9ZQddwfpbKbNrB8yfaoEOSZ6bQPp+pk5dT9glRl2L7MxgtfN cm60EHMMH9gsTblBCeoLq1WsbLD1QHg+kcp7yVBtPpsR+PMvuS47sizvndLNlCvbVuVF KjdQ== 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=1HwDSz3ekSBbmxgPyggbMrMlLOlEdH4hBAdImTTauGA=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=bCj7e53CVQ6DekUGUcI1pR4fn+p/1CSx+20qGBUozmAhYJoBbbe6QB7x2MsfcNsqen CcS7qUKoIsKb/7Vv6KkVVrzfe9JOFNsyBawPRE0k/csWxFpHy9ZaDAgoIxH8l9GC//YS mVKo71op1yBYrzi2wRIdaiM9dY5xyb/raVn7HLLqE4J7qV7/kRnuhd/iRvC5RL78/0CK 3xWDFtrI32Wyc0qIbgQkJYZ6mfSkhx5JL8/4B3GFgh6/GOEG4pGjtmVVzMRiwhIY0aEe HqBJT0wzPELBeuwAbIYACm2h/orccFHCwiDANZ87k0pQzy++0rNrejsmBD0cxxHaK0lw ztiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BY7DmgdS; 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 u1-20020a17090a518100b00267ba1c43adsi13750806pjh.101.2023.09.28.04.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20: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=BY7DmgdS; 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 95D3B85624A4; Thu, 28 Sep 2023 04:07:41 -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 S232292AbjI1LHc (ORCPT + 21 others); Thu, 28 Sep 2023 07:07:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232296AbjI1LFg (ORCPT ); Thu, 28 Sep 2023 07:05:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9709210EB; Thu, 28 Sep 2023 04:04:56 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1E0EC433BA; Thu, 28 Sep 2023 11:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899096; bh=KL3FQ3jpZEuK0Ewt0+ej83FFC76E2dh/iXYhCIu4n5w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BY7DmgdSg0T+ZpSlNxARM6JDMhM5D7IoMPX+GzyEbHOBEa/96E/62DMGJL3iRGmJ5 M2d9Z2nNlAmP1AkA5k51OjmsF2nBbJihcIvvO4xajT8QbDoKkJGGXE0ewKi4apiUDs qJSF0pQNNXsOaOnoAp5fR9EMEulPv5bDGtKDmHhMfyrVkWXR+PvGYTV4JmvSa5y2dj tTZL79V4eW614t4GX4jh2isrokRRWaY3bVEaO182EKuZP8feqMRKLapZn/FI7xtefV VYKFCrfCqQdZgB8mIrv3BOJ08hSNGaXLL2eu9TPaw9XGDxNKO0scPmF03/Fz1thbPk 2pIWXNAaJpEyg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 37/87] fs/freevxfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:46 -0400 Message-ID: <20230928110413.33032-36-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:07:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280045900950851 X-GMAIL-MSGID: 1778280045900950851 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 Thu Sep 28 11:02: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: 145963 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230435vqu; Thu, 28 Sep 2023 04:14:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGnuU2pX/hTbwSx5oqwQ1Y/dWxbBzni3mNEMWq+Jj185XZIoRyGmEoIvMFOJVZRFbUSfWkR X-Received: by 2002:a05:6870:41d1:b0:1d6:4641:9172 with SMTP id z17-20020a05687041d100b001d646419172mr897290oac.48.1695899656285; Thu, 28 Sep 2023 04:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899656; cv=none; d=google.com; s=arc-20160816; b=XkjkHYxGtYMlNz0R9zKdpK9c8o76NpNW6mGvWjei1+UJ0kAQSVtEnLlQvAnUKsukBg sI9gjdebel7O15CrU8SS3YHTCBbZiQ+ygF+veaL9Ke3gZDRoehEhBjH6HIkHYZS9I79r kLDK+ZQ3Of/VraCDdXytocVBACfAa8DM4aIF8sf+5wn3GpaWoV6/JlDmckFARvG7qNA7 ra2Hn2UGT45tzG/lpuYmge2G+RvAV4q464A9RSTngI9ehRY+u9a8CBv6xsUMpVlATSJG RdP/giKLInILS44eziJ8xoX+eRmPFY+X/6bFAX5Esg4pG++3ic0eyXlr3zZ/AgcA/6kk iOBg== 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=7C9Don8gSgbbYwPXXvtKNEi+Xzup+v5/3AbmR0odyPA=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=vORxjW1jpoVcC0xOkC1C9SLVJbmMGsm7tgCKNQDyIepZf0wBkondiy3rQwMlyh2yr7 HJMLlY0cqnfyl/BTP1oNZ4ARXlaFE8T5GA7yuojSEpHe4/dfq+bt6TqKC61fjiLU3Jnv ErdKDi8XUb6++s8d1fgG87M6MbenAZ20lcCUe8kty6uM5AkBgQu3EXj9bmcVjnoN54Wr LEQq/PlGhWURhRROLShNIhR7qDRLHRaAUVlrBRZexmPpcpO6xZoenUAlro0mbcfsp3pj cxpY3I8KcTKzjd6kYo9fAyO2zp1fKhDO17vlCioN3tbzzWfYJ5n6xNw4qOphSZLkyBLN yLtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=it9kxg8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id e3-20020a636903000000b0057d7cff25a9si15165282pgc.323.2023.09.28.04.14.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:14:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=it9kxg8a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 2E4DC836CE7C; Thu, 28 Sep 2023 04:08:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbjI1LHf (ORCPT + 21 others); Thu, 28 Sep 2023 07:07:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231851AbjI1LFh (ORCPT ); Thu, 28 Sep 2023 07:05:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 099A610FE; Thu, 28 Sep 2023 04:04:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FE21C433C8; Thu, 28 Sep 2023 11:04:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899097; bh=LKLhIsUTFieq68OcX4ILSefLHySzq9aIRjDYBRwnayg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=it9kxg8aa+2XWHa3Eb/OhbYUr/Et5qT+JxeCzVJ9ZE2GlFoXb9Cd/l9gdZwjxEies dxllCJ2pTJ+IbnaA/yk0qYNhq0DSHXBP7mIkYJVxpjXAZ2tm1+D6LEny9pHKonI4hV j5bEKsyAnNuF1KZ+DM5M5n6d2k1S7dNViLC/NdNQcX8VJdqs1q1KHR+1rMVZqOF5xS 10g7ss/rckbaLCQjFm2wTfK06xoASWzcrDRNN2Dxj7uZtvKk9GPo6l91Q9GrcYMA4i UktliHZ2EMISMphafK8DSHBQqxfTAJEh2s83krJ8qR6iZhhOPRR3gUBZ8I+6Vf75T3 mbOiM3cjC4hsA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 38/87] fs/fuse: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:47 -0400 Message-ID: <20230928110413.33032-37-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:08:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279678327348293 X-GMAIL-MSGID: 1778279678327348293 Signed-off-by: Jeff Layton --- fs/fuse/control.c | 2 +- fs/fuse/dir.c | 6 +++--- fs/fuse/inode.c | 25 ++++++++++++------------- fs/fuse/readdir.c | 6 ++++-- 4 files changed, 20 insertions(+), 19 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..bc2e2ee7eb20 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1812,8 +1812,8 @@ 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(inode).tv_sec; + inarg.mtimensec = inode_get_mtime(inode).tv_nsec; if (fm->fc->minor >= 23) { inarg.valid |= FATTR_CTIME; inarg.ctime = inode_get_ctime(inode).tv_sec; @@ -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 2e4eb7cf26fb..ab70dc3f00fa 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,8 +274,8 @@ 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(inode).tv_sec; + attr->mtimensec = inode_get_mtime(inode).tv_nsec; } if (cache_mask & STATX_CTIME) { attr->ctime = inode_get_ctime(inode).tv_sec; @@ -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 Thu Sep 28 11:02: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: 146019 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237460vqu; Thu, 28 Sep 2023 04:27:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6eRY53EKb4TkIMXYBcQ8QLEUmTu73uB18o5IqoCWGEJGmFw/6xejiBWVryAbPBzRZt13C X-Received: by 2002:a05:6a20:8f0c:b0:13e:fb5e:b460 with SMTP id b12-20020a056a208f0c00b0013efb5eb460mr1625584pzk.0.1695900460138; Thu, 28 Sep 2023 04:27:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900460; cv=none; d=google.com; s=arc-20160816; b=ilAmMajrzt+5nly+x710gDlmmETcAUjINgeCo+WovDRBf3NkMt7JXfG2epCnMy+iZQ 4coypPQc88TPMitzas3XWnwGr/SsQVo+t9VpPKjlKxnfy/w5r+1Q1k+62IkQQ6+6/PD6 ENkXzmRA89dK35F1XHgvNPLe+58Uw0ugcqYf4YomaeQ5Pwcc0b1/4k0oLQ+RUl6miETj aeMDbQj4uhRNwgUulSvzwK8pPxZJKkIxTF/f3PH2SaHGQ+KnuzMizoViZlDiW9NTOpIY ixfv7cqs2lsuodB+U68vkFIJpLfTh4JyoHcQipqbXgiS9LWix60b7fBl2KLvvddvnNbM n8Cw== 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=GjM9GGWDOsUOjcr3ynnJadUVBiDbS2MIc3gbM/Q4dqk=; fh=FKPwUxQbxQ40NykdiXptwFfRjdCLRVbmEKOVvcUlADM=; b=sBSIE4Wq9ocUg7PKCjTwEChSwzukeSM9vtaiR/CgURq6c7OHOUszHBwbmzpninOpGq uPtDsDzmRvIad7TNjybSvh6U52CeTzrUD11Axe1ofqkaxFiZ8nmoLtD2rpxKKEK+4J5h MZbH8IDA0XvK+3O38+Vzdo3JooPbLSEMa65fQ1yudUYmq4gT9cIue9r3McOHSfPI6bzR XiQtt6Hp0bEgkPn3yHrfExgNL0S0eB3+Ae2+UqULkD+b/C2w03MOAjH6Fu65cs+S+j64 RWBCmlQj+9yqSZVyiA/3UC6kCdqXeBDiAGWzSk7KdDMwXwdYn9lrYpYNoHQzSzTvrSaF bX2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="VAFuf/Mi"; 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 e26-20020a63545a000000b00573f6ee58fasi18110938pgm.376.2023.09.28.04.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:27:40 -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="VAFuf/Mi"; 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 4FE2E8174A61; Thu, 28 Sep 2023 04:09:22 -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 S232381AbjI1LHi (ORCPT + 21 others); Thu, 28 Sep 2023 07:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232319AbjI1LFo (ORCPT ); Thu, 28 Sep 2023 07:05:44 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8751C1712; Thu, 28 Sep 2023 04:04:59 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3A16C433CA; Thu, 28 Sep 2023 11:04:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899099; bh=pl32liCrwkmVuPM2owBmJWkMCk7GZeKtnHRbBp5Lo/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VAFuf/Misyc0YMMydNEaWArEJTkw1IagAmZgBgYRh1x/3fc+m17Gu5lsLBT5ItjHt k11vJ15aA/JPXWYBh3dQkiXn4f0jkvkY2Guue18UndWxmU187oM6TCwLRXKjLtc8AR lEV+phJcSI7abESMU2UrkzwxF5chFXvUYSG2Jjml/IXTiu4eICIsuJyB9JY1ly9fK3 /rGqj3z5J97GRYyyf8GiNc3k+ZsqRwKddG9uIgIaqbiuA7KalhPSUJ9RMsKwW0i9CW UtKIhLeamE9wvNMIuNUpKyYN8+lOj439DLcL0sgZeboL8Ls1Mju8GliIT+39gfVh3O iFwQRrU1dgVTA== 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 39/87] fs/gfs2: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:48 -0400 Message-ID: <20230928110413.33032-38-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:09:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280521034558085 X-GMAIL-MSGID: 1778280521034558085 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 | 8 ++++---- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index ef7017fb6951..011cd992e0e6 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -1386,7 +1386,7 @@ static int trunc_start(struct inode *inode, u64 newsize) ip->i_diskflags |= GFS2_DIF_TRUNC_IN_PROG; i_size_write(inode, newsize); - ip->i_inode.i_mtime = 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) @@ -1583,7 +1583,7 @@ static int sweep_bh_for_rgrps(struct gfs2_inode *ip, struct gfs2_holder *rd_gh, /* Every transaction boundary, we rewrite the dinode to keep its di_blocks current in case of failure. */ - ip->i_inode.i_mtime = 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); @@ -1949,7 +1949,7 @@ static int punch_hole(struct gfs2_inode *ip, u64 offset, u64 length) gfs2_statfs_change(sdp, 0, +btotal, 0); gfs2_quota_change(ip, -(s64)btotal, ip->i_inode.i_uid, ip->i_inode.i_gid); - ip->i_inode.i_mtime = 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); @@ -1992,7 +1992,7 @@ static int trunc_end(struct gfs2_inode *ip) gfs2_buffer_clear_tail(dibh, sizeof(struct gfs2_dinode)); gfs2_ordered_del_inode(ip); } - ip->i_inode.i_mtime = 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); @@ -2093,7 +2093,7 @@ static int do_grow(struct inode *inode, u64 size) goto do_end_trans; truncate_setsize(inode, size); - ip->i_inode.i_mtime = 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 f41ca89d216b..e7d334c277a1 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 0eac04507904..6d15868fcd48 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(inode).tv_sec) - 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 171b2713d2e5..d9854aece15b 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -886,7 +886,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 02d93da21b2b..f5ee6c451bef 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -410,8 +410,8 @@ 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_atime = cpu_to_be64(inode_get_atime(inode).tv_sec); + str->di_mtime = cpu_to_be64(inode_get_mtime(inode).tv_sec); str->di_ctime = cpu_to_be64(inode_get_ctime(inode).tv_sec); str->di_goal_meta = cpu_to_be64(ip->i_goal); @@ -427,8 +427,8 @@ 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_atime_nsec = cpu_to_be32(inode_get_atime(inode).tv_nsec); + str->di_mtime_nsec = cpu_to_be32(inode_get_mtime(inode).tv_nsec); str->di_ctime_nsec = cpu_to_be32(inode_get_ctime(inode).tv_nsec); } From patchwork Thu Sep 28 11:02: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: 145992 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233734vqu; Thu, 28 Sep 2023 04:20:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH48lzpW/Cc6GqJV2gjNQjWMevLnt6F7N+P8w3NYIu6DNgvgDg9uPdrEf2TIetP+sdgzHM6 X-Received: by 2002:a05:6358:2496:b0:13a:cb52:4837 with SMTP id m22-20020a056358249600b0013acb524837mr854646rwc.31.1695900013090; Thu, 28 Sep 2023 04:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900013; cv=none; d=google.com; s=arc-20160816; b=Moaq6qERd1krSC6tmnJph/gW9YrOtBXcscY/ptI8eaJ/3ypux1dtqISMLzMm90AYn1 G1ym7kRdaN2x2jKRXaerghuC2Xve82g4doBk9KfCfskUdBgEX/C/t2Tr2kFDF7mNhf0n v1G8IpUSA51LVJBmEjs2B7fBoa9jy8kDjxijPJTUn3P1HpzQwVzuy2mAErIBUcTHjGQD 0OVfhssmpWwVJyYdO7vWQ8RWZqJsz5+jjRNppEySBkASsLfaqGSsS2QpcNXuoPH3BHX8 muZcumY5rBtyRrRNF0Mg/BctBSQ6dGGY39XgAoV+VJLd9uwR4t5cl7V9X+DDOSD+F6cJ qWIg== 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=oa78ZQVjjd6OidWxK4NbvQA9CQAA81G2wzTBGwsWkh4=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=FWFUaTAEGqPzqADKqA32eZEaTYhJWjX3RdIOGQDPKVj40jIuZBZcWkBF44N1vR80yY BFqRfa5vOjxO/PgrLjyhKwDToHD1LLMLiTp2eOaTio7vtjCJSwO7qxQu29K6mMt9RQtC O0lM0jCk7h8xqPAQAyBVtmu1/nh4yH4Rz+PTde11Aj+gTMLI22nRnm4QDEdiV1QAEfuK O6rhwIkbOqmIyk2xlRKLUgeKC9HRo8rr2PgEpuSNYqLOx9cVZ6Pvl/Sk64AQwj+o+t8L fmwryAnjIvfpGwyI4n8HxDBGK4Qrx1ud6mGo97oqP24PlTpcDv23+ltLVFkq4Pc6xU5K Rpmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFkp7KS1; 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 m9-20020a654389000000b00565fb7714a5si17960319pgp.800.2023.09.28.04.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:13 -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=aFkp7KS1; 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 C88948562971; Thu, 28 Sep 2023 04:08:13 -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 S232390AbjI1LHl (ORCPT + 21 others); Thu, 28 Sep 2023 07:07:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232327AbjI1LFw (ORCPT ); Thu, 28 Sep 2023 07:05:52 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF9E71719; Thu, 28 Sep 2023 04:05:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9D6BC433CC; Thu, 28 Sep 2023 11:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899100; bh=o/qo3CrzMmkLPvPpAAGO/0Dnli2+rjIlheR89soL8dY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aFkp7KS1saMawsxU7dNgzftiDxydL6FnD5UtpsQeKyRaLj93a/GTEfNuYvXZGxLUa y2h2Bgf0bkIPU+vGWI4HOI85Lijq4bblTdLW7b9PYqMOF+cKCk1b7gvN+DgQN24Cnf bMu06kRr/FRbStBoa15L4rxELzL+PMWd2y7PtXdnTt+hDSIAYuicY4XkzALqO2wdbh TI9vzINDVMgZpZvxTENx6ltIGnkfZfLpux6RaSDHZ5D1UyfJGcn6s2b98MUamUARa3 DU4l2kQ1FO+ZnJFb/pKoGuLouI2Gl1XVI8hL3oKqH0yZOCzfLoSGPf11nKQ6h/Fh8n iPTRFU7dSce4Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 40/87] fs/hfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:49 -0400 Message-ID: <20230928110413.33032-39-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:08:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280052077618189 X-GMAIL-MSGID: 1778280052077618189 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 Thu Sep 28 11:02: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: 145964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230490vqu; Thu, 28 Sep 2023 04:14:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IESZxkZHQtS6I+u4U5C+BPNzUrFGXJ8b7lgOqgmdpYtHSWpOtXgAfcT1To5E8I9Dw6nlwrm X-Received: by 2002:a05:6358:8a2:b0:135:acfd:8786 with SMTP id m34-20020a05635808a200b00135acfd8786mr1015519rwj.3.1695899663210; Thu, 28 Sep 2023 04:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899663; cv=none; d=google.com; s=arc-20160816; b=oMxcI05eNVLt7Vx1s6MP4Pv7PeRCFUg2OczSGDwvPvwAAXH/ls+ieu5RXJiwF3JCiE hKx8UYns0WESkuC9shjcWBiydsYh2FdaIiEdMlTm23WbnfePXRCFC7bInio2dQY4wFCS SgznGbg9mSx3XGeh3k4odTDg6R6CzqAV4tpk1Us78AIGMBCDjWDBpb5yA2VtSg4dulmt ARZqSpzSnt6BAvbMLXB5+TntTYmh1GUhkrSzVx3h4X60sxiDkzq9E8/IPqdNa0ianWpm DCu+rzLm0MYe4pGmW6SgLMAfzifRPKAEOCU7/6TDjnUGYufjkLK14HTF1dmaQ2yR2TyA PBSg== 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=0Mzt5ivVnczcqFrN3ysdIFhOGMxLNxVsPZGM1Rm7rnY=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=NW0G1cgCwYArVFo3/Ad5VwAi85TLfIbFg2E6au7DxE8g3WuXDFFOnMuslce3LnLhTF yBCi5n/BiPKVzpY1FsOm84l44BP/Z2VaWhY4V+6+cPCtKVAIonNWh8C6dFbRXt45oXUX mCZxcBW9e26JnqU6tzbRvQ+C55Og+cOKWiyfIJTir+xEv/lZjGMZCck3hCgVOufXc0If IjlvPDHFE+oQUUEZ9IHQ7eeyGNFYBy1/lKpzKwgOazG7o3YNX5XLfbzLCNQr6pfIbyN3 klF1sPispzHr2nYGJufnscVr+0T/kLVumYWFakfh3Tul0lxz9O07aWr/HUMmRIDE3Z62 LIOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nn/70ym7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u11-20020a6540cb000000b0057ba6bcc15asi17815510pgp.94.2023.09.28.04.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:14:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="nn/70ym7"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id BEE75836D62B; Thu, 28 Sep 2023 04:09:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232345AbjI1LHy (ORCPT + 21 others); Thu, 28 Sep 2023 07:07:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232334AbjI1LF4 (ORCPT ); Thu, 28 Sep 2023 07:05:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04867CFC; Thu, 28 Sep 2023 04:05:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12FAFC433C9; Thu, 28 Sep 2023 11:05:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899101; bh=jPaiODyJxN2QzeFOZJobDDWESQpGGRqwzZASAz/9/mk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nn/70ym7nulJ4nduT731NG+8lIaoTY34EXcKXsCX1R0YReJu9DF4vUG/6VO91BzRL MlrrezFtaa/bdOAIkx3Umpz0x8gdS//I6IlfLBMGz6WSLYxs2sp0oGcp8tbYLRekyl tWwRHWpiDeqJC5sMcnKiuCrN98OqyRaQqMCNDvfrZrIgIhunC9VeW2fA6Dm9Iayn9b aYxkrEXKBNRLZX8Sj6Scl9IzfAia0Wm66wRxqjy32HrWVy/o0SbRbdi9o5LlHNyIiP hw5mqyWFrs4BsIAElKZ88KGisDRVqMKs0cTOyaqRQC1+lKtepzN/cBEC3/cts098sS mYc6JOH4LpDDQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 41/87] fs/hfsplus: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:50 -0400 Message-ID: <20230928110413.33032-40-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:09:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279685015083232 X-GMAIL-MSGID: 1778279685015083232 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 Thu Sep 28 11:02: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: 145959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230074vqu; Thu, 28 Sep 2023 04:13:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBYULMJEYZMe2UaMfrR1bWnKPRQqP3n3Mjt20VtMaf8e/EfFoOfQkfsnxat/YoyhH1ml28 X-Received: by 2002:a05:6870:219b:b0:1b0:60ff:b73f with SMTP id l27-20020a056870219b00b001b060ffb73fmr937637oae.8.1695899618062; Thu, 28 Sep 2023 04:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899618; cv=none; d=google.com; s=arc-20160816; b=czpFocPOiIG44qHxsbbhSA6uncQiRUevDO6sRqCSENloiP0p+Zyfz5KBWyNcX4V92A JbDuOCfyeeVyBEHIBaaKF6lmO/ahS3FZb2DRRwIv65ZrC2gCMW2ChkWamwdOmIz2+h0G DHQKKMTfLFLlXHM1q+E234vfVCKVW32Q/wgGvbIWxAL1Rn0Mgi1H5StApjbsq8F1nQXa Uzjh1ehidR4FTmrOL5num+UwzdukOTQdBXXy2cNwiCrasNzg0HqNLq9DI04YUaZF7CLz ZvuNpjvZCgq5UWzQHPUNuA2bPs7+A48NOlX50lZUohV2wLvss6Gy+k3lLl6jfYugohiS LQfA== 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=zwfti0XbvS64PXykdGN51/D6h5+OK/O+TJQOcQu4e2k=; fh=70aaKBzl/J7Fv9lk1MDJ485OMLrwSYhU+Uf1I70AYak=; b=qWub6nNzfrCJ9Rox7hQe9SPCBnaWtlOCLLrf4obpxBxDpIp9PFpm8aU+5Czzeeg6P3 3DXLhPFCus+E7WLUGgw4x9zPjrrv8d4WTQsrFaW3Bn33skFJUrW1r7T6T3svRudFSGhW DHK/0NBzg8RrPEh+brdnyC7K8dnxYUy7jZgM/fZ6cwZfSJ1ZipASh38H5jHWoJQfsqku hSv9MndTQt6Ji8vDFw0y6iGzUo+U28zVOFuJusjbf40bQ+yuLADUR/DZYU9XWO23IDI5 V+PldYZi+F0LtHr2tkw7w+CyB5IOVJmPVmooMgBOIFzEzmoo35/Bf10xtKYPWl/25PYg J/XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L5QgKS9W; 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 63-20020a630142000000b00578a98c0687si19145803pgb.99.2023.09.28.04.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:13:38 -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=L5QgKS9W; 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 7B1A4823B3C8; Thu, 28 Sep 2023 04:10:46 -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 S232030AbjI1LH4 (ORCPT + 21 others); Thu, 28 Sep 2023 07:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232148AbjI1LF4 (ORCPT ); Thu, 28 Sep 2023 07:05:56 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A9B510C4; Thu, 28 Sep 2023 04:05:03 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F72EC433C8; Thu, 28 Sep 2023 11:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899102; bh=SmTKj23nuBjnbVRWTNodKzI7DTaJuxdAze07oBOhrrI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L5QgKS9W7u596mXt8KF2kGCF40fQKt3AAdokcCeWA/jCXHC6cCL3EiH0HTC6hpVNh jg/9vxbojQzwyPjMI+uWdIktjRu5n4c9p4vp3127MYw2QK/BxQrQFzOjqgr8+eOLyP qDmXAX8zaxb22aHsML8eUME9AI49KprABJli7zFNSYyM6kQyEMUiYJ2LQDxxRbFzBd GUUs3SaFGffhXSR05lYBiXnt1RX1Ub0tcCi6Gr/RANngVZhKHaYJxbT1rNiq/zO5L2 thx2c6ofSj2cpUam7Eckec2ZknPAVVU7bKgpxcvifXGifxRY1xgkkkMWB3be1PtxRC CDo8DKQZwTJxg== 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 42/87] fs/hostfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:51 -0400 Message-ID: <20230928110413.33032-41-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:10:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279637822123852 X-GMAIL-MSGID: 1778279637822123852 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 Thu Sep 28 11:02: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: 145967 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3231479vqu; Thu, 28 Sep 2023 04:16:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZAgqsp4lxy2DDZsojXhtFmVTeJKItAPS9dFPQeVoAVURaO4NJ5peaKCgBTgn4c9sgATt5 X-Received: by 2002:a05:6a21:33a2:b0:15d:c86d:27a6 with SMTP id yy34-20020a056a2133a200b0015dc86d27a6mr944965pzb.55.1695899766630; Thu, 28 Sep 2023 04:16:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899766; cv=none; d=google.com; s=arc-20160816; b=nsF9sjKbADQ1FZlynYK3SP7HCvG6n7jCVJcfie1brS3dnr/1ilgiv92pjDUz89dSLs dW61jqOZBHJqT7kjgH8wdSVmKJu1HrHy7+lYKNrEzBkg85wVQImQUBaq2q9MsdUfAPXg UhADC6JNa8Go9mryx1/IXMIebFQ6thCkyVeD5rk3JidMOVjd/gPdnKnxqTUTMp7CzzKM bzPM08h3h4UUMGXRC9IVQLVisQRd45A46t0RVNeuxG7Vl/O0zg+29VYf7ZA9XGLmPg9b ifjTIpA9M0UjLCTwQQkvSsLWYiJAPe5DWylzyZJz8jnI88TY8unqoCQkkBIZmr/grPki JN5Q== 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=izVXUyf5sBl+pc5bJHdKZB+cFZMdQ8QAWm8IuLh3ZwM=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=Cd/g/8tVwdVaoTElrRiAFBQetptmfecPnn1X875Tf7q+Fk6YgiezkDnKDLmPvS8Vhd YYR/XfIL8DSOI4C/CGzNpKB2I1Fe3+hpDRttdxcFrxrqIE9k2xudQVY7exOlXpxjKbA+ vFKFRMSFsYD5RwUOFqu17MYBUjziG8Uoc6Yfnwp3VnAO0HOL2lhz8ma0Q3Ri9wvud/Of lhdCK/5c6lveSNPRe73QATQXLfTp74VV8sf6IyL1jleRTe71euNbWqacEy5qrTjEMbHn JWTi94ZSbQciLjTUvnknNbOYlkiGks4b7V/DVZxAS/DvDrB23KGTvR4Y/QIRBaujwSwT I3qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SKXMQugz; 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 z17-20020a170903019100b001c612f42c78si12704488plg.513.2023.09.28.04.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:16:06 -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=SKXMQugz; 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 256CD8089847; Thu, 28 Sep 2023 04:11:09 -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 S232364AbjI1LIC (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232361AbjI1LGK (ORCPT ); Thu, 28 Sep 2023 07:06:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A3F11727; Thu, 28 Sep 2023 04:05:04 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 694DAC433CD; Thu, 28 Sep 2023 11:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899103; bh=9p+Br4Qd8T4+Podol5H0ddnyh0NUsxCG78yEaBv/aCU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SKXMQugzM+D+mRVDXdaaH5awFcy+VARhB9zdL/d8ZdPSjYyiV6bYnMImj4D+4wuHE JqcF92jLtBRSEor7bH14s9InP+3qNIiMhRePPnQeN6wW63lSBwb2GakCUEDsAIMp0+ JXe6iZHDAHCz7TVZYdVxCoB98udF1JypUBd2YYnEcqNOBNGj9EMAbR6fOVjcEkwa5R mNPCkKWfSHlR/GlC6vkMWviE/96Zojzv3jk3axz9eKBKZs5ruaRqHJZbgPWxGUGubL KDAOXcuMP12Ge4idbDVN3zHFal+vR8hdBjjO0g/D+Jjuhg0fgBHIjOlQJH2YG6iLaQ XEydXPV2QRP8g== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 43/87] fs/hpfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:52 -0400 Message-ID: <20230928110413.33032-42-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:11:09 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279793476611789 X-GMAIL-MSGID: 1778279793476611789 Signed-off-by: Jeff Layton --- fs/hpfs/dir.c | 10 ++++++---- fs/hpfs/inode.c | 12 ++++++------ fs/hpfs/namei.c | 20 ++++++++++---------- fs/hpfs/super.c | 10 ++++++---- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index f36566d61215..bd6ca49742d2 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -281,10 +281,12 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned in 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..b04e2d3d15f7 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,8 +230,8 @@ 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->write_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_mtime(i).tv_sec)); + de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_atime(i).tv_sec)); de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_ctime(i).tv_sec)); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(hpfs_inode->i_ea_size); @@ -240,8 +240,8 @@ 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->write_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_mtime(i).tv_sec)); + de->read_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_atime(i).tv_sec)); de->creation_date = cpu_to_le32(gmt_to_local(i->i_sb, inode_get_ctime(i).tv_sec)); de->read_only = !(i->i_mode & 0222); de->ea_size = cpu_to_le32(/*hpfs_inode->i_ea_size*/0); diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index f4eb8d6f5989..20f67da1cb20 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 && + if (t == inode_get_mtime(dir).tv_sec && t == inode_get_ctime(dir).tv_sec) 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 Thu Sep 28 11:02: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: 145966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3231345vqu; Thu, 28 Sep 2023 04:15:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHt+dc1k3gz3DeBeS1+ND7Upp5bGyVNUCnGK6TM1MQzEgScFC5+v+Q+JFqg+RbtyKwiije+ X-Received: by 2002:a9d:6246:0:b0:6c4:ac5b:1f83 with SMTP id i6-20020a9d6246000000b006c4ac5b1f83mr962999otk.2.1695899749861; Thu, 28 Sep 2023 04:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899749; cv=none; d=google.com; s=arc-20160816; b=IHk3qVpi9tL+Wf7+VOJL3VP2snOOdnnwqe1VWfIs9LROmPAiA9ZwKIDXt4cn5mJ8w8 LDBDTaejHdtFD9btYxwYEh7lcMPDDrjgblNemoNFH6m3MzRL+nhzSUbSEX1JlBAtmJ6k c41rjM4TKRih23Bkk25n/bU1U1GcKmSu/i8Jo0D6eS7aqg8ZS7f3BNwI2yGtHB+781JO isWAd6P9dkm5fiNmR8O3Guc4I9BxK2XLJJvL+eNll9v0IqN+7E3BlnHATAmePlvQzr6h D+K/yJ3wNqOGs1kDYjM4ShUjlcskC8Nru+HeQ0hVdHvpVvP71pndUI/1Rf+G2mTrLoC8 Y6Zg== 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=mv8IuoczD8+D4W/8RWeO9KR6l1WixCMirVn7db+ONRs=; fh=YcvKTfjdELTIgtVvxDx+GI7Jag3KQiPyLLfYV96J/gA=; b=FJOtP1ht9m/tT8g28tG5rEIT+Rf9DQdYKJOx7wfhv6cxAqHVx3hLQi71pGUjn4B+L+ neW77HyjMwCay4/EkodEEF+PQtSGU+A86uYqDtmnFXeOCHlrzxZd0PHxho12x5ru8xWW sX9jXgaVMzETEChY6joVx/D97H3+2bLmJ9UjRlkadPJk+tTYR+QqVsk7AW5W9O8xGtSM y59Bx8xBeysqx5lgWYT/QX8gRM2PBqBGYcGtCTLsy45mP3Vrk9hKBtfQIOfDP6umwghm awC0qQJfr3FctUIuDBm0J3n/SyNmeC5gLq+iBKfO/VbJb+N+deqpcsNH0bsPkWXOy3RW GOow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Lk6lU76r; 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 ck7-20020a056a00328700b0068fb8fa1e71si11633515pfb.207.2023.09.28.04.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:15:49 -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=Lk6lU76r; 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 F41C0823B3D0; Thu, 28 Sep 2023 04:10:50 -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 S232442AbjI1LIA (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232214AbjI1LGJ (ORCPT ); Thu, 28 Sep 2023 07:06:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 280C7172C; Thu, 28 Sep 2023 04:05:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66E2DC433C7; Thu, 28 Sep 2023 11:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899104; bh=WdhKVeDvEbKnuqVE8JioBf7/XuFh9c0DQ7/RiYq45FU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lk6lU76rtis34gPcawFKYvC3t92lkvckjaFjUIluPI3HFE3OLVD5JnhI3R/rVMN7r F8czyTGJsP3qg3qvVwQLSTHLuSyrC0haq2UAKJra1gJAoQFpr99CN3v3mhZ6xsognJ yozcfjf26Nea0TfCxH8Vc/BNVQHQBJKESwH+U2q01uSM0hBTcrS7QUbw9WTVPm8yuG ex+WxCbn/K5N0oH3t1IZtrwihqdPcZRS3iWr07rRton6NuqSfucu3Sy2htGrrOwNpi x6tTG961YMV7gvUwsQo6MW1Xu0Ba7256DKzhqrfuFgVIH9idX1Q+JtwAwtDVxbGYs3 j5W14p/tJlYsg== 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 44/87] fs/hugetlbfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:53 -0400 Message-ID: <20230928110413.33032-43-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:10:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279775820489388 X-GMAIL-MSGID: 1778279775820489388 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 316c4cebd3f3..da217eaba102 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -980,7 +980,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) */ @@ -1024,7 +1024,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) { @@ -1067,7 +1067,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; @@ -1099,7 +1099,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); } @@ -1121,7 +1121,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 Thu Sep 28 11:02: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: 146036 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3245021vqu; Thu, 28 Sep 2023 04:41:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGntxbEHtsVWbMgq7Kn1nfQBNEU6vwmgW0ZqJmVuUUYO0ftRrSTQ4LnxwhCqRn88yxIG/Ab X-Received: by 2002:a05:6358:52c4:b0:134:c8cb:6a00 with SMTP id z4-20020a05635852c400b00134c8cb6a00mr1019310rwz.12.1695901306768; Thu, 28 Sep 2023 04:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695901306; cv=none; d=google.com; s=arc-20160816; b=I1m2Q7YpLaGvtrh583bTj9FbdBadxpbrCLWl0cNvVPcbmJsl2KXScMzNhsPzbAfMhm vI3zzvJRSrI30cRBpAqcGLCZkXCG1MEUXzyn7nHkBLAGOcEeGw3DGNfAmrYUkO5lOZTw f9qvG8AXuzq0zLCaIEiYi1PTc4M4sbug9rxuadgM7HySuP3TaB7sijCuHYP46NAZHQ/y 0CdbOvQIdv/jL2sqbxhREhr1fYevbOrJ8cuWQpLzRn2+Kh1lJi5UNbrqZqqN1LZbC2/b MIJSx7hG9cfeYRe3opeRiXmn0KTAxQH1oAm251yJxskDpzHam8tcn2pK1pA4Gu7pFQJU GZng== 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=dcQ9ttg6P0pVAZXxAu8mE3T+DL7oDbpJIDrYy5zVlpw=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=k/lGGcTCBAE6jeyh3Oh0sMnG8EYNiG0llJLR8Ai39QzzUluEV1yedN2bVRicfOevzV ZKRR5oKMomA4/cgPIVKkQJpSAB3CRpThuJ0UNkbTb/pb907eKziKCBZMw7VJU0qYJ0ly BFdJr34SDCFqXyf60OhRTbmnng7/VNlyvLA4+2gFsNypGc5QCbRaRRYVDwWcKRJNCU3m ATBf0wTsOIAKUfNvwcK8V3fCJdHh+FZVj6Pcv7bxwhoNbcyWXAsrl62vS+XmeZwHkb6C UYhTRVmSYaPr+QjYkjUD0zoRGN+thISgew+dohTlmts5hDK8GGWDsQVYaFNJmz8DVl3F NAMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UmaYDdyK; 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 bv9-20020a632e09000000b00578b93b1b26si18281156pgb.544.2023.09.28.04.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:41:46 -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=UmaYDdyK; 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 A9D51833235B; Thu, 28 Sep 2023 04:08:57 -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 S232456AbjI1LIF (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232367AbjI1LGK (ORCPT ); Thu, 28 Sep 2023 07:06:10 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A32510C6; Thu, 28 Sep 2023 04:05:06 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91F15C433CC; Thu, 28 Sep 2023 11:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899106; bh=jyTlbEqdJh2wB+IlPAIFORUE7JGCL8t/h9lCWdSm0d0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UmaYDdyKFky7AbFnDrBvPRtpuLXmR6/0ne5F6HJX53ShWjgLL4j+fcSnoLviuweSE VEnqF+nDQ379HtLpub5tJfg0gKtgCgLAQhhdZYj6yaULpma+dEf/JYuBprQ9tFnNCv R4IvCRSDPNc+IKFNM3I/gZc/UYaTa3esk7Anw/w89i4puGUDMt6yODzUWtAFgnNBI7 jtoX4TQrRx2hSBHu1vqKI8s2/d5DINsnaw8wiKwI9ljkkSRHOA1huVeZAx4h1qazc/ wrz1nexVR2R4hJYQHQ9T55uq+u/bcjkBuY1ehu8vFuXEX+3SHZmStqr1G4c0GY8lai rhHj9Guqh0uQg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 45/87] fs/isofs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:54 -0400 Message-ID: <20230928110413.33032-44-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:08:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281408298731142 X-GMAIL-MSGID: 1778281408298731142 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 Thu Sep 28 11:02: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: 145993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233754vqu; Thu, 28 Sep 2023 04:20:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF8WC3mXMcvZgbIJvbMImfFIdFkrb554EIr6UKqr0GN3RSFRcTVgckRwWvpDIJ3HgCMNjQr X-Received: by 2002:a05:6a00:1996:b0:68f:c261:ddfe with SMTP id d22-20020a056a00199600b0068fc261ddfemr795239pfl.28.1695900015402; Thu, 28 Sep 2023 04:20:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900015; cv=none; d=google.com; s=arc-20160816; b=hrJhAhd19iN6y4ok+bv3k76/YCoHtd3l3wtmmFuN8cEzvIjYsiyU6d8fT0hQ5hIdNU 6n06gDlzr8G8Y26vs5xnt6lsb9g98d3ETgQogKv0d+xbvxwa5gi5YqGNENSCPBpW0/bM 1J3v9D/zAoNv/UszPVm4bkGpZI+29gLqsrO6lIQljlNqQGvfFdx3bxgwp7YDeJiHUwQa 14HbLX0ZM4pbLJ+gl47HZr0NlaEYhixNT3ozzO840J8ujpRRd1QIJgSRap/uUKEYu79D 5c9bvmuBpNsidAE5Xyeg2pycG5KGHKafEAsBbo44SymSNhvJA/8xu7ZEpHMMDuePzWsd ew/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=mXo8Kvi8940ZRdXPR1/lOasOPAzNLyOKt0sWFZsmkSg=; fh=9dbp+PVfJHvhQ2T/xAbsquROFmtfn3Q6xzmielwCmS0=; b=dYgBKofY0tGG5skmBzfOuGJhN7jG6mi4mM+pcjtvtosalktkgjVyGLhGjruuJsvQpj iBV/1qKRANWezK9pvzR4KIOSM7Ki7/uKohBUHHf65AwjYwqB3VRPWh8GV1aVGjpq+yip Nm6+SFT2G+eMkMq9x/l/PllDzDHH0DuW4Da6SL7OSaeL2+Jk9af1uTadTKS0KGIp3+hv VqlvhNnDcAI9yUbtDt94A2sJ+ECb2/Ud15Ark+XB7wAGn767R2DXdYeGI565H4XbrJf4 WVpPBJi4+7t1ba8oQwqAdk2pY42CUgajjfVLrQ4RRgD8MyxKCBMrsXHyA2EoJSVF26Kx Bo/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lRPGkEbL; 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 t23-20020a656097000000b00578daf88066si11717886pgu.215.2023.09.28.04.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:15 -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=lRPGkEbL; 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 035FB857E562; Thu, 28 Sep 2023 04:08: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 S232401AbjI1LII (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232383AbjI1LG1 (ORCPT ); Thu, 28 Sep 2023 07:06:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCB61737; Thu, 28 Sep 2023 04:05:07 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEE9BC433C7; Thu, 28 Sep 2023 11:05:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899107; bh=H0o2l6yZgbuV+AHtD4UZSzh1xRcgDyq1popfRqn5BpY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lRPGkEbLGP0ZilgxwHKoK5aa3Diu6rGwzQIj4aLFkIQjfUt+EgtEy1nJXYP/627YU ICEyhlyn0yeIxNQphxQSK88BktMCjTMQAg2uX0JZS4eeWeIuKYUOzW6rI77YSgVm9Y Jxl0oMN+olO4Gr3qaW+oMVTT/vUEumTwP96IeqGlhkdyQTYdlXrxwMCqPc7wgXFTMF 3IDKvaFuLOaICQho3lWkxJjsy81ss0wr6kOIOmzgllwv/h4OkF5m0tEFC8MVMQiWDb RqCfzmWaH2s6A7gTKcfqTsFrtHS7SCH0wKnJ8kl/DJJ65E6MAnHSt5dne/AUwqfNSX eeEf4W3OXyuBQ== 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 46/87] fs/jffs2: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:55 -0400 Message-ID: <20230928110413.33032-45-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:08:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280054762099702 X-GMAIL-MSGID: 1778280054762099702 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 Thu Sep 28 11:02: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: 145995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233801vqu; Thu, 28 Sep 2023 04:20:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdFnZJif0xWB4mJPOLLusm8frPzcwceNHnY6RZKqEDPgrqSWQ6q/GBb7P9QYgael4ZJFpV X-Received: by 2002:a05:6870:b61c:b0:1dc:8136:e5f7 with SMTP id cm28-20020a056870b61c00b001dc8136e5f7mr890114oab.48.1695900020128; Thu, 28 Sep 2023 04:20:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900020; cv=none; d=google.com; s=arc-20160816; b=OFoy2/YbATL5nDW9kouTxEhg7nEs4HR4HFV3559udbN8dkiU48Gob7FmSpFSB8mcQd HErtasp3mgY9cACaTsaIsI+bfrv26g73aRaA+I1C4vB9+2UWGwDouE8aZRFwPFMKYgzl 11UHHjFxxQcCLqmMX2OBf5KoXLtofCUHva9IaifzeaCEI0wx71aSnsc6WVojxe9bnSIF DjVbHxH+jG8haO3WvypYCdvXdMmQCHMEp3qkb8viXysk587gM3zt0PxrLAtbCTakdNYC n1nH8S7zlwqmzBi3JZphG+/3xylYnv+9WdjIbAj5OFcwdWMweJmjIIt2M/bvYK0YSoyw aN8A== 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=aOXdlO7zUNuPwvNdZjvrcIANVZNNRDakN4zQ10Wbmz8=; fh=BSEuVOHY1c2b13fb82ePhcbJTb9kmvWba+MflG2cHXU=; b=IOw+hcOuOuANmHVkWYDZAN0XsUOb3d1MeUYrTmx9fvPQBHAlFGDqs3ZMzrj6p325HJ Vqc1W6MU+4ozC3hGxpAW8ivjFEC9me9n+3fDW2oEjYOwNPgXRj0nFGZJYe7jZNpzWclU ieGb3NEiNfFUcu0zvANalX8RCYkvcl1LC7WuQqmLSuFNb+pTvEn0PS9WPll09JEr/al7 bjgYPxlEFpBbn+7JCwCXQw0awbk65GUS8vs2XiNRJao6PAjV/IDBjd/+420tej3bjUkS qBc9J7FCuIFO/cpTpFDn33c7ssPVKnt+uKme1EvSKBIvw10GqFnmRUmVAiYdoss7ou4L XLqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="l735/9y5"; 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 142-20020a630294000000b00578b6e32b5dsi18186608pgc.405.2023.09.28.04.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:20 -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="l735/9y5"; 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 EFA26858275E; Thu, 28 Sep 2023 04:08: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 S232266AbjI1LIY (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232378AbjI1LGx (ORCPT ); Thu, 28 Sep 2023 07:06:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B1421984; Thu, 28 Sep 2023 04:05:09 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54AFFC433D9; Thu, 28 Sep 2023 11:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899108; bh=AzqoCI0uYgwnl05IQC3qhfVNYEL6L82XH+DqJXqpg54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l735/9y5uwND3gPWJ5Jp7cOd6ZX5BWE3kVQFltxeho/0caKZQMuMwnvK9sMKpfoXQ EmVwDBHaP8nRJ7gp1CZZ+nPiREemKJuiG+w9q8YJ60hf6LFbQuvCneCQQSYI6MbngL JdxbrQpm581NyNePilDhjqY7HoQTJHgyqSjE0YHz5YUhS0B4Q6wHpwwNGXwqcQ8k0o THp/s76N9+AjQdybzz9JyUUFoe0WcGjc7gsZSWecoG4oAhgRJlVfZa1HxxLQQ914cG UQyEQVifav/IuEZk9Pj+56cIzfKzEv5VIrsjftphwpOhEgNaCJMBIhth0haa3TwmZP RTL8/XCXHDGYg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jfs-discussion@lists.sourceforge.net Subject: [PATCH 47/87] fs/jfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:56 -0400 Message-ID: <20230928110413.33032-46-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280059246611237 X-GMAIL-MSGID: 1778280059246611237 Signed-off-by: Jeff Layton Acked-by: Dave Kleikamp --- fs/jfs/inode.c | 2 +- fs/jfs/jfs_imap.c | 16 ++++++++-------- fs/jfs/jfs_inode.c | 2 +- fs/jfs/namei.c | 20 +++++++++++--------- fs/jfs/super.c | 2 +- 5 files changed, 22 insertions(+), 20 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..57852a515660 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_atime.tv_sec = cpu_to_le32(inode_get_atime(ip).tv_sec); + dip->di_atime.tv_nsec = cpu_to_le32(inode_get_atime(ip).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_mtime.tv_sec = cpu_to_le32(inode_get_mtime(ip).tv_sec); + dip->di_mtime.tv_nsec = cpu_to_le32(inode_get_mtime(ip).tv_nsec); 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..9137e5d96db8 100644 --- a/fs/jfs/jfs_inode.c +++ b/fs/jfs/jfs_inode.c @@ -97,7 +97,7 @@ 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); + simple_inode_init_ts(inode); jfs_inode->otime = inode_get_ctime(inode).tv_sec; inode->i_generation = JFS_SBI(sb)->gengen++; 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 Thu Sep 28 11:02: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: 145991 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233731vqu; Thu, 28 Sep 2023 04:20:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQdYGfdp1vEswH9o0NThzdHYkoLLw/7jbz4SmC9Llyd103XeE8RIRCZCGQJ0nGuqUn8bxb X-Received: by 2002:a54:4711:0:b0:3af:6595:e53 with SMTP id k17-20020a544711000000b003af65950e53mr929000oik.13.1695900013116; Thu, 28 Sep 2023 04:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900013; cv=none; d=google.com; s=arc-20160816; b=OR77KGdan3FyKIpOhXwdLwPZi0ouIKXhWUYTaauY/b42VBwMB+F3kBLUQphygKV/6I zgqaDHVIYS17O+9oe/aND5vcyWfneFRwczCshIy6LQvAGOlNwnZEEMgT/i+LbTwMeroH 0FJ3B9zaXCr8HhgJ+OwpoA6w58FHt1EXftPsKalV1mc9Gn/vnduU6CjD0idOR1BZe6pL dezpNCBhsMEzhH1Gr2Cj46eF2KYjFLGdGBu3e+L82tx4RKJhc/z7dqYB5uCxC+1ucyFj tdRb/MstVFJH780PpLoDbq1VM4oU/RXjs0b36w5OJBSiw34ZmDl7w3N97j6QpwHnI3TQ 2d3g== 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=vwEVOzoBZse/Gg9Jhuit3E6jU2I5Svcd91Z9XqH3laE=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=zAClrGBgR7maqklBYqd2tRBI0bz2DVcuvccqT7bDHtOk5ZM9jEbfgfss+Z5tBzzN41 6CspMYkXLkQM+FVQ61+2TwRjIOMJPuFSipIEOuQPYngj/A0o+g1EYyfluAWXIW1DNkMj DCKUX1zC/Sk8gj458z/k9BJhAAMTgijLmPA4XB+RMgHP+o8RvcxYQWIsdE8fJYrO1qzR kJOp4NHGRnRbzfL6FRWpGMGYgUAexVc2Bta3ISQt+Q+8KKNS5nqcVMIa8aQQ6aZ5tgcl DWrfQmqSZ/iTJDfIBeRUwpvvhFEyfkMsEtVnPfMPdLdTGIkxcP0NaeDI7HpDRsl1a5Fq NPcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iDIHHesg; 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 s3-20020a056a0008c300b00692dfef1ebdsi13312717pfu.189.2023.09.28.04.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:13 -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=iDIHHesg; 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 EC8D9856B114; Thu, 28 Sep 2023 04:08: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 S232461AbjI1LIU (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232430AbjI1LGx (ORCPT ); Thu, 28 Sep 2023 07:06:53 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85F8C198B; Thu, 28 Sep 2023 04:05:10 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 638B5C433CD; Thu, 28 Sep 2023 11:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899109; bh=wGHG8BLVh6e2CPi1I4Lj4sfPFEY/gG6PCDAB7nwbvck=; h=From:To:Subject:Date:In-Reply-To:References:From; b=iDIHHesgkN0Utprud/ZhdXBjTWSRbOq0gj7mnBBsRENbVagC83R492BDAVPn6S9wA j9+nQcEBlIuZ0S/xXKdzsTtAoGIl8NUgT+DrlVkQJZb+xSdKw17VwZRU0o1nEWEvix nOUN8vYCHGfl54QENOKJ5OmEUpd/yE2MA38F6SnG+tYBapdQbCk8O/ZZWzKlhtUG+b q/DR5Pck2Ri+h55tKSxkYSOZWX5/lFSAzuIakCMG2kYRgdccFMeNs267KUG0nAmR3q OnSjwqRYLF4iUnWEFen1fAvgLAgYdjRcuk66Y8wD/RcEw6tlOE9qRTlaCjaUpASaLh mGacv3mwQTGLg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 48/87] fs/kernfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:57 -0400 Message-ID: <20230928110413.33032-47-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:08:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280052526308808 X-GMAIL-MSGID: 1778280052526308808 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 Thu Sep 28 11:02: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: 145958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3230007vqu; Thu, 28 Sep 2023 04:13:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqpm5CS+DQqCaAh9ZKqJL+pIeBj8NT0xT3tFTWpzNk106TqDhgEDdzZBWR5u8x4yV9LEwp X-Received: by 2002:a05:6358:724f:b0:143:5d3f:f397 with SMTP id i15-20020a056358724f00b001435d3ff397mr1313823rwa.16.1695899610160; Thu, 28 Sep 2023 04:13:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899610; cv=none; d=google.com; s=arc-20160816; b=Jw0gofWYYFYcdTvdO+++mtK85JqLl76VuXn56iXa2bRqwD45GODAsl4HTkW1oXH7t6 8xkUt3a3niTrMyRyOTJfwoBIOAqUzCiWoar2XEHhsk9A4jAcgUZ7wFDM4kqk8GxgDFHh bI8CE0jOgzWlbXXBRFfFwJX5crBgF1jpi1fbOisluDyt9FprqOjNBwVuvOxuhORVhgw5 Bc97OZ4wSpvgzxxIZ1m/AIK6mwf89XnRXkeeWngH25RJvqLEwlUmy8rCVVSu0X7BDKCr A4Z3xF1hB0jkeYISUUMu6fsmuvAg8o8VDe8Q19a+IQmV6l86P1rNt+/8qgyJtC+VgD+y t7eA== 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=aVsZ/2Jvr8+7bydTHC7IP4+vcFRBfmV1XHUi4LPfUmY=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=FbZjby0xTRcLqd+RXqx+ZzqVmUZktvLAUW51eQX6HSBkzj92bUhEawQ3AZPLgu0cZE jtu2yL8+zXaFEdzrIahHmWrDZNWDEk0IiX+tHn/zxl+nF+LEjjYoYMiSGAK+LPlK5oKL N9qXd1LW//ZeF+TC+oANsiLQu+qlsFjtQsmDqiEJ9PHzZa6I9HDBZhAQi4SZN0fnPrJo OIJ7ruisrJwrGh1gSqJDhbFQ6NEvEZ+ouCX9WU38GJZO640dTFcMMn060HJSgL3rEvpC aj8EVyZY8H8qm+6ZSU3w1H6z6jko5GrNhPvYL6oH9g5h17Eog0sr9ZkCdVAVA7DyHur4 /RRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fOlQpwFX; 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 cq10-20020a056a00330a00b0069023afd0d1si18074317pfb.329.2023.09.28.04.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:13:30 -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=fOlQpwFX; 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 784BD8229D26; Thu, 28 Sep 2023 04:09:31 -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 S232051AbjI1LI2 (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbjI1LGz (ORCPT ); Thu, 28 Sep 2023 07:06:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE9BE1995; Thu, 28 Sep 2023 04:05:11 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A471FC433C8; Thu, 28 Sep 2023 11:05:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899111; bh=TozuuxZkQdCbjxpAkjZd4rQidqLN1czCk9GhEFGLV4E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fOlQpwFXWLM20fUeblLAHCVModVY78fPIpS3GiTgQooZCvbkU/WR4ZDjLPSFIBr3T tEfXgP67ERI3WUL1tS98Wil5FzqYU/HDXrDVbNTrn1QW1rBfsC+neuQ9Wgg7kmMgse vrzuY+ETJJm7aIY4KNYK1ffZ5M6VvtLL8C4qM1lvoH98z96n1TElmO1d8RR5rzOY4K Px9dx2A2Wl0sfDXIiT/vr7e5LqPye2OApeRytfn97PTYNALj3TI3QO/P/QFiZOJ1yn oPsgfCpoe4duVSSr9hYxWRX9R9g2ihJkKkHW+mPDUMlksHnuzwZDIvsCaNETBhVh/A nSQiMZQPClK2w== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 49/87] fs/minix: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:58 -0400 Message-ID: <20230928110413.33032-48-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:09:31 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279629859954487 X-GMAIL-MSGID: 1778279629859954487 Signed-off-by: Jeff Layton --- fs/minix/bitmap.c | 2 +- fs/minix/dir.c | 6 +++--- fs/minix/inode.c | 15 +++++++-------- fs/minix/itree_common.c | 2 +- 4 files changed, 12 insertions(+), 13 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..8f10abf5fc6a 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(inode).tv_sec; if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) raw_inode->i_zone[0] = old_encode_dev(inode->i_rdev); else for (i = 0; i < 9; i++) @@ -616,8 +615,8 @@ 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_mtime = inode_get_mtime(inode).tv_sec; + raw_inode->i_atime = inode_get_atime(inode).tv_sec; raw_inode->i_ctime = inode_get_ctime(inode).tv_sec; if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) raw_inode->i_zone[0] = old_encode_dev(inode->i_rdev); 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 Thu Sep 28 11:02: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: 145984 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233512vqu; Thu, 28 Sep 2023 04:19:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyKTy1uhNgboEL6VhhxT7Bbu7tbfSQnhzINNv3L/K+TER0T1suPn2MDjhprtNJFgpKaZ+h X-Received: by 2002:a17:903:41d2:b0:1bb:b226:52b1 with SMTP id u18-20020a17090341d200b001bbb22652b1mr968451ple.17.1695899992872; Thu, 28 Sep 2023 04:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899992; cv=none; d=google.com; s=arc-20160816; b=AEXsSnV3dR2D4XdOZDW+bCOprJvVwFNb65zuIGzUcfqqrK4XjNA1Y47zIFZB/M28Jw BXm4xFnmq85iVfakfNTl7Qpv1YOem1vtErSHUC3JlaawGpOVDy1E9RiMi11eFGXEyRnZ s3NEr5fQfxN6wTGhTniiCcPR/yXrBHy+ou0JyI6QkpEZO5EZuMsRXkgoncbNUjshtjDN 8Nh46Y8VxWQD67/vmCesR5dze//5U9ZWqws81pTBSQrrW1Cy/tKS92jKGTxl4DK9wU1g b3tVqjzFN+Z3DZroVRjkqpoJUL2h1VNR+c8aDtOexaULkkRzF1XYZZffn81bm3eIAoU/ spMA== 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=2lawY3EeADvPkAvNNSLm7TTRtvF9NmjeF4m0E2blnzs=; fh=qCI+HJ8TstD4v8SgD5hrnhvawRZlJViQU3F/YAS3GuE=; b=clG70uSVMASTu9EDUVzUA1HDETDrQ/ZQw+N9A+RQvDHaYMZyAJNSsdoXjKc3U78ABd 9F7tUbZKo3QKnEl2AcfZUAayUm8m9bSiLe/JpLwerD7Twd92IlqwtTd/cp2gGmgC4qLs CTdnP1xt3+rlWQ3/1DRFLGMIjJdccOEjnl1kxpaKTWzBs3nOSbmvb8C4LYN1C6iZUT1L HuX1OBVU/ATyYKmiPMkiGMrHJAMJqbWLLmanOkCIf9FVpZpHLdcTOpnDEcZ/r93ib+4e cojI2di4aaDJ9TtLkV/pgc+eezQuc0ZBEt7tqjrCaPnuMfQAbSn3YiSVPQVqQreDyobw 5loA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jGc6IZYS; 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 u7-20020a170903124700b001c724cd1125si5130980plh.203.2023.09.28.04.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19:52 -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=jGc6IZYS; 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 104708582FD9; Thu, 28 Sep 2023 04:09:04 -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 S231843AbjI1LId (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232046AbjI1LH3 (ORCPT ); Thu, 28 Sep 2023 07:07:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03CBF19A0; Thu, 28 Sep 2023 04:05:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D528CC433C9; Thu, 28 Sep 2023 11:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899112; bh=SxtrHPABulsfIbZf0RrS3wMkJgGsWIGNvlX5kwWHXrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jGc6IZYSlrFM13fw/pdZYDWmsU0wawDFuRbngjHDkQuJoE4TppFHnmJn+8XuKzj6O bNcLw1Ht6+i2kplBFIt44Ph1CN7xeke2mk+XhgK6ISe1SgPLrq+d+VCE35cXk56o40 1qyvm78pnk/N7Z8jfmv6kiFxQrF+Yz32sQeLrMXU9Y/Be8Jyuv/Z+VCzY82fFJNsOn ytAPISsp7XHUrfSfouG05rX4FmvZf/pHlQm9Eirj+xxIIxU32SD6Mmz+nyA2OWPxqQ FHH/X1riRdNoj7F51GCtnbwHiI9KHthMbXsuAWxE7QEJ2GwjIl6+M9LCxOVMoN2bB1 YgmsvitGUtsHA== 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 50/87] fs/nfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:02:59 -0400 Message-ID: <20230928110413.33032-49-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280030820553756 X-GMAIL-MSGID: 1778280030820553756 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 Thu Sep 28 11:03: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: 145996 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233840vqu; Thu, 28 Sep 2023 04:20:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzvrWhZ/FdOhIOAqLYw7qmi7RBabjfq1fpYT2nCPqFPEBuAGoqjeiaurKzIeeWuXcpVcMP X-Received: by 2002:a05:6358:9189:b0:134:f326:e819 with SMTP id j9-20020a056358918900b00134f326e819mr956362rwa.29.1695900023595; Thu, 28 Sep 2023 04:20:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900023; cv=none; d=google.com; s=arc-20160816; b=B8OBv+PwV/CGpLEH3/+TW4lzLbJSBvXrCop159jEZ35hSUX3RbaigLIHjH0U84sX/D BZuTOaQmSM5mO4prP/9DX/L2ihIoEUZs9aqjbUCJRh0jpiHYXwZAhooZq71babg1gDbe XFzCILCd46m3/hM1WcSN/ERAg3sLdT1EW9NK5iObD4evb/FgpvQ1Jo2sACQ8tv7O3BBu OyW+FuUcvdMkrraK5a/UpX1z1hn484coURHEI+TXqM+qXxwQGzRIZhljvkaRYxABKegz IHotyz5ujX2a6wD5TAUqlKykmvWenNmojE/NAY0+26piRAQJnDu84jpzDrm6Yr5R6DDd C/Ug== 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=leS0MOde2MA/h+p4fuBihAwzJ+KaaX79XH7IGoNlsko=; fh=5DM+f8QbZjQfJ9YZvXfjL+erGmfU1TzZ2/he2Dg+EUY=; b=abPhCK1Df2ZZ4xdDcvsidPKL66pzHKedfeSHr3sSbcEcl6vsCQoQHv0nEaQs289BZQ lRYG+3uPbRxDpx2v/L++lnMIxRc2jjGTjtFKnk63SYTnqSdqIjQUovnUlbmHDBtha929 kF/sFtz5fzMY2NjTy+SKWilr8HC3Gga5kEDtprRMWsbgbdBU5wrt+BZ3Cl9nqBMGZqzT iTirjJXfBqSlJbkJafI7hKUu2PMpNfwnpXPWvVNTH+LjCp0/l4l7G5qWpDmO2OoQOYcS kRcUgKNUT8nVAOrWcxD66v6c5WwEJZwH74q881r6ag6GaTNty6vbij7E7mEiOe/5SM7B gtAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WCIomNvB; 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 t64-20020a638143000000b0058572c8d5dasi3108626pgd.241.2023.09.28.04.20.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:23 -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=WCIomNvB; 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 4B12C8582FDE; Thu, 28 Sep 2023 04:09:09 -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 S232494AbjI1LIg (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232087AbjI1LH3 (ORCPT ); Thu, 28 Sep 2023 07:07:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D37F219A8; Thu, 28 Sep 2023 04:05:14 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A0FEC433C7; Thu, 28 Sep 2023 11:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899114; bh=UZbYji3vGdjWb2eeDZnDkQs3Num0C8JGBZvtY9Wk2uU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WCIomNvBbCcyXwBR2i9dwdEJRvhjHbaAVB6/bk4o7MvRbSGOoQHnF0VioXsJ5rAlU vtxNIbwERmrDajJ5WmuXfTMRZ8P4dJdSnartvY92TuO7LRXwGCoLVSobu3uiqeOAyv 89b2Hga3sKmfjAN9dQQ+KsS8D+GFH5WcAAmJyDZSJqx7Kb3Y9UUQkgWtKFfcosPq+F 7myn7E0kaFdrNP4ipOCTkKBGJV9KztNd1vE/5fQ0Cxtk37ROFNcY2rniyyfOX60Gwa iSdnJl7y/SAqrSicTS6GyL82LcH747l2XZ2fYVXoI725ETQPb8qJCRw9BmQW4Vs+Th yiJDFs9bv3ENA== 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 51/87] fs/nfsd: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:00 -0400 Message-ID: <20230928110413.33032-50-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280063205823458 X-GMAIL-MSGID: 1778280063205823458 Signed-off-by: Jeff Layton Acked-by: Chuck Lever --- fs/nfsd/blocklayout.c | 3 ++- fs/nfsd/nfs3proc.c | 4 ++-- fs/nfsd/nfs4proc.c | 8 ++++---- fs/nfsd/nfsctl.c | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 01d7fd108cf3..bdc582777738 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c @@ -119,10 +119,11 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp, { loff_t new_size = lcp->lc_last_wr + 1; struct iattr iattr = { .ia_valid = 0 }; + struct timespec64 mtime = inode_get_mtime(inode); 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 268ef57751c4..b1c90a901d3e 100644 --- a/fs/nfsd/nfs3proc.c +++ b/fs/nfsd/nfs3proc.c @@ -294,8 +294,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(d_inode(child)).tv_sec == v_mtime && + inode_get_atime(d_inode(child)).tv_sec == v_atime && d_inode(child)->i_size == 0) { break; } diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 4199ede0583c..b17309aac0d5 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(d_inode(child)).tv_sec == v_mtime && + inode_get_atime(d_inode(child)).tv_sec == 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(d_inode(child)).tv_sec == v_mtime && + inode_get_atime(d_inode(child)).tv_sec == 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 7ed02fb88a36..846559e4769b 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1132,7 +1132,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; From patchwork Thu Sep 28 11:03: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: 145994 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233771vqu; Thu, 28 Sep 2023 04:20:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpkqCygXnMuXDAc7TeC5GbJqO7LoPUVaPDAZaaLVGE+ZsJR0IHK0fvEQqyZn4Q0vpRlo1W X-Received: by 2002:a05:6870:e412:b0:1d6:5561:c2e6 with SMTP id n18-20020a056870e41200b001d65561c2e6mr933268oag.42.1695900017742; Thu, 28 Sep 2023 04:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900017; cv=none; d=google.com; s=arc-20160816; b=OzUJkM+e9woFzDL9nqidWT/gMTahDHmmak0YPtOWekc0mn8+PCQKzGabT51LTMkYzc jz89BFErMg5m8YRcwF7tF3bil2V1FKUqwCeGCN76gePhGmKhEUx0o1WToY66bgl/kiet V74rPe/k6smz3j3k7dgKVTG1fsDHmTQYaW6or3heQ3W7RiVeCFzHCYgz9x2MkWDxmWGO 0Jei6g8fEresRRZ2uLpVAaZXAJohbLpYXeQJcAZNNwAVyHINuGGh09cyWg0RVBMWEdz+ fHGWiDUUsnh2wcmg25N0JZv7jkBUxOFngLb0dYFssmffqNhGqkQZHR5ZS7JOg46J8Z5O BPzw== 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=rVY8w57YMh9zfO3tgED40xxETodS5fn7Ym8tvIlrTWM=; fh=8qCKqn6BYkGuQTCNhe8+upUWuYLHCe1OqceJ45ksEvw=; b=z92v8CqrwfBg4JEogYCy5BGI/o5OCfgM0op22kjeouuOLqtr/vnb3g3V1NBFDfNCmf yo8MJklxeA6lFwcchw3NDVlAWLK9HbF6Bq59HEt6LH19WIXP3mSvF7djMKwVl3IThABk PDgBaSDeCzh/V4Gl3wx8VpwEHKw8c56KyS9v/goFV1nHDai2Tw+A1i0VxzUsDKpLo3Ly VUsSqgHl05twp0Z8p15KDkeYhyqoUsV/XCbEd0Y23od+/pEsh+BqQswvAmzk5HtU0OFH aYI4XFWsoTClU4EMIE8Xu9rNmaFhoct/EOGoz1w01FsaJC8euOmka8/OhTObYIptLd/D vNnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dgEOBlGx; 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 z13-20020a6553cd000000b0055b640a6b3csi18226792pgr.884.2023.09.28.04.20.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:17 -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=dgEOBlGx; 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 4FBA8858DB65; Thu, 28 Sep 2023 04:09:13 -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 S232502AbjI1LIl (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbjI1LHc (ORCPT ); Thu, 28 Sep 2023 07:07:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7247819B7; Thu, 28 Sep 2023 04:05:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AED99C433CC; Thu, 28 Sep 2023 11:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899115; bh=VoXxlVrUqhBQVgwjQRi6qU/ZUnPcdpAUrcKR8cbC/GU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dgEOBlGxUkrY1UdDotHV8qYcq/YOtzMq9YHMhD3agVMSTw/us/cpFfcBz/nth7rUj zRWZpyzdYypQQykYBbsWt8+MAYeYNDi8uVYbnPsPUjrriqGEhVmdhOIafyZryy43DU Nk4UKhCs47HVDHlwS3kpdskGF7+ZZ6yJOQsBrI0Qlho9FP8yzHDpEtlqgWexgrwJ+v r+YxsIRtSnYdXo+1gVKjsYOWS94tba9gmJpMU75DTtIPwLvyUtbSvZZRBPiG2A/C7v ieXtx01U0AQc+Bm7ZklrbMxlL9h25Vzq4rcWNHlYq3wyyTz9QNZXmhRJ69B08FtF1u cI9D2dv7qUwUw== 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 52/87] fs/nilfs2: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:01 -0400 Message-ID: <20230928110413.33032-51-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280057395993173 X-GMAIL-MSGID: 1778280057395993173 Signed-off-by: Jeff Layton --- fs/nilfs2/dir.c | 6 +++--- fs/nilfs2/inode.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 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..b59380a8bbc0 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) @@ -769,9 +769,9 @@ void nilfs_write_inode_common(struct inode *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_mtime = cpu_to_le64(inode_get_mtime(inode).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_mtime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); 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 Thu Sep 28 11:03: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: 146007 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3235098vqu; Thu, 28 Sep 2023 04:22:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG32l2ndB87v7F6msTzB5vMLPPrtSC5Jrj16rkGLqMym5qZTx7rpiGZCVE1i+24RoyUP6Qj X-Received: by 2002:a17:903:22ce:b0:1c3:a814:a12b with SMTP id y14-20020a17090322ce00b001c3a814a12bmr1617212plg.16.1695900170425; Thu, 28 Sep 2023 04:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900170; cv=none; d=google.com; s=arc-20160816; b=HES2Kl6IeiVWZZQ698rHDOKJONdpBOiOCkImMv6/GYbsW9C+SM1rneLPLakDiJr+6g Ge02z+BmMGLPuS/BqOFkqFzIe+1GizXs7Dn/Q6VkZwEz7K+DmIhxyCDaTLrteDmnDiij s5fEjoOhYrO6Lo5Wsv5s79ZM3Zuy2kK+AiHE+/ZZ5ZUsvfN6O7zg//0wJcdZF4GTMqGD CJhKSBRWlaeiybCnJZHR/kYN8OuOsI0q46jZ7MFki+en+w/zUNtCFu6U2OdJEWYn3mbn tesWZBqdx+oEXgKfMm/HsmBEY3sHZuy4D0TmxD6zy7xXVQQAC95T4XjKsX4wiYt+mdhl 9vqw== 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=h7bApjJI4HiL6Zf6XvzizckaNwimlLKVtzdoDEB2J1U=; fh=/ddc8nBougnx9J9Jk+aiWj+G5DT4bYxfFV1UnmdJ16E=; b=WlCRrR1tI+5lpEH97w/yT/2vv0vXnc9s4j7ECIgR9Ytc1Jg7HI3bGzEvLniWNoCweZ PyKjBfjAwCoUK/wTgQQG3YNEZqqxdoIRh97akQrKNOEX852FxhTm7aFKrJ82Hj+GA3FN ZJE85PRPhonHCiiTy4hY1T3jD2nt3AovMt2x9eHljCfWomO4snJN4AsnIqn3eGdy6u37 /VOR5AOUaR1URQ+ecBl6V5O7UkFxav6raAv0sdPIJoP4jrwIAqkFaSHO1m1l7j9yCXwZ r6U6TKyMZNB6r/7y9pxp14nqBXYmnolXojOk/mUaQjQSuV5rxu31asCgGJY9KWJyGgRz XHIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hmNdPBmv; 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 kr6-20020a170903080600b001bbb39c68b2si16916840plb.178.2023.09.28.04.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:22:50 -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=hmNdPBmv; 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 407E782F34B3; Thu, 28 Sep 2023 04:09: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 S232460AbjI1LI7 (ORCPT + 21 others); Thu, 28 Sep 2023 07:08:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbjI1LHv (ORCPT ); Thu, 28 Sep 2023 07:07:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46B11BC8; Thu, 28 Sep 2023 04:05:16 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEE7AC433CD; Thu, 28 Sep 2023 11:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899116; bh=iYzRYo8vFGKRND3wpSgS5AcDoJOSOrjRRyFvrT8djug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmNdPBmvApwFSgIvMG90dg/rmri7eMVBjXfenRypJWJjw09RAbm8TnO40XHCQKP1S flNbif3rant7lnwVUyWzf0llo8GQjlGI4arrDXpk9Vp1SEiJmoUXg/Tnkq9DfGwD7e vTlOZ3P//QBUTnvEoQBB+1iYVfxJoNq0ivRNOn3GtTZGn3Qlct8FessjdlQCdP90vt C95ARyOmEm0t//Sge7JSw/vtQLTh8o0ydvuxuJ0P6zkIZIBr4BOYDLXwyhfiqJ1KTY xxITkNTU+B8SKGko1OZf3sEkWssadvxtk+7T8Y9nUHhhoR/oilwit5qOU6vmLQfjeY KVySWnKJGfyJw== 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 53/87] fs/ntfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:02 -0400 Message-ID: <20230928110413.33032-52-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280217443947599 X-GMAIL-MSGID: 1778280217443947599 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 Thu Sep 28 11:03: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: 145985 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233531vqu; Thu, 28 Sep 2023 04:19:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBCJUKxMif6crLcQebwJnUK5X5pW7c+0PJenkoJcLH0xt56ESm0aVd/JwXJfXWhQUB3b2y X-Received: by 2002:a17:902:bc8a:b0:1c3:ea2a:9058 with SMTP id bb10-20020a170902bc8a00b001c3ea2a9058mr693526plb.65.1695899994377; Thu, 28 Sep 2023 04:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899994; cv=none; d=google.com; s=arc-20160816; b=pLnSHkh5uCL/Kz9UKGSh0eZ/kWiotu8DgDzq8FhCQERtHuNpm14EjfghtfhpcXPBzD MAkYDiBn6+snYw6nWTdOxoAgXKnHgEKmfU4cmtn8KYaFmAe5fBlIEwieWFgxMGBBzVpu LZk4Z+VRhcVb15HkgMQsAG+oVuEnBour0plO3/ZfKHosXgx31NzoUTTD0iDOn+Je/yc+ v1J/JFe0712kDg6yrYXLP01aprLkdwFHnsPa4zsZ7C2UHF+YrEG8ctP+/t1Bx7ePx9xL piN+1uUaJMDhucyRlvkJcr6a8TatuCVjm+z8UDlzSz+p0dPMLg7xPHlENx7OIPhPhqcx N2SA== 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=oxTm/AQ6zVT8/b01UuzWAy9G2lRLMTe6qt6P0P26lU0=; fh=yUK3CqCU6lAVbXF9XT5sjbVfFmo5kh4eCUTV5vy97+I=; b=ZczsiufOZs2kB/cZkkp8R82WqHADaRfq+M+TkpH2cdYVQfpNcTMQ8TTRLAfhLOThFY T1MIdYjcA4dBh5Jm/L+YjarvQXBiMFCAxBKheAKi7uxNNNdrQKqbVHtn1cwnHNQSStSN GGkVXW2TvWIxIqP2kv6AHXhjtp7XtnxTF3wwDjtbacbzA5n+N3lRjl+Zbzw/gemqoPW7 jFF0wILeWWEZWWXWGXg7ytW3nrYq+SDc7WJV3sk4onKO6OrC2n+nGH+yZ74bxAhugHG/ 4+LrKomnqgX38gerhmzlcUv3KUJRhBFvNTm5krU8hDe2bvX58SBHsSJ4vLSII+avXIOZ paqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KhNBn3Bx; 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 m1-20020a170902d18100b001bbc80a2a3asi6100502plb.299.2023.09.28.04.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19:54 -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=KhNBn3Bx; 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 5C234858E8F8; Thu, 28 Sep 2023 04:09:24 -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 S232397AbjI1LJD (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232347AbjI1LHy (ORCPT ); Thu, 28 Sep 2023 07:07:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26C0F1BD5; Thu, 28 Sep 2023 04:05:18 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 581C0C433C7; Thu, 28 Sep 2023 11:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899117; bh=VoOddC0bAwArgHb3vOT5rLghytzRLWgaGpSm4OmTeJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KhNBn3BxYCjBr/dMVL/hIQjTNr+8NbowJiR6Dsl8pueNgpBQh51yt5Ur4vy9xuGmt A72lETOnQh8pXxWkFCmlrzDX95obZWYaCs8PS0Y38F7LKiG99OBvZpE4Mn+sNGedmH u0+L4smaq6SjssulnuJeDn66hD49QD3y2/aqllG+sqfn5Il6PlD2k2iCDCDfIEfx7M k9orEIDx83ipmxtvKfVye6p3aLSzEUnD7lZb44AWMWBwLaj4KmrWysRBm2f93g/8Xa hUdwx2/FqvIoGNY6c/KwE+Yh7YNYaWGwGctADjKIbYOpp5D6juQTiZXWJ2LwDfpqRM eDRkh172EohCQ== 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 54/87] fs/ntfs3: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:03 -0400 Message-ID: <20230928110413.33032-53-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280032492247493 X-GMAIL-MSGID: 1778280032492247493 Signed-off-by: Jeff Layton --- fs/ntfs3/file.c | 6 +++--- fs/ntfs3/frecord.c | 11 +++++++---- fs/ntfs3/inode.c | 22 +++++++++++++--------- fs/ntfs3/namei.c | 4 ++-- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 962f12ce6c0a..322fb960ba5d 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 2b85cb10f0be..9f66dcf5da8f 100644 --- a/fs/ntfs3/frecord.c +++ b/fs/ntfs3/frecord.c @@ -3265,7 +3265,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); @@ -3275,19 +3275,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 eb2ed0701495..27fb4255f428 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); - ctime = inode_get_ctime(inode); - nt2kernel(std5->c_time, &ctime); - nt2kernel(std5->m_time, &inode->i_mtime); + ts = inode_get_atime(inode); + nt2kernel(std5->a_time, &ts); + ts = inode_get_ctime(inode); + nt2kernel(std5->c_time, &ts); + ts = inode_get_mtime(inode); + nt2kernel(std5->m_time, &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,8 +1663,9 @@ 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_mtime_to_ts(inode, + inode_set_atime_to_ts(inode, inode_set_ctime_to_ts(inode, ni->i_crtime))); + inode_set_mtime_to_ts(dir, inode_set_ctime_to_ts(dir, ni->i_crtime)); mark_inode_dirty(dir); mark_inode_dirty(inode); @@ -1767,7 +1771,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 ad430d50bd79..4052edb726ee 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_mtime_to_ts(dir, + inode_set_ctime_to_ts(inode, inode_set_ctime_current(dir))); mark_inode_dirty(inode); mark_inode_dirty(dir); d_instantiate(de, inode); From patchwork Thu Sep 28 11:03: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: 146008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3235153vqu; Thu, 28 Sep 2023 04:22:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhzQ+D/frZFzQhzWmUTChMk80AA4kMdGAkvgun3P7t0FggtdV/VMXtEDVIb7g3wmZtue5j X-Received: by 2002:a17:90a:688a:b0:268:13c4:b800 with SMTP id a10-20020a17090a688a00b0026813c4b800mr823518pjd.21.1695900176392; Thu, 28 Sep 2023 04:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900176; cv=none; d=google.com; s=arc-20160816; b=JLChQakAd28Fp686ujcWJQG8PayJ4Kw1cnIfKuR7rm7LsD5yS6wjhVJ919fLB8RALm BpZUS90DJFFBg7GOyv1aWz6NSoBBFUwuAbULs3I/wCBNvI6LQSX/40kEaaJUA/SzmGEj LEMUeqx7/jmg7knwM7EJ8LFoaU9E3svRQABsck7S0fkTJ+piJKeALik1X0ZBIzsqGWUc feXA7vl0K7Xwm2JRZFa72yhnXCiyrN0wuPq7UVO1Y+bqhoMUk0k2JNLDEnnFW/D23vye vQVKETCZ298sj8CnXXq05bDkqJTdesq/W68J0ZKINq8Adl1KAouyn1dv83W61LkZgSIM crEg== 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=LM5l/V3MoUV6nfuAMnLiBJtkLyN869hZKuZwReXM/DQ=; fh=tNLxgbuCF+p4xqiFm9ldKyAq8PJ5v7qcez6IpY/yvZo=; b=eq0BQUAS7U88l5jiC0Sn/lHSM7AjEJneoT1GsUoQQp0SA9DiYJNAExdvdY8afgypXN Cph0e/QJ4g1gku23SZQ5YNVHHWG2m17AflNbZxxmeg/tR24UK7devkwG4a8ohgL6YIQE Sfs3OwSNUONp1DUKM1SDhE4TI/znRaOz3mGuuv9nKdmWDKlOnCaNEd7OjtkEq9WNbCjw RYQ86ghHCrbigJiZ+qhFv/yelSzi1bHRBBNANNnBCeCEMzVMpzQ9UCZsz0DpFcH1c+tY NZeqWuyaa9jfOK+ZW0INZTYlaesehQnrTlFuMesVqs0iTyuzmormobtq3drCvMz6PvNB iF8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PQXF1xoz; 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 gl21-20020a17090b121500b00273ec8dfff8si691573pjb.80.2023.09.28.04.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:22: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=PQXF1xoz; 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 55C8382F7FB4; Thu, 28 Sep 2023 04:09:27 -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 S231922AbjI1LJO (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232262AbjI1LIT (ORCPT ); Thu, 28 Sep 2023 07:08:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12BC61BEC; Thu, 28 Sep 2023 04:05:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20441C433CB; Thu, 28 Sep 2023 11:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899119; bh=WSxbBfZ4La8zxSFSiEDrnwuIa5wj+0GB96TWsh7xsFs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PQXF1xozdhY/h8eSJXMUq8LB+GkKUMnBMiWe7O4E+8O5mVYwV+gyW+szetR/8e5Zb oCseRLzuk1nSkceohEv13hqkGmVgHY9unZWMEHiky4raQbYSGfyQgQH4J/PpHW/iO0 7FjzQME1v12qhYDKzEWYXot/eANiLZGx3DbjUN+fBDA5XGD+wsygSzO2j8edRosCED trvftiXj797ULaHkM7JxdE/RiADMM9ejwtuNLycfbh/rUOMK+LKUqxgKu1ay5B3DGX Vrworb+/UlVfmPzRZnU/lR9jvcPEEAMd3BbcytroBkmnYTFzcfMR4pos+nGJ/9Tt5Z 2CYZcjIfiKNhQ== 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 55/87] fs/ocfs2: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:04 -0400 Message-ID: <20230928110413.33032-54-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280223046881543 X-GMAIL-MSGID: 1778280223046881543 Signed-off-by: Jeff Layton --- fs/ocfs2/alloc.c | 2 +- fs/ocfs2/aops.c | 6 +++--- fs/ocfs2/dir.c | 5 +++-- fs/ocfs2/dlmfs/dlmfs.c | 4 ++-- fs/ocfs2/dlmglue.c | 29 ++++++++++++++--------------- fs/ocfs2/file.c | 26 ++++++++++++++------------ fs/ocfs2/inode.c | 24 ++++++++++++------------ fs/ocfs2/namei.c | 8 ++++---- fs/ocfs2/refcounttree.c | 4 ++-- 9 files changed, 55 insertions(+), 53 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index aef58f1395c8..40ed1c98fe82 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -7436,7 +7436,7 @@ 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); diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 0fdba30740ab..2793ee14eaaf 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(inode).tv_sec); + di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); if (handle) ocfs2_update_inode_fsync_trans(handle, inode, 1); } diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8b123d543e6e..82605892e68d 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,7 +2963,7 @@ 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); diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 81265123ce6c..9b57d012fd5c 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -337,7 +337,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) if (inode) { inode->i_ino = get_next_ino(); inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); - inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); + simple_inode_init_ts(inode); inc_nlink(inode); inode->i_fop = &simple_dir_operations; @@ -360,7 +360,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, inode->i_ino = get_next_ino(); inode_init_owner(&nop_mnt_idmap, inode, parent, mode); - inode->i_atime = inode->i_mtime = inode_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..75f13755aa9e 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(inode).tv_sec <= 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(inode).tv_sec); + di->i_atime_nsec = cpu_to_le32(inode_get_atime(inode).tv_nsec); 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,7 +419,7 @@ 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); @@ -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(inode).tv_sec); + di->i_ctime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); 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..4f5a88892178 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_atime = cpu_to_le64(inode_get_atime(inode).tv_sec); + fe->i_atime_nsec = cpu_to_le32(inode_get_atime(inode).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_mtime = cpu_to_le64(inode_get_mtime(inode).tv_sec); + fe->i_mtime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); 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/namei.c b/fs/ocfs2/namei.c index 5cd6d7771cea..e3351ea8f689 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -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); @@ -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..bbe6cd7a30f7 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c @@ -4078,7 +4078,7 @@ static int ocfs2_complete_reflink(struct inode *s_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); - 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) { From patchwork Thu Sep 28 11:03: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: 145997 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233848vqu; Thu, 28 Sep 2023 04:20:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPuymKah7qsi9+FzmZIg/zBlG9fWmL/CZZz4emGiOZy4cruZzgP1DlkB/Ad7M8o9WwaCvr X-Received: by 2002:a05:6870:d1c6:b0:1d5:f070:d518 with SMTP id b6-20020a056870d1c600b001d5f070d518mr881089oac.52.1695900025820; Thu, 28 Sep 2023 04:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900025; cv=none; d=google.com; s=arc-20160816; b=fi0fW9ErY/uwkdwmNBZi0s01OO2pmUFjMZibYBJxArTxoBXUwXx3e5xNfSBIvX3cLJ Av0rDVnQLtisbHFzHaL/3uN7YzHbcexnurlc6NV/ukRly0cgPkdXVn5otYd4/lIv/Gl9 VPzuv14jDTuq/jGZLIfWGuBv6jqiqz6wE7LM3KtW0faITCSmIs5gM7Xg591Kp9UgB/vA OCD6yJoz4pCD2B/waIRqt1X24VNRuIOEtK+5RfykQtrQlQ0Ps4i8shPzVLln26szBbjD V1et1yxxg4jZmx38u5RNQBM3lGSgwNme5kRsoOf0W0wRrC+tun/BCcf6zbdf0zecdplv t0wg== 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=AT0cXZ8ncKx8H2mN3fMw70lpRF5OdZaBWsbVbOOdsLA=; fh=Z2bTRy1scX8IrlJyHG5XI9Cg0kzzOD+BNHzLgjwr2MI=; b=dV6czWTC69Hygwxam/bFz8naMo7cfoE0VBor9N8srA+UAyjYvq4KnG1xOa89weDvdy z64JUiHYlWGqxdIMKBtp7RgUFxUFmt101/zHLrW15/y16y+2hLlSwoEnUjIntwNjUfYX HU65Vm1t6c/C1WMuun/z9q+x1IuyXrGyFwMU583AiDaYkYRWbmvPSc8NVjkCZ45XaJUQ kOtQ5zFqc+L2X6gZ1+DJ1sGqzAIxf0CKyElGtNd2SL44lM2OPxH3kdfc8MkRPKyt4GZh EzHavrLsGWEdUoNv7gS4BXjiuU+zOBjuPd7w1e9xT2jGncr8VswcDODqxUy/vWpRyO0h eI7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=X1p1tnqk; 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 h192-20020a636cc9000000b005849ac0bfbcsi7518835pgc.758.2023.09.28.04.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:25 -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=X1p1tnqk; 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 633AA858E8F1; Thu, 28 Sep 2023 04:09:23 -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 S231934AbjI1LJK (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232373AbjI1LIA (ORCPT ); Thu, 28 Sep 2023 07:08:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 554781BF4; Thu, 28 Sep 2023 04:05:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3215AC433CD; Thu, 28 Sep 2023 11:05:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899120; bh=DJSvCuPLAD4saV0xZe/l++49VBU2Ao4YBQp420d7aJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X1p1tnqkywMXIK15zqJ2FgVjNGn7haElYKat55LiJsKAEX44aY9LJroHbA3VzKLGj /Y6rWU8/2CJidpL3EcXTC6Xu8+XrH/os0C2pOlhFNunuxtBiyODoe7HJX3GtJyWhzc ikSi7r3w2rNWPJS/8i6BgDOuAFW7BZ/AsmifvnSK7N1Ju0zyi191rT03uuSHoRuV6x Ug/dMhpw4MIlS9jrAGXCpgZhzqNmGrGaqyuG8uTeiHP1xw2JK5iohcnV73NUzY11xd A2bzjwLLv+A5lAtZRymkX5iLwUrdcnw9wGxHtX4+Iix6HcvBC2Q8qKuiiVE7JG21Q+ dh/X0w7/3+u7Q== 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 56/87] fs/omfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:05 -0400 Message-ID: <20230928110413.33032-55-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280065430806194 X-GMAIL-MSGID: 1778280065430806194 Signed-off-by: Jeff Layton --- fs/omfs/inode.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index 2f8c1882f45c..cdcee7af34d1 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; @@ -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 Thu Sep 28 11:03: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: 145975 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233179vqu; Thu, 28 Sep 2023 04:19:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEoRL4fykxiyV+gCwzDMS0G2q6c4txZ+6yhsxDNYFudvA0ECXqkcgAX4eTU/j1xv6cVeYuX X-Received: by 2002:a17:903:26c2:b0:1c3:749f:6a5d with SMTP id jg2-20020a17090326c200b001c3749f6a5dmr671772plb.4.1695899959847; Thu, 28 Sep 2023 04:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899959; cv=none; d=google.com; s=arc-20160816; b=GXrqCbCx2/byh+cve4sejGss2WHqyY30/WHAnJtatTgxkmJwmtfFDKKvUXfY8OggnB zFE7VYKY8qhFyuUCgNn8aog1ImEYvCXTrlHPM/16+UZKngnRqn47j6HrChVayPmfaehK lsemVqyiO/bftvEfeiHAYOE56SuXLgU1TBcUCNa0scH6lDkcZNSY0pVCkGP3T33VlN25 shYulHRIOXDV37vM8Q12WDYULz9MttxG4vcE6Zs4g8e0y/h579GJ4/IXKOvC396k+UC2 n3a/9TDR+KRR1LoUWYCwKVMxYbNNpNlKS+E7XXWX4eoNIv/1mFlvQU8Um0dSJMnClZH8 cpaw== 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=FTXRYHGuQdYyRciW5UoOQXIMJb4B3bkpYU7mu01r95k=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=rf5/x7zdYxu9ZVjIZiLz3UsCv573G7AqjrTsNhWGBOTDc8Kt3RqBN38ss+2DPkaAXK FaKfuEbzJ9gh+s9Q48ygnsfh+4O8qt49Krh4DWsfmy1V2JMRYkfXtze3iGMPsIOBBE7K NQoQYqzMiS9qPwJxmh6LDpvkp0NvMVbDS3IX34gp28jQIGrr41kaPVGjcbq0SyEPadYK 6bCeUqifROAjq2hr9U1lKqnqwmzEw1rUZZUxxphBGc0mN2stGshL/xSUUEyQmsPh5bYE lxWCXApWgngBoUjkHc86zHmwcaiGXcIToxjCo6eQZLx/PAe/uPRYKld57wyUAq4vH3UC t2ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GrTVxkom; 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 j10-20020a170902da8a00b001b9be39eaa8si19625189plx.348.2023.09.28.04.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:19: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=GrTVxkom; 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 4EB4B858E908; Thu, 28 Sep 2023 04:09:27 -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 S232396AbjI1LJS (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbjI1LIT (ORCPT ); Thu, 28 Sep 2023 07:08:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC201FC3; Thu, 28 Sep 2023 04:05:22 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4384FC433C9; Thu, 28 Sep 2023 11:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899121; bh=8+8AJF3AhKrl93BeuM8E72hFW1YYn21QPzzOHsiMUnM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GrTVxkomxmLgo+dtPFi5YzqlMf7W+QIjQYPYS6norJp1U0ZjX1hpXMEMGU3t56qpP 4n2vmVnzWD5uLmO8zA+rdMpTOe8NsJkFgaSylhwPXV0oGcPP7RL9gmlKuSNI1SqH/m XhmE5NjBoB07BoGDT63+7N9STzkv4IBTFOAubfzLadNMbHDFjXV1Uw85qBka6ZTrMM bRazIX+ZxtrcyG/kyHKUzXK4/s6DleQ6BpXhmyfZz3zrMhzZGlxw5Bcan74BSIPDrs heUhdGvigKuRAPhVhM1WZzry2WJ88a/bJKG1Z3rYYInU/x4yMgYO1AoS5MkZ++CPxA tO2MzhrilBA0Q== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 57/87] fs/openpromfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:06 -0400 Message-ID: <20230928110413.33032-56-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279996708063735 X-GMAIL-MSGID: 1778279996708063735 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 Thu Sep 28 11:03: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: 145970 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3232204vqu; Thu, 28 Sep 2023 04:17:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0lmtIhLslcMCXH2xQDNN/cXI/o1wojlXbgKdCVZtxLpMJmdFQJMjbhBKSY0V87eomJk8z X-Received: by 2002:a17:902:e5c5:b0:1c4:56a7:b632 with SMTP id u5-20020a170902e5c500b001c456a7b632mr893556plf.52.1695899849225; Thu, 28 Sep 2023 04:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899849; cv=none; d=google.com; s=arc-20160816; b=bVJ1vIHsomkf1VMYK4J/br0wACZhZXAVWmMgu4kpFy1RwUm0LOeKPXRYhEkGQzpwLa 6BiJJMerKPWbVIGKkcMn7H6BWlAkHtr64PT2BrFYRDhD1PAzVr4d17uOy+74RXGU0lDT 7BDRHHkSfWfbceOfif4ZdzFjs7SOAatL07lPMIox87ZnZwXgds/fLmx+BVR99pvPkLwE FU210aOE0C12fOQp14NItmyKmhbY5nz48z7ROqzA/ft4A7nsNHBwGxchuG4GnekW/51o 7CUGqjClJm4JWO7J2z7T5EifGSNPCYdci9q+TV+2BMLtytUzSV96H1c3m5XIZFPb655M 5Lgw== 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=3ih3xIJidfnuRLkDcis/EijIMP3z4vqZM0O2VWK1Tyg=; fh=GVt1ijfE6qyOdTZiw1ZWHf/IufkX/oUdAm3PK+I/G6s=; b=zejqwehgrea218lAPwCYKord0/ZDn5hk73hLBTWce205e6ZfRHP4g7EoldNhpHaWHr vbgKl9b5NDZscB9NLsFpUNr2ZrD+tzx2ewChyR3FfaDCp5u8fscFo3xjzB6QP0li+9+U i0+KVuEqiQhYiizhifqaGEOJ4tRDjLoJznUztUCMjffGLC6Y4DNWuSMTvjG3U5ol3TTR ww4p7OZWcz8Ju2MsVheyyDpSwXRzRFpvDmT9ILpgxVer2t0AHhK+RrXQyYQJedaB8D0V cPlVz+BWXUtOKLNI3rvpdXTG5vNZYC6OLssMLHZg7JCLWHDqDT/USBEpmR35VpcOUkiZ rPmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P9RRTyXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id q15-20020a170902a3cf00b001c6182d7d43si10172274plb.21.2023.09.28.04.17.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P9RRTyXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 2FCA681CDBA2; Thu, 28 Sep 2023 04:10:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbjI1LJV (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232470AbjI1LIV (ORCPT ); Thu, 28 Sep 2023 07:08:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A4FB1FCA; Thu, 28 Sep 2023 04:05:23 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ABD1C433CC; Thu, 28 Sep 2023 11:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899122; bh=E6oS2zOcODx/9WfXsAOvYmFNqLdc+m+M1LwLfi/Jt9w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P9RRTyXzrby0QpT7bxb6Q+L2KH2Wt1LYsrklfbCXM31yTwGk4+yO3ool/4uYXlmkL kZ1+zSUhnVhVphEdQC8MsWU22GfTyKcOuhmvXrXl/lWJQe355gRT15ACsAX8AWdoXi oWfLD2nlBQmMdQbPzH6rT6m8kRl5WxrAVskPnmPRgBHCZ2AQWLSY3Zcp1UxZVMEbSr wn5DK3zVACsKuciCtAFZ1nX9fVFFPPbAAZTYPyYdVE2BH+IsNSY7e77tB0yMIS+RZs b1wyYEgQi67n2DZV55HTat2f7SjaxjulRVLmOFkGvyfl0JYLxOJgXk6dQram9j1YpL MhCX38+Bd/vcA== 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 58/87] fs/orangefs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:07 -0400 Message-ID: <20230928110413.33032-57-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:10:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279879891119664 X-GMAIL-MSGID: 1778279879891119664 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..42cb8517cebe 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(inode).tv_sec; 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(inode).tv_sec; 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 Thu Sep 28 11:03: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: 146001 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233928vqu; Thu, 28 Sep 2023 04:20:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrl7RIoSk9n5DCZ6/wrwJIT+4HuTNk3y7Vs9NAuSmwg/CvM7D+PGqkcCt6EhXqLgwlV3Bw X-Received: by 2002:a17:903:1cf:b0:1b8:94e9:e7b0 with SMTP id e15-20020a17090301cf00b001b894e9e7b0mr993645plh.9.1695900035858; Thu, 28 Sep 2023 04:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900035; cv=none; d=google.com; s=arc-20160816; b=FP/iIeoMGcUODmWz2w5p0pKa4qHHaiusBtpZCdnWZ/3uUZu6RywOhCRUPJs/PZbok+ /IZJ27jjeBZ4Vcdgs+L0e+Ik/ma/pebD9Hyb+YQbMM0cB8UQlytxc2VShXSWWf74h+XV cXnsBii4cWE7R32BfNEW4WZZlZ/2JxycOK8eegAyGUfOaq032LdMpGHzXeeR5LXJ8exV i2qm9r4xyVfXbZwjZSZvKs9eMfefMQ4Vyq8r9a3WhBpqIQ3Smo8xXQ8irVOruro1WSj9 1xnobp7JgJaJVByR7QVd4jTYU2Lmtvl6wrz0w9Pi38G43Y6NpjWHDxlKLyU5AwAZp1+Z nCAw== 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=Q/BcjVmRortTRx6z7Ha8BRdX8RezZqllQqY2YR3xlNQ=; fh=1ts8YaBpHdhauL1JhLd3+yfDH4+ZNqI6GN/ugCTFmCg=; b=kYy4m2R7+rD6nm0AA4d0WZu9fuLXLrILBz0M+xsxyhJsoVpz+tANHSmXBcOT8EbhDD KBDjs22r1wqEn5VycbP8rMPU3N2NMEpzPt277pX0kkIpsossr4SmmK0fK2FoksG9i809 rchQM+6AdVnuuJwkJduvDEN4Cvp6bc7bubXEH174jQr38825hPLSaja6e+FuY2rn9NTL OQ51G4GoALIdYfpoht/gTDiCjXcReUmHNHiZyt3VHXYQA1gXjFy7sMJud9wlHIHks5fa egQhabd/sCyLZrqauzezbBDnq/eifM4UI9cmt/o8OvPrQxSHgmoCP5ufhvmDj2zaSRFW YVMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oF1zJItQ; 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 q19-20020a170902bd9300b001c3ea2bbebcsi17044951pls.322.2023.09.28.04.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20: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=oF1zJItQ; 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 222A2858E91E; Thu, 28 Sep 2023 04:09:54 -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 S232127AbjI1LJj (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbjI1LIj (ORCPT ); Thu, 28 Sep 2023 07:08:39 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A36F81FE1; Thu, 28 Sep 2023 04:05:24 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84F6CC433C8; Thu, 28 Sep 2023 11:05:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899124; bh=s7WS+LV0JB5TQ52AQtIz8N34W96nGx+AXxe0soX68xI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oF1zJItQf+rLBIzreOD0dJy4IIIPXRjAWa3T8dpvvNiVblS7j8VMBuOEuHGsZaEU/ p6R/9HdZgyROZKkkM2vCUlGce3oETFYGLJXxjBKtoeHbL3ZjrHK+MFOw/FflddKB3I dswDue1cOa2SyGYyMsj1uPEWdztszY1qstS6bTMJjYui+hwoFgRPXfFbChtz3kAWAh wFYvAyabav2a6UN4OpbdwaoHr7ZxbMLzgR8s2kuxzfQSC5/PKERxxaPZ1dVAIs1nsK hupdg5UR5C0ZvbK/r5XH3kyY2eRYIfpNY1gLxmLxmL0uN/25yc5sRTTmLKS+XQU0PQ MsBO9P8MVSKxg== 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 59/87] fs/overlayfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:08 -0400 Message-ID: <20230928110413.33032-58-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:54 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280075996244667 X-GMAIL-MSGID: 1778280075996244667 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 693971d20280..9b4f5b011e4f 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -239,6 +239,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; @@ -251,9 +252,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 83ef66644c21..b6e98a7d36ce 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -704,7 +704,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 89e0d60d35b6..868afd8834c3 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -1409,8 +1409,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)); } From patchwork Thu Sep 28 11:03: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: 145971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3232229vqu; Thu, 28 Sep 2023 04:17:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjPNf77QYOdjysVemHS+vF27zwG6twvbIuay4HpOsd12xjANajjNIaOCQyAD0rFcqdHDH1 X-Received: by 2002:a05:6358:713:b0:135:499a:382b with SMTP id e19-20020a056358071300b00135499a382bmr856834rwj.7.1695899851715; Thu, 28 Sep 2023 04:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899851; cv=none; d=google.com; s=arc-20160816; b=nJVsK9nZa7ORI/KZUwk7ZMJaUcy9O8z2Zkb4ulQ1xwlj2hcCqZl29b8LIqOZoYcD3k bBKW2pdTWnkCS1fJZ2wau6Z1OEyMlICgnjaYUnsQ/LENjYyL1Syl21njifvmz9w49h9i kpUbNcU4zfLcRqaMeN25LWwvux4pE2pHKxyQXW+Tz/9c8Li9mQs3Y7G1vdc7NeRv3Yzq 7iCkKqIkvTp2F6xi3gax3k1Lk5suSGq5g/TJtxKkURCFVXnSkQJFyF81HAQ9Ks4nHbVQ APSvqzWy7zgkyqo1CsN397Qyjq+SzVY8Bwd5c/7KjvopOhc69cZ5BWkzgb4sKcGDsFvq eu5w== 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=Xp5GHXPL4fR7ban1uaf3HoKnur+curdH5Cfbb6/5iVA=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=TVGRcY7s2mHMmlN6WEiCFHWA0LO3fu1naFHNmdgt5YAL2h0hjjJdUcgKvn9ghHAPlA RAGU487V99PYScjiM056MvS0DgxJRSzWG7amNmYLlGcwpC4WU2Lgcu1Ll6LA152FnSnJ l1I88i66/fF6blQSyKZsA7bPYGu17OwJGdJQN7vhYeyb8cItphJ/UyedSxUPnfNJtJ9E ltyHgRSuQsJ2PBexklVYkdeU1CnhaRIwfzkNk68jXSaYpXyfR7cGVlXOkeRGIBD3ldBa 0kN1LeVs/SH2FjvXwn5qQuqM+D5SQhjzVvxNqxOlCY20Zhb1ERP+UtDQ2E4QP72BS2bi Z3kQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OuGmLiHD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id cl4-20020a056a0032c400b00693366c707fsi4806041pfb.299.2023.09.28.04.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:17:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OuGmLiHD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 66DE982B514A; Thu, 28 Sep 2023 04:11:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231767AbjI1LJq (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232291AbjI1LIz (ORCPT ); Thu, 28 Sep 2023 07:08:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B554B1FEC; Thu, 28 Sep 2023 04:05:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEC53C433CA; Thu, 28 Sep 2023 11:05:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899125; bh=xEQsIrRsYPNzXX5r6sRFAGgy+JmdjrVXvNQATA/DNqY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OuGmLiHDoHZKnkQ/MGhUox6yyeHjpJAueaRGVMNjUmeNzxgt3wYDCfeV3+rWt+pML gaffXEhePTlNpBtqiDcKKxZsk54ZZBUF+mfaw8lDsmxXA4MEhkexdV9zVNw7QFApLs FDpiXTQ3rZxxg6xxhYxPENqJg6glkdBnSkl2uGFGVpdYEXZ8FZ0Ov5dKGf/h0xF4W4 +yVGPOHwdskE5mNdyRdOkEdmrLg0C/P0MDOEQcqTs0ZzV8sfFB5JAljqlTSos5jt9h Sm4BXKYnAYAKsavHxxpdcspVmxIZjhtLkpixHHPjWAqOkV6cZJeTmxPh7AxHPHXlrS riD9cRJvcTvZw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 60/87] fs/proc: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:09 -0400 Message-ID: <20230928110413.33032-59-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:11:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279882557239637 X-GMAIL-MSGID: 1778279882557239637 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 ffd54617c354..c69925364090 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1902,7 +1902,7 @@ struct inode *proc_pid_make_inode(struct super_block *sb, ei = PROC_I(inode); inode->i_mode = mode; inode->i_ino = get_next_ino(); - inode->i_mtime = inode->i_atime = inode_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 532dc9d240f7..592ed2516f47 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -660,7 +660,7 @@ struct inode *proc_get_inode(struct super_block *sb, struct proc_dir_entry *de) inode->i_private = de->data; inode->i_ino = de->low_ino; - inode->i_mtime = inode->i_atime = inode_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 Thu Sep 28 11:03: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: 145998 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233890vqu; Thu, 28 Sep 2023 04:20:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrwdkes4sc4FbyxhRe4zvrFPY4Mbyc2Jr9rPILYu3D5O31Tr2SE8FO1O7aKOYl3Z1Jnqtv X-Received: by 2002:a17:90b:3b88:b0:274:116b:8f84 with SMTP id pc8-20020a17090b3b8800b00274116b8f84mr816655pjb.34.1695900032276; Thu, 28 Sep 2023 04:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900032; cv=none; d=google.com; s=arc-20160816; b=KDyeGOU56bSOqYsACoxzexLN8cuWT5jbfwzaqdzxneT9POixD1WEnt0cI7EUxTcATn PvsCrNdNY+GzagJ+k8tka0Lu9Xjo/JLFapFbAIiDbiYHwp8wDB3Cv2Me1u96EaR2JqGW rKS9bdlM1gS4rNGNhN5YUnygsBAU69TrBIzkDPgFMO3BHrlT83L99sYPsOn7qyOz4m+3 I7otcDsDWL/X/HAzK5tJdw9yQGTMqqox0ShRbTAKmKlbPFJdnHANF4d0pmYx/MkS7MOX gBJ+v3OEopUQwPogmNLBzNlAPhBwULuOcgUI1pM3SpbTAIAfsEJjggwaadEj/qUAJwgo pX/Q== 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=Wel8+KQiPKWdXTglMNBGw/bPxv7fDbPSODAly1bwSNc=; fh=tSP12W2W6KpbvgXhzX2/WLclKY+Hbbispj0/1qq5urU=; b=UQ/PcyxyF/e1l4fGJCEexxG2NKJzPCDqPMFp6iG5SjxIveX0dU9Q8/kxmr4yU71BtH ozvONre2C8QIqSdNqOfbmu9ir5bj9zWDxNA/ujCfaYv5Loc5g9TwMHaVWsLr3bv+NMlU R3bE+ZjmEMeh3y1Z8jZi8N6VcPwMRH86NoGF5zfKdyVBoyFdft5FLNp63ul3isrncGy3 nvPR5coPJb+e+wOxsonjxUcvc3xkiinv1t+vKEVO/5Yk3+GXW3/gnTSzJiMTDeERqkQ2 6xoSLYbTl1bOkdiEM1/AYnBDVyNL1TkraKMDILa6tQ3shByrpQJuVV72uR1eSiZvSMK/ An2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GB2bi8+h; 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 hk1-20020a17090b224100b0025bdaaf0d17si20801195pjb.33.2023.09.28.04.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20: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=GB2bi8+h; 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 9643F858E92E; Thu, 28 Sep 2023 04:09:58 -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 S232020AbjI1LJm (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbjI1LI5 (ORCPT ); Thu, 28 Sep 2023 07:08:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C33021FFA; Thu, 28 Sep 2023 04:05:26 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCA6DC433C7; Thu, 28 Sep 2023 11:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899126; bh=Ss7nLMp7jLyE6miSYsprdXK+tzY89Wa3eXUpvyW77Ug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GB2bi8+hguQ/MH1kAXUuU1IWliWyqT+gj6ORqRdaqWx//xKgrh1/giZmmtA0PgxlV rCEHfaQ13m8Us+1ADvEN2ugG/nb4keyAFRhGOm8yKDERmEeTsYGpKW0iWqBcVYtpzx krqs7C229KDYWJBITkNxFK6MQepOt2qb1WwCSbwl5WuLVo2d2dBUoC3xqX+7WG+pyz H8jUEK3UgzBkIVDoCUuUYqpNu6hqefcY/Uztmbu/pzphpYJtazLsEiWG5IOvsND2rX YglEz/g6FYTpmXddC01mx+F9+X+DITp17pceumXx3RkrGO17iP3ezLmJMG5F2SBnCM NhjlPxSnCmeRg== 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 61/87] fs/pstore: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:10 -0400 Message-ID: <20230928110413.33032-60-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:09:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280072304961485 X-GMAIL-MSGID: 1778280072304961485 Signed-off-by: Jeff Layton --- 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 Thu Sep 28 11:03: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: 146000 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233893vqu; Thu, 28 Sep 2023 04:20:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6wQLzChLswdOBpMBGVlp1AZs3XHE4I0tbNbgcTPc2NAw11lY60ZT2NEP2apuVvSh0kQBb X-Received: by 2002:a05:6a20:6a1a:b0:147:fd40:2482 with SMTP id p26-20020a056a206a1a00b00147fd402482mr948755pzk.44.1695900032427; Thu, 28 Sep 2023 04:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900032; cv=none; d=google.com; s=arc-20160816; b=mRgk3W/ipI4JiUzBjnZvQf+znHiRdtiLWyYMn8j8tkdQEdGoz9NEIu+gIkcXZGk51n 7aseHMjT1WgWea3z2eMGqXe/D0um45cQD2SbfAeCQhKdjIwjOw1olrHss+0SAV7zZ8Qk kCl9QBWFjwdGtsb+FdpXJZN4BV3Q700xyjOJErJp5kkNmkWmTRR+rl2tBjsom3f5XNe+ B99627BiECu6BUAUcGhj6VPuMTgEtjLzlt7JIuzU4PLmsPPJStvTRK/7LIYoSBJQby7L gTvZ2l31hSI8Hz2CJtvGTnzz+3qPBuithlmBbpTthQlQX2bzs4wgF+aS2bJleyzv4+tR rW2A== 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=6ZPAC+VAbYVNFMTmat0p93btjpTfItsOkpiIbkvBz1w=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=OMJirFadWhiQ9oACQjRTcfSYp4QLgjNqHGiQj/v5p0sfF365tCZOAqEg6WpNzTF96S pCrR62FTWcO1FAbZi35WBYB8ehF6F93COIt3uzD/jdiX7H8wJghVlMA6tswZ5FYjPn5n WFxaAm71lW5esFx4JLb/bSQX372vflTAEtCghspb8wjTdV2tdXBOUW1bl9VbMF3d2BUR j2zyFppTzNbAhbUe9q7DNxaamKSeHFn7IeOWRepFomx2Of+IAI7VAiu0Rybh32r092GE c+M/BEUDj9PPEch9PHqeMQVvrQxfvlb6Sy5DBFHHutaf61CaQkzVwDaZbO/YPKIOmx/R VYVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L6g7E9W5; 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 e6-20020a170902cf4600b001c3ba275321si6223939plg.76.2023.09.28.04.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20: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=L6g7E9W5; 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 84FFB858F789; Thu, 28 Sep 2023 04:10:11 -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 S232317AbjI1LJo (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232395AbjI1LI5 (ORCPT ); Thu, 28 Sep 2023 07:08:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE39010D1; Thu, 28 Sep 2023 04:05:27 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B18DC433C9; Thu, 28 Sep 2023 11:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899127; bh=MT2Y7jp9+cvD5+2+GZOJovkkdQ1vUxTXJ+WNXDpkssE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L6g7E9W5Wtf3sqq8MD4rNpai/DU4TGsfv+ZA0Gnic6dFv6AsgeU0n4XkxkjeH4yBx iXQbtQZSTDM7LxQsx3YZU+cxnfUBsGvNM6fSlGuv6iQwgYXTfuhIsQLG0wB9xoPd0F XaaS1vW5Ux35ohpisjM6NfsG4JgccyU/+l0N6zkcpyNCq4GxAwGw/+4VYpDuAysp1m hNiKCosd8okbWpAbYqYvlSOlInyKwX20WmgGwo6kGQ+X6CfskjSSEFnWob+kAxa7/B raouoilCgoUcyACGOf8gxxiqJA7oaCTnoYfPyN5cFIiovjQofdSLcfe2m90iBCloqx hpqkpFIy8ogwQ== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 62/87] fs/qnx4: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:11 -0400 Message-ID: <20230928110413.33032-61-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:10:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280072066461534 X-GMAIL-MSGID: 1778280072066461534 Signed-off-by: Jeff Layton Acked-by: Anders Larsen --- 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 Thu Sep 28 11:03: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: 145999 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233892vqu; Thu, 28 Sep 2023 04:20:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1RuMbLOhiV2erTfT//rVTY3nEMIIF8vVNZU7EksZIj4QwUFg+184ecni54qdu9gxXMwzE X-Received: by 2002:a17:902:d502:b0:1bd:fa80:103d with SMTP id b2-20020a170902d50200b001bdfa80103dmr854498plg.25.1695900032438; Thu, 28 Sep 2023 04:20:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900032; cv=none; d=google.com; s=arc-20160816; b=fy5bxd4MWlsLwClik5rd+2mcbe/gYqqa4o3Aba4+WuglgpsfJlohI1fAKITDce9Dlt yV6/k2fBUM9oUQT0zS7LozTC2zS5h+UDKNNFgXmnFQnkM10iLYrHgeLPMAHO0rViWRr9 iZVUhTsbDAeMkzFkuOsCJmfl+D8YN/AnGqBEJennkerlS/K6z4MfHg8plDHETcoxGIOA Mf+7mrk5EF/62KHpXpqCZnGs/jqALQcOJ8c2nJEFFJEmjdPzz+lUDm6W87C2mczaGnKw 4ASlRQrGxTTUhZsXe9lXBgH7dnuNpd0VCc5RznfI2rO8m6h9WVGxFqKXBNY44JO5HB3l NJYQ== 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=8mJIPx4HIzF4JQ29qZ/OE/pY5CWfMeYk/20NdWdOsz8=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=ify9M1k5DvW1Dtq5TuW746Y9x9WNM1nT0tUiihiolIgfiIR53qGtoBL4RCJW2/zYAY 67/YfF6LwwMGuK/i0kjULqiDiU3q+MqELWRUnZIe9DrSFKLVD3h9ZyYYF8h4SEBhfuz1 jRsDY8Gu7FLo1usr09hZHZ1ZE15VSq5SBWNpvfzBd+iSSY17onjt86aGwhRKA3WQSdjr o/6vlwm+m4rnz0A0Cb8l2s+OobD53sbphAIOQRpUtpRGFNTLpcQBKGViRFj2pk8bOHkZ lafKGi64mJDmIJKaNQkn8/Uvd3P4gqO+7SMryDZGJIxCOrgnXIzC7QEaQ984kxmdt3xW Tz8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mEWU+BzS; 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 l9-20020a170902f68900b001bdc10170casi14294210plg.36.2023.09.28.04.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:32 -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=mEWU+BzS; 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 2E021858F78E; Thu, 28 Sep 2023 04:10: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 S232362AbjI1LJu (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjI1LJI (ORCPT ); Thu, 28 Sep 2023 07:09:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9522108; Thu, 28 Sep 2023 04:05:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13902C433CB; Thu, 28 Sep 2023 11:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899128; bh=Qayin5SASKfJJl/xecNB8alrWi4t9sgg92O3QuynXjQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mEWU+BzSQ9FP50WtesqRRI9SFs/ICVSPtdBkd7skCB1gHgi4x53YQ3U+fxOA/962H lAnfKJdLRYTpiKWW8DHgiAx/4TeVZIiO8I/GqgC877LfmzOD+QYT9c5Ix7cWrTHHfo AmhpopEA3HonOtLBvMO4DkEjhhVrmnS/Abt/WZ/DBaxmsdFatC5PNpwbfkQQGExWCa 1rCSWrE9K5K5grC3U1AMdHom58JjkUlIkH+MIMjnF5D6JvBa1CCOAoZmjmaIoc9U54 Wachy2KwpoUq7Q850yP+F7UzTRZmw08xoLoJ5E3DbYtRRVu8gJKvFlDQPHiIMtZSBS kk15xoSf4yN/g== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 63/87] fs/qnx6: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:12 -0400 Message-ID: <20230928110413.33032-62-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:10:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280072359807645 X-GMAIL-MSGID: 1778280072359807645 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 Thu Sep 28 11:03: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: 145968 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3231550vqu; Thu, 28 Sep 2023 04:16:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH3LMoWIGFYgHk5GaAwLkSJDQ6ksg758J30p7eRYZ3ZvPX830gXoQUXwGO1JjZN+Jl2VUsy X-Received: by 2002:a05:6870:c103:b0:1b4:7411:df6e with SMTP id f3-20020a056870c10300b001b47411df6emr953571oad.15.1695899774235; Thu, 28 Sep 2023 04:16:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899774; cv=none; d=google.com; s=arc-20160816; b=L5oaVyHjd7oOpNhIZdaE+bNw86NgXEyuPo2BPMCeb5/k4+Mvrm7tAa6TwPIVu+WBFw uPVte3W5bBkW5Mvx8fZn6kOitaUC8fiCVZOM/jLowsZbWmb+j5q6oTeBOkghiI5NmfVk iAEZ1D27JAF3khryj+X8f8UQT4RjBxn+cj6W2CJc1mj3JryNoM7/tvunfEhMTmEWkgDA 5SVt/f3r1xIOXEzuk/gbgAc6HfJyyAdU88t5EOZJLsnq8GGpV8Fa4omOKVIoPEnq1bt3 yyHywUhuDCeYpGhZvhX1NiQMcNqRZT/ps9kE2htkeW2CTMrIoRuU2KJlY/CrY+wbdBav +IWA== 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=OaUZtdGJ3rBCqQ/6czzOxpYOu1BI0mPdSk4p86EskKs=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=MNB4ghidU9lTP61uIiRdO47WvUS+ooKgTlN4ez5gWPjod3X91hV0kDpnWc58hWxg6I qfwyKDJMlRg2qd3RoK/IYr3F9kJQlDBLSTuGJSqFFMUudWJCbB4sH7a6xHosHwxXrsqx NktjF+MXeiTd5H50jodNUPRG3ExCbwFaC6FfZrpWFpYquPqkzgWqVXrQapWWLB4hCzaU bEiXAmTxKWLRTZLn0J4JzNkew5ziKri2xSW5jY+nkaSBaMA3jvPRw938PAXSDJdI9D8W v20pkeB5FjwPDmb2avMX8rvtipYx1+6rK+BWthffSx8PmD2oc7EqbV2tWbdYDuwzVq/E x85A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=delfDE9l; 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-20020a63951e000000b00565e01815f2si18841732pgd.732.2023.09.28.04.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:16:14 -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=delfDE9l; 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 BC72F858F7B2; Thu, 28 Sep 2023 04:10:24 -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 S232412AbjI1LJw (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbjI1LJI (ORCPT ); Thu, 28 Sep 2023 07:09:08 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BABC62118; Thu, 28 Sep 2023 04:05:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BFE8C433CC; Thu, 28 Sep 2023 11:05:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899129; bh=3LzY1QRMSw8FwRd1+T82f5waDViGnmvRRNSI+fB1IAk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=delfDE9loiqO3Ouk1TN+e5suQ+hlcuSQQ0rmXemqSdFicJYQTe0c1wAPsP83gGCgX lyHmBwDIU23TNtN4UJ1euEvBS/9BIf9YyxFejUXFzf7SM0iGjcxJLqr4A/SNij42LA cw6CcqzZXbpFF0GB3obLTFIUSTSMuNHa7JorJCn1B0E2EmsthztYg+BXlqbWwISLwy 61G8rIzZmGBDRwf1y+vQFJ4gSbU2pNlH4fVdwiciZFeqaNOL5dfPht27Mnfhek6z/t MuXZLL63iBt9lXK1XF6/jrGjTAqCAljQ2dRNOEJxBRLN22p+22ixExJxxtLq0Cbza2 OBjQE7MHfDhkw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 64/87] fs/ramfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:13 -0400 Message-ID: <20230928110413.33032-63-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:10:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279801753551094 X-GMAIL-MSGID: 1778279801753551094 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 Thu Sep 28 11:03: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: 145965 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3231343vqu; Thu, 28 Sep 2023 04:15:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEHbDO5S/8Y+6yHtNWPjWQkgc9BGDt5+bXLp9wIihmLilE/n+3zE9sE1wQnzmbCKrD2pshj X-Received: by 2002:a17:902:f54b:b0:1c3:86cf:8cc0 with SMTP id h11-20020a170902f54b00b001c386cf8cc0mr740842plf.10.1695899749495; Thu, 28 Sep 2023 04:15:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695899749; cv=none; d=google.com; s=arc-20160816; b=BEUCBqYLkHhfbekFkDyo5ZbFwBpF/GQ3K7BHFsUt0adKCZe9afSQ6hUKfEmEeJlxly Cru4Iwm8ZFxkFII8FbBH0YEVwXOKH1RBT1krBFQQ1pquuQodZgb/Ai8LlypQG8fhNfBG 1TD0KJv+22NuGOQfVuIIZS+XZ0jTvhVjhYMg+wub+CigdshSsLyN81kCO+Lg3H3M5VFz npJEOQkclGugDeOrjbemYR472cYn+JuL3NYqfj42n3Sbs2g4+Hnk5mginAxbZzDI4vzI OPoz0NpkdD53/feX8Yc4Gr67Y84jVL4lghOuXS+0nzo8LwBTqeWIpQ7okD83VzMbMke9 R8lg== 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=D21n0CyqNAjvnAk92OnRnPL50zeJQUSSo0e5C6UEpj0=; fh=eAvaNBw3deuQszq/dVYFR/Il1MGmzbmDKm2WiHeD7v8=; b=cL5WByA+XDXmpZDzFd63AaGWlkygulbO5YDoZYYH22p8WtFsopnYDG9ERraSexksgF P3vc7Y8JIMKoXfOSoYC6m4s8OSM4hZhG64eAi385OLhFW9FQZG9Fmzsb0b+o2lutzFJo qpRfo/EJ5KM/khuQtCTLNfSyhI8UiJMw5KGHeZD4sXsrcMRyz93PTmJ6gM1x3jB1LnzQ FMEm/UvF1hgpawLf9qo8xckdT/0KNYcaubLP+d3MbG4kVOt+QwUNscKYMGRsFWBZKrVi y+21ev20sQHlYdbb/tFOvCZzGZvZ0rwDCQ+GH1+XadN89k0V88qS7HXdk9ikVSLpK0Ys eWGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sj4W8C7k; 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 im15-20020a170902bb0f00b001c62b9d56f8si7133085plb.606.2023.09.28.04.15.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:15:49 -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=Sj4W8C7k; 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 BC2FC858F7B1; Thu, 28 Sep 2023 04:10:24 -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 S232443AbjI1LJ4 (ORCPT + 21 others); Thu, 28 Sep 2023 07:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232065AbjI1LJO (ORCPT ); Thu, 28 Sep 2023 07:09:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E0CF2122; Thu, 28 Sep 2023 04:05:30 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A1E3C433CA; Thu, 28 Sep 2023 11:05:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899130; bh=Yvs71qP3EzQxY9amZFhhyIQwKE2m8ax7SRapVQ0A7YU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sj4W8C7khGvo+Q8DukaBS/ANL4wNLFNTtf7hxOZ+pL/Yk1SGJ3cPjrT84ODVG+pZz cgL5yap847q4DCZFUT6Jjpasy0HWZIlOHH3n1t0j+b72Qu/3WO3vVpbB4mz25rwO+m QEk9tdgmGryLDaCYJ9D0UUBYX/ylDFlp1XUM9yMM0zS47TqHjtc3DdRNOD4Wy6E0Ot XzzszMlQIZ6YX6mf2xsszVwBgFLkKy7ykEU9nipnaAeU8kXcuoIVacvPNXYagz2aZa jED6z1ST82cB4kEKkfRU+gWrA5wXM9SHflqbXE9OPzS8m0izkDnbiQuVj1iwxtce23 KcuKw73I3Jgdg== 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 65/87] fs/reiserfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:14 -0400 Message-ID: <20230928110413.33032-64-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:10:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778279775961918420 X-GMAIL-MSGID: 1778279775961918420 Signed-off-by: Jeff Layton --- fs/reiserfs/inode.c | 22 +++++++++------------- fs/reiserfs/namei.c | 8 ++++---- fs/reiserfs/stree.c | 5 +++-- fs/reiserfs/super.c | 2 +- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 86e55d4bb10d..d8266046476e 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,8 +1366,8 @@ 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_mtime(sd_v2, inode_get_mtime(inode).tv_sec); + set_sd_v2_atime(sd_v2, inode_get_atime(inode).tv_sec); set_sd_v2_ctime(sd_v2, inode_get_ctime(inode).tv_sec); set_sd_v2_blocks(sd_v2, to_fake_used_blocks(inode, SD_V2_SIZE)); if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) @@ -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_atime(sd_v1, inode_get_atime(inode).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_mtime(sd_v1, inode_get_mtime(inode).tv_sec); 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 Thu Sep 28 11:03: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: 146057 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3252660vqu; Thu, 28 Sep 2023 04:57:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjSaYGDlxLKm19VYbDE+7v8i5anBnDiqlN3eU0aXEvZOfYSvN7wUYD98IxRJjLG0niQOIS X-Received: by 2002:a05:6a20:5483:b0:160:a980:1222 with SMTP id i3-20020a056a20548300b00160a9801222mr1103972pzk.53.1695902275249; Thu, 28 Sep 2023 04:57:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902275; cv=none; d=google.com; s=arc-20160816; b=JH4q9mVwHoDGkZUq01f762QoZmHg4VPuC4eOs325DiuENFJ9oKBth2efyIhUTAor03 pbNc+BJOoj8tAWaf6Bd9N9Z/Zn+UREJqiOimnCL09fJDIL5BdqJo3M0ORFvPwsS2qSop /12dILcpp/UTWtDLM3tQijImx/BR8A57T+ktQ3oAJRUrExCxTuWUbf09PGuSQ6TBXGby 1xq0aqzaViKJ0nSu4jAmcEa+ihRqAUMqfQ/DvK4ql6NXqSSMNVboFRVylG9xK6RLPLrq IoqLu/dIFikxmI4CPU734mYo0ZDsm2Ogo4nXQLmSKh50mjrbUHPCfJA1u3kN+4p+ViHm ytoA== 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=NWR8tiLhXh0//AKe/1x+nA7DQR8NYbFe3lZKxV87JEM=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=HR7zX2+LNy6Mz2ClGSei5tPvUe9JBNXFPKds8baNuG7lEaDT9djoOHeHu+JwibuAYz vgwcabzvgu8GtR0v+c9TVdVIE36WWIFIJP4aQrMZmyAAg+S6gt50wxyT7pTLOf94c2i5 KeG2Fl+hy1X9RQ+1fZ1s+unfHOfrrVgxvmzUpTD6tcP1LVXZBvs49Zv+YvFKwZMGCRYq YQmmyJ4MsdbZvzlBLtJLfFs7ndMZixHoy0nfGFEyZmnFHoGT1x+uYoz4RezUtljzLDVw setY+wNbwTa6M0Kmdc3PHnGcAKA41vVBAPgLczoZxjwfAsgRccZMjiws5lzFNyTqm6Ni uOgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lmlkk7dr; 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 ka3-20020a170903334300b001bddcd8c6acsi16983949plb.311.2023.09.28.04.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:57:55 -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=lmlkk7dr; 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 DFD278025DDC; Thu, 28 Sep 2023 04:10: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 S232082AbjI1LKD (ORCPT + 21 others); Thu, 28 Sep 2023 07:10:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232425AbjI1LJR (ORCPT ); Thu, 28 Sep 2023 07:09:17 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73967212B; Thu, 28 Sep 2023 04:05:31 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BC26C43391; Thu, 28 Sep 2023 11:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899131; bh=zVtZIifGPxJTqvfBSth/QiVBDUFp/kv30UuF+2f2ZAU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lmlkk7drKwVLRoZsRFrMeORT8Twqn+uCMlk8R7fhZ1YEJ62CT+3a2dlYbPTJTi+Bi bl0fJyL647QZBCPOGDvDefy6pNK5+av+mHgk7n5YXoWqt2iDkiZygvT2TliGfKmM7q TjqFFaniLkn2W/fKZZvbR0JtdVmkPl+lEHyZMU+ApaR2leQCQAIZzx0BWE31VVNmyp DzHxlczPRUoz1NPa9JoiJ8nbIDTVZT1ljmH/DAFVqX37WOgWpJqW9IIWtaWE1oFGCW csYEL1QNtrvBMVyf8fKVe917y6DSFiuK1DyS//P6rJbqybpPGPW4jq6L6VQ5UiqPAg jaUiJmcGHyVtw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 66/87] fs/romfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:15 -0400 Message-ID: <20230928110413.33032-65-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:10:46 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778282423993094131 X-GMAIL-MSGID: 1778282423993094131 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 5c35f6c76037..c09d81b548e4 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 Thu Sep 28 11:03: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: 146017 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237426vqu; Thu, 28 Sep 2023 04:27:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsUA2gWJ0Vss0yGbOE0ZHlLldcWk8QyVUyusbZ2S6512frPCOR8ofZfZyXq5RkgHZFL9/4 X-Received: by 2002:a17:902:9f8e:b0:1c5:ad14:907a with SMTP id g14-20020a1709029f8e00b001c5ad14907amr750290plq.38.1695900454749; Thu, 28 Sep 2023 04:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900454; cv=none; d=google.com; s=arc-20160816; b=yMtwevI+8Xxs+QKcsysbiGCJvOEJWFK8k80E6vCtGXDtydSyhaANJLUUXg0q5pYYRi oRHk42mm1IQsx1GgiU0vLU+TOsf/tFsOlOMFK8jktfMhZ/GIYo+x/EcW1+oF/Q/w665D PC2xVnrtXM8QPcg80xyn3K2rdHmbdB+yZoE3iiKO20YsQswFPay6D3+1rIICcyZ0VLjb XoLlGJUd/KDbWk/7NDYD4h2eJnEtp4hxMYwLek9WR1aKHeBxupk+71kdMJs5R7wW09w/ dkxonZ8J3lQNMoWGTZHWPXVIFr7norULjl6nOYwe/tTtx39Kvj0eEesCDIJqasdPyNmt 9DQA== 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=BDI3QEeGos2NJvc99ZMjVwDxGVidEcLelN8lIBLpdEs=; fh=+omxPMm6LMeT6CMn/0FVSJAoSBWEcLYtLW983BmBYTM=; b=n+6tHy58upvj8Q5dU/hDKsHMChoIhnBVcEMLt4GcZ2WACxA0NMQmGXboElla1cDwXB +djNqFVu2h7kLtE/RF/Th0Twcq3mJgyR73l0ikx4ZBd5n5He18DjPneKGjYwEDJDLxuA /whQUC8/FXkKPmTj+HBDxBuX/b/G5qYSWia4R0ryhiok4idweIPRpAIgCsQdN9FtVJpj +tC/xlhkQuG35F4kJQ6KsUyopP1LPAPbeLmKYzwMGRB490ibvruVvfFhRxWTe60PKRCJ WK9cnly/UCOuCmk0nfIZhr2mCuCjJ413Q5oEm6JBCZ0QJAVRnTEJ7JOzdcViFddNnhCE Xd3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="moVKiKK/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id w11-20020a170902e88b00b001bef085a37dsi6621004plg.86.2023.09.28.04.27.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:27:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="moVKiKK/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id C821B8293C64; Thu, 28 Sep 2023 04:10:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232274AbjI1LKF (ORCPT + 21 others); Thu, 28 Sep 2023 07:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232464AbjI1LJT (ORCPT ); Thu, 28 Sep 2023 07:09:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EB2C2685; Thu, 28 Sep 2023 04:05:33 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A55FCC433C7; Thu, 28 Sep 2023 11:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899133; bh=jJHGtqvYbQpN1Lkzg/E/Fz0cjbmCSvgm8QFG3HHE9Ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=moVKiKK/GVlQO98y9FOBzTkfAxr7VMvub+EJqxWL2Qz7W4LtmXNsdmp250g6z473Z FuzrbnUyHJhrMpUmu7DFp+z20xpdy+J0QBq+9d1OXD6XnL2aVNmPODy/kStMTn5/2K IqYIAl60aXTIuNf5AIO8I/LBKw5a29C7Oa5qlBBv905V46ol1zIM6H25lL2uq7fajz KpMG1uBeQtdlBemjvH+KLuWmZ8CCJ0j1LBfaEwkbMmfvn2PTNNjea7OXWaonZpaGDL jHRbH0UfPDoGXtcpEIXOMvYpxMlqTaHK0ou85ymZULuN1GBnIfXq5svGECvggYzuAT qhTJDIouNMASQ== 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 67/87] fs/smb/client: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:16 -0400 Message-ID: <20230928110413.33032-66-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:10:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280515213697072 X-GMAIL-MSGID: 1778280515213697072 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 Thu Sep 28 11:03: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: 146010 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3236161vqu; Thu, 28 Sep 2023 04:25:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH0/o0D7/gpDlhtWhghIQ5nV1cnpyLY5lXpJxiFX/PCwactILyzsT6tIPOIvVm7IIy5Oc8f X-Received: by 2002:a25:14d5:0:b0:d7a:8e37:6d4d with SMTP id 204-20020a2514d5000000b00d7a8e376d4dmr768059ybu.43.1695900303257; Thu, 28 Sep 2023 04:25:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900303; cv=none; d=google.com; s=arc-20160816; b=ijCnnJMkUqDXRlIODadLqWMwReeXzkLE8aE7nQVAih2kztcA+MICKm+X2iqksUEQHS hhNLCNcR62xGdjjBtOvjaYJ1XF3C7u1A9mjwPbBQHKhshELD2LBNFloHBMo6QVQ9smt3 09R7gQcD9z6140MqPFpjVneCBkSBmYb26C0XYazkT/ss+sTtYK+2osKEUzD9Nw9dGkfe E5eWJYtitaqoo/r14/S9wrpdH8v7XHduVvZvLv36/0qOW7J8R3vddyZ+imqvUYzjjow0 frEFlhCS1jgMRnMumUQfK6j9ZBV1eojR7mWjLRuRj7s3qbKnt8Vt3loQ6UannMDfc0Hd WCng== 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=t0Fz6mzsGi5Ur0Y0DeesvvfOQfH6F3OB+otZ6BnT4bQ=; fh=5fhsb7mGODlpL95j/1iQ6ZPX/BoBMAWQ3hWfXH8zC1o=; b=OIDBmZ0xcgXkV0uLWlS2Xk+K0rQb9yKGCLWKf6EaYvpC6a8Bnc+gRRazIPqSW691+W go99ySYvsc/i+6vAHsTIkeixJed7SbpwGby9NiENF2OL7+he8MqEAbPDtkAQlXeeRhOp t1tn3QuMVl424F/Vgk3IB8UpMq823CVHC2Xv4gYamlHxp3Jn/iHo5SaxdWslMENYiHne Rg4D6Hu853UTuAuF0dx/2bT29l2zaW1pB5xJBR3JuIeXagXWr5F3GQdNfE5JZjpJa3MZ fnSoB2Zm0XF6iFLIZzPn6M6MAIRiycaDzYsiWD7YtpHvsKGDEkRY2UkPATJUuOUE7ju2 uz5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KfyaUQBG; 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 y185-20020a638ac2000000b0056532a83c64si18552858pgd.516.2023.09.28.04.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:25:03 -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=KfyaUQBG; 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 4262E80D6A36; Thu, 28 Sep 2023 04:13: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 S232450AbjI1LKR (ORCPT + 21 others); Thu, 28 Sep 2023 07:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232334AbjI1LJ2 (ORCPT ); Thu, 28 Sep 2023 07:09:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D72419C; Thu, 28 Sep 2023 04:05:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20470C433C9; Thu, 28 Sep 2023 11:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899134; bh=14gzqF/vqBJ7lLHQtJVC0eAe1MKwKnBy8jzKUgJf0XM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KfyaUQBG7VWCB64WApXpej0ehV8q05W0VBDKrxKlzrmtE8TiiUjHze62R5XqwD4Bu rnSNSrE/lEM9ddmWodzJNVE+tNYlHRegbdFOPTlXT+4U4ziFdZQTbm2TF/2d58w0Mc GLb3HeY9DGUAEEcQOmam3WG4/eYp0KVxn98+xpcvS/D0VoG1ukg0y/eUn7LdMRKkhS 8eZo2lq3V/A3AxvpbGtboFU/89PRMOMKs2kmB9RKGrvglQh7o5gJbTZbwumZ6sxvBP qVmA6e9U2PqQzPLYESrFSd1FPQWuFoZLpNp3iwgIVg3LVDpxQthOEsxQGczZmiX9YN xupDVTfN4xF7w== 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 68/87] fs/smb/server: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:17 -0400 Message-ID: <20230928110413.33032-67-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:13:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280356263986427 X-GMAIL-MSGID: 1778280356263986427 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 Thu Sep 28 11:03: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: 146058 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3252725vqu; Thu, 28 Sep 2023 04:58:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlFuBAg79tfRqVFEOl1Rb4+qoK21PGZyepFvEDfmPVccygNKFUiF1S3lJNIubTgkUZLSYG X-Received: by 2002:a25:cc93:0:b0:c12:29ac:1d3b with SMTP id l141-20020a25cc93000000b00c1229ac1d3bmr891074ybf.11.1695902282308; Thu, 28 Sep 2023 04:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902282; cv=none; d=google.com; s=arc-20160816; b=a8yU9xxciaKCHeUGjq4whwHGk5MtE5HqcO7+eUX/+vSXRb/KZ2uNgxCBPoG4lCzex5 1fYM/AtcLpTDQ9zkaE+NGF88iTE6bly5UA30JLMmNIoyYYOuOE/bp92JEjrSPE6gM4O6 JUuCkpsssk3OkwSlT9Px5gppiXgn+1PJXNtLzXmGCYw/3TSas2peqhb5m42cT4+tzNhH DcLuqzJ9BET02goeQarrrxZShfik+FgOeEV2hE6wKuxrE4TU2VL14x64oeZu5GGDzaDP 0j4wLI5S6zdqg2eawW+Wwk/c8QzjeFikYIX4bOwwHSYrxobyvVZWcsYCj4IsH9wfLFrh UTNQ== 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=rAKTGSOxQQJNU7z/ZUyyoGLfYxTvQ4LTQTc8AxnOId0=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=TEihCRX2N7So286UhoT8QhE4slDGwCA9qW/Ou42vImK8ACLKSMlO0Mrncx8sbGdNEc tpOZIdV8rjxJ1P0dYMsmqu39pTYJJtXj4zsFRZxAX21Eu5O7+GjYU034/lHRF+W0nCfH 7Y4A8skD4F0TcHWM+iacrwHMeRjHOq22MwghkCSczj5Nw6SsENO96PRjZFX6FEJKIvnM tbZU7fME0aakhdcgyXWy7tVwZhRsdj9m4nby4kTm4svm4eAUHzkInw9LNoCta8Q7UDep x6jGr/G2GoRq4lMhZiAFyl7S3Xs95RJFPCcwuoYYYe7HcxJc+aU8eiCyzlO4ukixpj5j Cl7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mtj0L/ZJ"; 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 a13-20020a63d40d000000b005780c629ec8si18223814pgh.617.2023.09.28.04.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:58:02 -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="mtj0L/ZJ"; 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 8AF0A85A040D; Thu, 28 Sep 2023 04:11: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 S232434AbjI1LKO (ORCPT + 21 others); Thu, 28 Sep 2023 07:10:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232367AbjI1LJ2 (ORCPT ); Thu, 28 Sep 2023 07:09:28 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1D8D2695; Thu, 28 Sep 2023 04:05:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51FBBC43395; Thu, 28 Sep 2023 11:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899135; bh=GSs8K8rj3xzkDUaqDpXTyJe0zo505hLTnO0gJr9PIPk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mtj0L/ZJ/qzHWjTrc9MXWSJfQ9JrpD7MdhmTRu0lO/CCc5iGSY5LayaO3flGWTqY/ 2Sba3ihZLTVgQwniR6UcDadWcCUwm0Knx4zMHy7jG/1SI2x/ae/o5itr5/mWFiPxer dC6UKJwyo5EZrDjOWN+oLXuU8YNGCg2Tq6+/cS2t/J8YunoTtNu36i2iUBLsaOVIZV EZS56zJud6xC2eoJ2xmtLlnX6QJ3OJZ0bp076zFHpKAjD0d+dqrzM4EgTrQv31Evr6 mWFGkbz7mGVQwATSHC2/HVaICTDYcLXyh5rFk9kU4BsaqfReJMN4cc2QpDYZmbUDOP pibSUN6122c3g== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 69/87] fs/squashfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:18 -0400 Message-ID: <20230928110413.33032-68-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:11:01 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778282432020786782 X-GMAIL-MSGID: 1778282432020786782 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..5e3c38eaca2c 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(inode).tv_sec, 0); + inode_set_ctime(inode, inode_get_mtime(inode).tv_sec, 0); inode->i_mode = le16_to_cpu(sqsh_ino->mode); inode->i_size = 0; From patchwork Thu Sep 28 11:03: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: 146060 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3252739vqu; Thu, 28 Sep 2023 04:58:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFn3n2TzTNxArkwiIies9+59j/+NyVZSObd2FVk1s6z8tAprI017xo4eQMoB8tXoAzLnw41 X-Received: by 2002:a17:902:d4d1:b0:1b8:6987:de84 with SMTP id o17-20020a170902d4d100b001b86987de84mr1290239plg.48.1695902282830; Thu, 28 Sep 2023 04:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902282; cv=none; d=google.com; s=arc-20160816; b=aoXWSGuIMTs1RR4ZYaWuMXzUk3qVOV2NE+ChF+cRWcG3jjWGlUbKASC63AM0/9d8y4 bnqOdLWdyTi8WodfPys+/zpCYhmqterhx/oAOT1pxp3GTq+H6l1DVhw9+TRlOPnbZlmV 9jGQdtNAU7ix1gMtXUH5XmAw9+HmT6rqjkjmbyS9YNAqwnpKqUFImuVL05NfrAtvbkMx rbnn7PUncCLaiIbg+YGfP6lO+V84mpLodUg53XX+SjaOq/La21dsHvRqzGcGzO4zUFPk g5ALsF/Mgfa5p/chVnkyDxbMrNgLdEYmlfSLB3UNFz1j5uRciBvO4MplzdDWuZPEwLTZ gUww== 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=mN2zI7hmmk0OaF/sDp+7em4cbqQjvzrbeVvKlHh3NkQ=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=E0X8o7Zn3Qi9vi//uNMRNtnk1CmTBgGu9G2Bof9uiQwpmOe2E1je0duhbxT35X5MCb cKytZ/8mBlOpZZgf37+JpWG30YKIX5qdFqF7YYgmjQ66cPqAUik7wD5bHpimJfpe++Fr EU4J2fdjtv/rSG/OKJvBhV+rSDHS/3kZ1FLu7ufHAv82dqdUgVl+phtOG4USXyunmQS7 osBLfF1Q4aI2eFLuaI6guen8cIdJEH6gbQHl3eu7eeqVSID2JIvpgjtmI5p5BMsf2h9+ BPAH0uOY1xwpobLX/SHJJHgsH3vxLDvrJtmGsv7EYJLehqgBkb17MlF3jPrnzKFxQ3rN t3FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DHN1zSTM; 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 ij29-20020a170902ab5d00b001c7218c4db8si5903686plb.119.2023.09.28.04.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:58: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=DHN1zSTM; 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 4B0F885A0406; Thu, 28 Sep 2023 04:11: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 S232057AbjI1LKg (ORCPT + 21 others); Thu, 28 Sep 2023 07:10:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232290AbjI1LJh (ORCPT ); Thu, 28 Sep 2023 07:09:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B3CB26A8; Thu, 28 Sep 2023 04:05:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FF0BC433CD; Thu, 28 Sep 2023 11:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899137; bh=hlr3TuYXADCwXim6mrb06nRfR5jkoWz/gdSaebmF2Wk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DHN1zSTMmlijWdkQdsxILM1rMD6qm/KfhRdJ42/vzxS3V+NcgFL+2g1ejKwXc5v3z XUVf2sB4aQNaity8J9vOZG8yRp0VjM2q52tSmDoMbBiJdDweFp94TdKbsHyt2CGSDS +V/DTt2NVv0dnll9nK591330UW6kkOGnbkLUAsDDK+oh3C89kN2xkq+rh9KLQXYN0W z2Z9etLeDNjf6qlLlbiT25InrBlsE/c8GPQCo+R4oVzG4FcU2zX2XH8evG0BChzpFN ncL1f9sPkRW0B+g/hCoQ33qImFPztdvTERVHkhMEIuol5Gg02Y4hwAdNfQaGe7TGJJ j/uAV0kIlFQ7g== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 70/87] fs/sysv: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:19 -0400 Message-ID: <20230928110413.33032-69-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:11:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778282432103773676 X-GMAIL-MSGID: 1778282432103773676 Signed-off-by: Jeff Layton --- fs/sysv/dir.c | 6 +++--- fs/sysv/ialloc.c | 2 +- fs/sysv/inode.c | 10 ++++------ fs/sysv/itree.c | 2 +- 4 files changed, 9 insertions(+), 11 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..8b7977f39722 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,8 +251,8 @@ 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_atime = cpu_to_fs32(sbi, inode_get_atime(inode).tv_sec); + raw_inode->i_mtime = cpu_to_fs32(sbi, inode_get_mtime(inode).tv_sec); raw_inode->i_ctime = cpu_to_fs32(sbi, inode_get_ctime(inode).tv_sec); si = SYSV_I(inode); 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 Thu Sep 28 11:03: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: 146059 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3252736vqu; Thu, 28 Sep 2023 04:58:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKxWt0Zvl8pU/dSE24KOqUjxFukxTF7Vw4jcvkVhcUKlDrlLP9hp2dTQh5nPhPJTBNkUYl X-Received: by 2002:a17:90b:315:b0:274:8e3b:27cd with SMTP id ay21-20020a17090b031500b002748e3b27cdmr787260pjb.14.1695902282637; Thu, 28 Sep 2023 04:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902282; cv=none; d=google.com; s=arc-20160816; b=yxGxw79/VQmxjYeg0afu58dgwAgmB6EJSJtVvqn2v7W/up33e73ChyaavZxDKR+h1F dGS4wrZ9uv1cPnol6Trz5SOlcJXLsSHWHa81Lqw8fDbGgdrd36ArlWKWGsJA4ViN/+uX bOy3iRbqfnBZ9Cot8Uksjz3km9+BnIcXbMrU2qO5gRMNr/q0ei+GS0nCYxRViTyDgpk+ AyrSbnzv3PSx3oZFZog2fRpgOgqScuh5Fgf7M2ousTF22yuRd2Ju16ylPulrqLvrjMhd /fBgWTOUClxZcUyFdXt+FH3uJ4IrsLzN+mAfJjZT/10lu78kyS0dsqlFULPRnqruNq7s lHsA== 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=tmozQi9jxad2YEEdpMh/VOqdgWkgYoo9QrE7uFhTAIw=; fh=YrYPsgI6aDgoToY9/x6NbYk+xzgS1IfwawNeKZWLDos=; b=gl1zRkp5gIvAyUO8yath+kSY2DTvxSpE/J5C6kOg03F21zXqUz7vthqJt9hrRIRaaa B9ds6+tex3FJjLde0KDuLc40zP62T3krPj4C0eF2gIIeThZvAApcCjqrn1+iA4Lw+CnB hCuGWHIkMtjZRtx0g55rzj7+57/5pYWn7DnN1aTNPog9zW45xIRqREMe7YONiZ/gPwOf Ebkd/YmCKISF9wmzAdHePF8TgCURtYD7eCXYwIOooad573nCwqT5NsaPCC/boVbSSXqj Vm6Ptu2NKWvm6TfyIuetGy807L1nh8MgdJdyJpp5TLo8Hs0ZIPumebiX5Fs2fmKbrVpz xZlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ijFzJW4c; 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 f6-20020a17090ab94600b002772b8993ebsi13089105pjw.159.2023.09.28.04.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:58:02 -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=ijFzJW4c; 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 49BEE85A0403; Thu, 28 Sep 2023 04:11: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 S232145AbjI1LKh (ORCPT + 21 others); Thu, 28 Sep 2023 07:10:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232294AbjI1LJi (ORCPT ); Thu, 28 Sep 2023 07:09:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 690CC26B3; Thu, 28 Sep 2023 04:05:39 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72987C433C8; Thu, 28 Sep 2023 11:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899138; bh=zDn/Ij6TBtWvdCEvJTtOwehmMOvptapRgeuVaso0uSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ijFzJW4cuQ9fvepQ4QbAqhY1xHi6FqUvrxv+2eCHi3q0Aey0DW/VtkRgLjR7RFLlm 6g5j2UNO5bHQ0X0IlPdoFEZG6QEjFdvHs332J2wWEx7BPFM0QHhY0fMLO1MF9hLHal sNmFtjcM1PWglRslerRWQHMrAKUYe4hK++c1uwrmmSxu+kzIIGBOZB/cchtyk4QUTr y5pchHnyq21q/6/2TPLBnB5JWm75TRVCX50ZDLKTwYPtJPAhFnLUdf0lIC+mlfUD13 QcUec2b3lIpXTPHDSbnlioAZuQ9UI/OT83TkwubLCNKTKgZfFN1vvGMVxxKHRgDh2T EjoRzndctc5PA== 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 71/87] fs/tracefs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:20 -0400 Message-ID: <20230928110413.33032-70-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:11:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778282432010380863 X-GMAIL-MSGID: 1778282432010380863 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 Thu Sep 28 11:03: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: 146030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3242126vqu; Thu, 28 Sep 2023 04:35:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlgXOa611vbg7FTFFOJAPETZWMlv6FmnvAqk8VeGd84BfynKlhJw6s56WHCi8ykKnugJES X-Received: by 2002:a17:90a:9f94:b0:268:2164:dc93 with SMTP id o20-20020a17090a9f9400b002682164dc93mr811013pjp.13.1695900957496; Thu, 28 Sep 2023 04:35:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900957; cv=none; d=google.com; s=arc-20160816; b=gCV0o7853YgoQ9NmDJ9MTDOU05qipB6//ycVACh/yADZTczq9W3qEq0xlTbV9UH7Kd q34QTwdZP2ZahxD6EZ12aUrIZ62Bov16IgJ3URbEA3b3TfT34gTBS/WmGkrEYvNTp125 9ixsZF2QfbIRqT+inoOjjYcUXRznYYjAg4+1ozD6U3cvRIyQbEe4IIUT/m+cZFauhJ63 7FaXd/1xm9T//7ONv6PfthcLHXJNSVk/1w8X+lm8BbNow0EyXXMGJ2yl/oh0VD2hY0GW YKEyGcD1+MBov/DBvRDpUuPon2esbdlohqvTyjfAlC+XKjoVM0co9+v89RqhXYYAJgUB cQ+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=Szal5G/ouup3IgYf83PuINEz+10mRoPCprtIfJlq2Po=; fh=9dbp+PVfJHvhQ2T/xAbsquROFmtfn3Q6xzmielwCmS0=; b=K4KtyivppitIy5xw38j0zDCz1MfDHRgOtxNNa7eXS0P/LULF+wEVdngUOJWmlWfrpB z014s+sEAWhiuZmR+sWZOxY1MdUIAOC+7S1Pe4xcjz4660ABqAtcxOH12t1V8rA3gbzF J00Pm3cpallrGgBXw6ok2c3+Ds7VHecAa3bWF9gdHD/++yYU6kRN80yLrjk2TsGtMwpv lS4Y4p0fPbI2hy5ePDSn62PfcsNR+mHUZc+fj17ndDoWF+IfGqyAWKhZP8u+wcVXwBL9 anj9fpLp34PupTP3M6AAJB28csYt/bSQ9Tyb19Fc8sHqQnPqTXAviPU8UVhttgnZusp2 JFfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aBWgry+M; 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 lp17-20020a17090b4a9100b0025bb4a1c12esi20587040pjb.148.2023.09.28.04.35.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:35: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=aBWgry+M; 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 780E2821E18D; Thu, 28 Sep 2023 04:23:19 -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 S231853AbjI1LXI (ORCPT + 21 others); Thu, 28 Sep 2023 07:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231974AbjI1LWr (ORCPT ); Thu, 28 Sep 2023 07:22:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D60B42713; Thu, 28 Sep 2023 04:05:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E21C7C433D9; Thu, 28 Sep 2023 11:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899139; bh=cv9SfrcWZVkYk2VwTVipTu4sbLCE/zDatfr5PCjqSsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aBWgry+MO4CAf8ojhH5BUiO+kaKaN0QSsdwxd/10AFlKcGJqs3K5H7OpSGFJt0ff7 zQLqXY+djgEUh96ZgrvVgMWBdKiDWAdLLiZoe6ak1cuQSluttx1lOPfhaeU8N1cRyB uf4d1OTYSe2adQMAaOWXYZzqCFm4goKmKAf35sukCRoXD/UU4wTrUd/3svGHJD6drS 8F5UD3aaykDkCsNTSM51LQWIT1h+oFkeu5HUPp+tpXxk4gspkrjJfcz2pYkBv6+mbD s+l2O+THemnyOGnQAOSddW6M94NpYX4Ovg8glIfK8hv+K6QFiayIA4QbXuIHB/mBQX l0k4PrQvJ3cNA== 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 72/87] fs/ubifs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:21 -0400 Message-ID: <20230928110413.33032-71-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:23:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281042142186580 X-GMAIL-MSGID: 1778281042142186580 Signed-off-by: Jeff Layton --- fs/ubifs/debug.c | 8 ++++---- fs/ubifs/dir.c | 23 +++++++++++++++-------- fs/ubifs/file.c | 16 ++++++++-------- fs/ubifs/journal.c | 8 ++++---- fs/ubifs/super.c | 8 ++++---- 5 files changed, 35 insertions(+), 28 deletions(-) diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index eef9e527d9ff..ef9c39e3f39a 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -237,11 +237,11 @@ 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(inode).tv_sec, + (unsigned int) inode_get_atime(inode).tv_nsec); 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(inode).tv_sec, + (unsigned int) inode_get_mtime(inode).tv_nsec); pr_err("\tctime %u.%u\n", (unsigned int) inode_get_ctime(inode).tv_sec, (unsigned int) inode_get_ctime(inode).tv_nsec); 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..79d148357f81 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->atime_sec = cpu_to_le64(inode_get_atime(inode).tv_sec); + ino->atime_nsec = cpu_to_le32(inode_get_atime(inode).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->mtime_sec = cpu_to_le64(inode_get_mtime(inode).tv_sec); + ino->mtime_nsec = cpu_to_le32(inode_get_mtime(inode).tv_nsec); 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 b08fb28d16b5..366941d4a18a 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -142,10 +142,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 Thu Sep 28 11:03: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: 146021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237923vqu; Thu, 28 Sep 2023 04:28:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJGfVB6WtBray4qH4MsMLXISZBCQsR7LgxbNsbske8gJwspJvJljaz82I2e6y7BYx1saUW X-Received: by 2002:a17:902:7d92:b0:1c3:2532:ac71 with SMTP id a18-20020a1709027d9200b001c32532ac71mr807161plm.31.1695900518253; Thu, 28 Sep 2023 04:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900518; cv=none; d=google.com; s=arc-20160816; b=S0Oy+CSYutXnEArlBTglIy6VHWNEDkUHycpx7KcJfBRCJZQi9kn0wmcwqd+FNrmJN4 uOXn48LsUMd9PTHOkWZ92Z7RIRxgvsnupnQJOiPrP8tksOkfX6nVN/hNASrSvxFThE6u nLDLupniukdUnLTmCiX4t03sfm9wUf4zGSL1/zkpPpUF2/70+Kub8DWY4iaUGPcMBrpn Ebpqi+IKmgJWkiV5UnA35WAaApooqa3eDVfI9VoKETSFVfcUKb2Xaz9bL810LwInkyMF gzvI+q/GUcolz6YkIXJZ6Lc5JQoDX+3TGgy7Jz/67XErYSTrPV3sN7k2TLiQEdlzDw1s 4+iw== 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=x2M4wz1ST/+lBPzknQhinJ2OtCwc/Bd7+qCpMNyBAck=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=luEWZgP3FQ8/u/kb/71ssFoMEq8uNY84NVng21Z96xhDnA9nDJhp9hZahezgLI/i8a FJsQUciZhV2Ep1n8Zr/Ec0ZDIMmVky4zfxdF7mLYYkYA+TWK9EYDmcFrm5HdtjMBSXjw I8buG71bi6mNSGxuGke9l3tMPRo5EwHJ+tHM0uEDqr9o9o1Laz8ixIjzWt4KjVCHDE+x fI5Eoo6/EbMzwcVl67GdqG8h4RJ4BH2SgjEQTio2Lvu7YWT/vArgjAIoASt3VnbMk9iC Xmt2X95gfueEYWQkTxVx6eiXoLlBfhdNjArL4z1ZC+qrBxCP1lnthMz2gSU9kZ5XRZfd Jxog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LXCpuJUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001c73f364120si150714plk.407.2023.09.28.04.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LXCpuJUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 85E3B8251551; Thu, 28 Sep 2023 04:23:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbjI1LXL (ORCPT + 21 others); Thu, 28 Sep 2023 07:23:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbjI1LWr (ORCPT ); Thu, 28 Sep 2023 07:22:47 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAD912704; Thu, 28 Sep 2023 04:05:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26AEBC433AB; Thu, 28 Sep 2023 11:05:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899140; bh=EETefCC4PhJP5eqMugpUBPNyeKL9S9OpYWxMmw5MjD0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LXCpuJUeH9PEnmpKwiVfopj/Q6aTMU6bxwUvNx+C1K8sab0ITDY3zapTRuo7c27Qv txaV4jwIEybdz9E/JVFgfIhyM4Xda4PyYjQTvNvgKeA8YOPKh7uu5qlkeCkBe2LLlI OoINeKE8yPkmW2oqB5ToBNbhVQA9mw98SdhMctkxmDx9oCTwBR0qYz2ZyUPFAAMiIl JwNZjo3CV4v1fM5Juc9cQpiQ+zKN4cPf6x/UWna3lkfA5ghTmVAHskBR3k3jmBaCpi 9nG4h83VqiFmUaJpd1rytFf3yu+SIgQw60fVbO7CSr/6ItvOUOmFr6AxEbXaOy7m80 Fl11VTRgHm0kg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 73/87] fs/udf: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:22 -0400 Message-ID: <20230928110413.33032-72-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:23:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280581756165125 X-GMAIL-MSGID: 1778280581756165125 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 Thu Sep 28 11:03: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: 146042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3245851vqu; Thu, 28 Sep 2023 04:43:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNxJH4KBsfnxWJaV821pJDNd+h0KBPj7UxMtxkKi4W0xUXTKlWbyQTYKXvCm0l4yATZicN X-Received: by 2002:a05:6a20:244e:b0:15e:71c9:7d47 with SMTP id t14-20020a056a20244e00b0015e71c97d47mr898005pzc.26.1695901413543; Thu, 28 Sep 2023 04:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695901413; cv=none; d=google.com; s=arc-20160816; b=bk7e7SddybF8/5au0UOmu1txZdd1omgALCneJPUDRSahQu/0xIYAqo/N0QKz/d0ZGn fje/z6kfLGy+bL9l6B1qza/42rSECmbE0HVsNN/wR7FDB2MxroWb2j3Dk0/UMl37AhGI mPCcMM5M74+Kjtz2g25C8VDICljnq224RTqesrZrI6RT8v2Nub7vEZMoZLCUCB2/MV0k C5Q6hW9fuaJat+b7rFPoDiwbFJQgClmLTfQ772LG7/vuNDYuJSo859DtGu9meT76IbUE HESEgEVxC6H9YVligdGoz5elCQGbPtUKbK9zpmVJHua7DYEPLvOqbTzavJX4mzDdKaYe kv1A== 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=nypR/Fn7KNgeKqroMSPhMoKJ2AKn6Y4FJQkPlMnl1bU=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=aH7yjkVh3SxIzSoOKBxcRkhjmUcXO4j3IgRW6y/7LHZ5qBmo1lfcq9v1l/9CAJrKFk LnhbvVN4/yRN1RWb/GK/DAKRJKr0MtMaIEommCimcTofQQG5+v9iFCmuv7gaCSmx4mdQ p/x/Orah4QS0b/sRyA8INXZEczFL+S7qkUKbSL772NWXvIrLnu2bj7fybgW5RZ4MZI0Y ROAlsCDVvPQ3UwXELLIzhk796HWmsIHcgGaWZb6tJ/OQfADgDqGkobksuzpmTmR15puV DgSR2lJHVVU9QFAHGsdu8oYCskLT8bWtzCLD/0ZvSFW1oHMA/VhvIEUWfB+67U5cgm3e etPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P1gxXFtd; 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 y6-20020a17090a600600b002775c9ccecasi10418246pji.127.2023.09.28.04.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:43:33 -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=P1gxXFtd; 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 D339F8060055; Thu, 28 Sep 2023 04:21:13 -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 S231869AbjI1LU3 (ORCPT + 21 others); Thu, 28 Sep 2023 07:20:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231877AbjI1LUP (ORCPT ); Thu, 28 Sep 2023 07:20:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C944136; Thu, 28 Sep 2023 04:05:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51AF3C43397; Thu, 28 Sep 2023 11:05:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899141; bh=qg86FZNr5F1kC0kQbL28OzdqO1g+rILtRqAFwmKFQeI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=P1gxXFtddzzOFO+hlnFWfznI2+IOLQ1aJKstS4efgg7yKFyajso2PlB14cMQ4Rss6 CeThrOPz3EPGMdB5KntuIX+2m0VoH8KFShBrlXrVapgKNLuUapcOIOPZT9ZWrG9YSZ j9MZHg9IpWsojexoHLGKcyXJuVHO3FLpJey/9xyNLxk92et1olZyTJeffCJo+mhCJp VF41C4kzESMOP9hiq111oxnOyRsk6HejQePXLDwKl4390sK07me/idBqo/DK06QSGX pNglRqE3lJdDKU87IFhIaY2F4WktHtnN2P0Ch06XoXYJUTDpcFGnB2eHvac3xulA40 Wfokk8DC9Uv6w== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 74/87] fs/ufs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:23 -0400 Message-ID: <20230928110413.33032-73-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:21:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281520743121387 X-GMAIL-MSGID: 1778281520743121387 Signed-off-by: Jeff Layton --- fs/ufs/dir.c | 6 +++--- fs/ufs/ialloc.c | 2 +- fs/ufs/inode.c | 36 +++++++++++++++++++++--------------- 3 files changed, 25 insertions(+), 19 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..b0877667940d 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(inode).tv_sec); ufs_inode->ui_atime.tv_usec = 0; ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, inode_get_ctime(inode).tv_sec); ufs_inode->ui_ctime.tv_usec = 0; - ufs_inode->ui_mtime.tv_sec = cpu_to_fs32(sb, inode->i_mtime.tv_sec); + ufs_inode->ui_mtime.tv_sec = cpu_to_fs32(sb, + inode_get_mtime(inode).tv_sec); 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_atime = cpu_to_fs64(sb, inode_get_atime(inode).tv_sec); + ufs_inode->ui_atimensec = cpu_to_fs32(sb, + inode_get_atime(inode).tv_nsec); ufs_inode->ui_ctime = cpu_to_fs64(sb, inode_get_ctime(inode).tv_sec); 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); + ufs_inode->ui_mtime = cpu_to_fs64(sb, inode_get_mtime(inode).tv_sec); + ufs_inode->ui_mtimensec = cpu_to_fs32(sb, + inode_get_mtime(inode).tv_nsec); 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 Thu Sep 28 11:03: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: 146076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3264966vqu; Thu, 28 Sep 2023 05:14:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGV2ksOYRqF08Ui7V0o8JHBCWWg6WZUChdEgWoHoJ0ntnBKvt/ww+u14xMWeUyfNqKLCaVL X-Received: by 2002:a17:90b:4c4a:b0:273:efde:2ea4 with SMTP id np10-20020a17090b4c4a00b00273efde2ea4mr879247pjb.42.1695903258666; Thu, 28 Sep 2023 05:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903258; cv=none; d=google.com; s=arc-20160816; b=S9FdFpn6n//HQxo4zoVZ6qRvlZjLWp0ewmOOPJFqv2C77Sj6BsjkGjczvXUhqlE992 N5deH8LAB/XizUKbWtgq6+Aky9fJc8MdBu6arP9CibnuG1sPJkN59wskv1gxDu10CMJI n1vpjEWhU63QD5TVadimTVcB+0wbDo9wKj5i2h2ln1raRTWHRH/8fD9yybihQ/wrV7Iz Pnh5VtQXMhTOx7OPuGtC4+/iV9L7VE0XSiTGJN/1mQ7q99/EYcrR13I82Ztksg3drdzg VtFaGPDw+YubstkFNxUiw1AWjJfvfZFehQeBDJ9SGfw9Rr6wEJIGFzK2bZ85ut5zDXv0 ETwA== 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=Wu9HZ5zZX9PCCltzsv6UdvLVH6PKLL1EessvGUjQMag=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=nJIZDY1f3eF9jw++y8zVRH00KQ2SPwFScYtED0mQac7URVCbIrzqZU5s8lYR26dV9z jP1LBelClihV6Dvsj+BpIj7Yfbn6ej35RFwpOALU/6JtPDIqwKD4AVVlUbfDqe6KKmne c5IM/2mQByKQto5N2Y/2v2rqZOYza0Koa5g4Usqz07R4BpHy4TjpGbjrelVKrmB70PG3 WtPwHMo1e+mZzE8J0TDgWz74CdbXz+Tz29ZzTsUJsBq2D3uzxQsTYonAl6nbGtqvQ0Mb 2k81kx5xaaTXbGLmyp0XgV/jnxnph4llhJ9rqefcoyqkoAyWUPnAHgu5V86YMFQ1gsF7 E61w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IXmIq2lN; 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 g10-20020a17090a7d0a00b002632a1243dbsi10045879pjl.104.2023.09.28.05.14.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:14:18 -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=IXmIq2lN; 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 22BC3812A956; Thu, 28 Sep 2023 04:20: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 S232412AbjI1LUG (ORCPT + 21 others); Thu, 28 Sep 2023 07:20:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbjI1LTv (ORCPT ); Thu, 28 Sep 2023 07:19:51 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CDC62D4B; Thu, 28 Sep 2023 04:05:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F98C43391; Thu, 28 Sep 2023 11:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899142; bh=9I3VHyY35UotQhyUrdlY07m/1CcXBFl8HcZX1pCcZAg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IXmIq2lNI89BP8ueuoBKzaSvH81WQbpDTUJc/EW8eTXoGoLVK8LICU3B8YGTRtzSj 1N8/xtJy/GZ/sMWvb1rhwpBD4mnmRwjk0vy5aVeiIyQ0s2D4DYY50e9Wf7s/TOrdOX PKcVbUB7Pd8uVaE1xnCFHJf7vm1ug5x7l1LHVAVJuhS0c+xN83wGgKLTAjWJoUqpd1 JHbKLr5iU8fsddqBt3+/+SBrcPtm42PIfMoT1nsMoe1N1Mo6iCizAHoDjS3zA0P6Ao 0oedckcqSp9FuAPa+yJNf6M48VlT/Hm5a2zwplR/chg2jUyISsRmcpMbooy936jDo0 l7lEoPq+UXO2w== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 75/87] fs/vboxsf: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:24 -0400 Message-ID: <20230928110413.33032-74-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:20:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283455650867902 X-GMAIL-MSGID: 1778283455650867902 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 Thu Sep 28 11:03: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: 146040 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3245195vqu; Thu, 28 Sep 2023 04:42:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBEde26TT84lunOSLZ8OFbwwjEwsrKS9On2lv97/87gCL0ZYaOuybOuGZwEkblAutXTacw X-Received: by 2002:a05:6358:2794:b0:135:85ec:a080 with SMTP id l20-20020a056358279400b0013585eca080mr897553rwb.32.1695901328320; Thu, 28 Sep 2023 04:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695901328; cv=none; d=google.com; s=arc-20160816; b=mgEP3AMByg8v/l4Hc+Ah1EAavsQ5fs0jAas8I57WGwoFUXekT1dD1jA2nvA6Yux7rP kkaXw0RyaqtYSICJzC/ddpxSVxVbNoBigyZIPAgTf6PpzMoVLSWXnvRxQONtAx++iqyz N3KUKkn8iQOuBo6Cw6svTrO9kty8LcTr4E6puc9W0FTc+SkhemlYUS+vipTzTRbSOqYK FPzuL9KLgkiebLRf5lOFAhOZJ+MF/Cr66PXUf8mDP30iQxTdjnArKGscqp2P7585vVvS uydUuRt1SrmH5mBZGTYYEDH3OxPGKkbHgBH8b34NdN6UW35tLTYmKeMD5S7ipw/Hx86v T8gg== 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=CA4aSgxew+XYcAO7YxraiNCpxFTBVjSpweihA8zruMg=; fh=UjFDZgIoGRf1xjRPVQNYcJg+7dmGrO7W0xsuCCC32Bo=; b=km778eblvCh7xQoZ4QTUzxUX8EGHrePumot1sF3lyEHqLromgxs6jJubYoM3173Xlv Ohzrvo4jzxPRFEDss0b4ISr9XNIEjklIj7zx2cM+tPHXvVY6JcdlkXadbkPlfQz2xyzR O2s0kRkEdUnRyuhHzTk5wHNcqVelv8aUAQRcOqg/rUxxYad3Zf1ypz0YIrAEQwP6ynIf PsliEak01+idai3BndbH/sgrJrqF0N69kATI5NKSHQXhkby99bn+Zg1HiaLgPef4Wr1H tWeew12ldScEezjT/PgFv7ngPDDXAbO0F7TykEdg1NcvvGlm39Bc2j2MV8yrsaEs3lb2 hzSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MZHp58+X; 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 k6-20020a6568c6000000b005702c84e4c2si18204668pgt.508.2023.09.28.04.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:42:08 -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=MZHp58+X; 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 0ACD08067A72; Thu, 28 Sep 2023 04:20: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 S232200AbjI1LTj (ORCPT + 21 others); Thu, 28 Sep 2023 07:19:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232011AbjI1LTJ (ORCPT ); Thu, 28 Sep 2023 07:19:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AFF9273A; Thu, 28 Sep 2023 04:05:44 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E12BBC433BA; Thu, 28 Sep 2023 11:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899144; bh=Wcf668kRQEs3sIAlKgfAtq29VgWZ3xcrnyPXXM9v82g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MZHp58+Xr18YTTsgmy6x+hztLOs3MVfsPYPqAIHj+iqzodeWVwGq9bqKkJmxAAvnn D9/jNuZD2IeDPCzbEt2wYNgm7A8lv3VMzSH+AaAWIqsfNrNqZTZTDF3dD+cottXo7n edLzm+hYvB4QIeB504Z9/wB0FTLD8KS9ksa46rP8TKfw0faXGdcAQ54QdiZFELD8Tu d0IkLDIlL49hZEOyWpgK7+N1nC7N9+ddN2Tt2vTkdB/PmpQIpPSxRuXzRtSSyzqsyX D5/j3cupguxwkvc1KrgbJ3yso3pi59CDaUjZvZ32YBBDceilU43EDDs1qwns6L3wtt M1kPpyKWtVIcw== 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 76/87] fs/xfs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:25 -0400 Message-ID: <20230928110413.33032-75-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:20:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281430833763156 X-GMAIL-MSGID: 1778281430833763156 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 | 8 ++++---- fs/xfs/xfs_rtalloc.c | 30 ++++++++++++++++-------------- 9 files changed, 44 insertions(+), 35 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 f94f7b374041..e7600f6d3dc0 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 ccf0c4ff4490..38f5a2be302f 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -105,10 +105,10 @@ 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_atime = inode_get_atime(inode).tv_sec; + buf->bs_atime_nsec = inode_get_atime(inode).tv_nsec; + buf->bs_mtime = inode_get_mtime(inode).tv_sec; + buf->bs_mtime_nsec = inode_get_mtime(inode).tv_nsec; buf->bs_ctime = inode_get_ctime(inode).tv_sec; buf->bs_ctime_nsec = inode_get_ctime(inode).tv_nsec; buf->bs_gen = inode->i_generation; 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 Thu Sep 28 11:03: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: 146062 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3253149vqu; Thu, 28 Sep 2023 04:59:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHi4GftXWyjYcXiANsW8QoMH/fPDtz0p7SZgG+UgnUZwBG4Q+y4bWNJL5SgPMewepcaNmLf X-Received: by 2002:a05:6a21:7783:b0:15d:e68d:a850 with SMTP id bd3-20020a056a21778300b0015de68da850mr896360pzc.29.1695902346954; Thu, 28 Sep 2023 04:59:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695902346; cv=none; d=google.com; s=arc-20160816; b=HAhC1iU0FSlHuZ5VY/Z28SWNRgw1onpFXkv+P9T36Syvm86h/oikv6QmnyE27X7368 1Jg2mdaG51a64RejafJAbd3vcPsSj6oigdVcqvMFFI7Ir0lf/VKwDAT99bCxO7HIy71D Kx+a/Uk6fbzjKWpuAMc7LtnQCWhxkSGZh/vPecATSkqhWeCrpmm2POXYYEH2HGDClQMI iSoutOSd0//m8KSWKaHM9kymj1bOx3ChiHmAaIWRqNLSaWLnV2XQjQHr3zEqQRpus8pm ArFwrQWUnZbeIMwnVm5m8DGFX79oNKNZlqC4gFZ5EXnPnh71WO48r1+s3IMzWzTgTSqw p8TA== 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=X/fiSlydr1cybYlcmV12YEcX2BfE/eB/w2jJLp1KKt0=; fh=KZ2Ejrdjn3st4YZfYh/U6JH5wVhYC1lVTNFXDG/+XsQ=; b=t2NDBx2L3kKdYICVqoO/pC4Jz3a8u15LBTCNkaQVp5H+0i1TF4nXj0qWNbvfsfCr6I lll9zeFRL53bwHzD5RK9iuLlFKpLPK74SsZRpX8fbJ6wZwA++utKhuyY2nPjQ07kc0SO 8sAP5FXxJlmP1ZadsdDNIe3GbSWdwqs+DlQJ7WdzdvuD/BVKEdqyeY9E3WIvgyqWYLWB UY/bdL1lXyfjx9pBiClLFCoVdma/0Avfn0G26jllq2K2N86L13p2BavT9k8R/2I1HBuJ yh+YkUXd2Jnrbg9KP/iwCxYbuo9eNeQYkgfCUxpjpeWL2DOLJ4SuSyg0aCX65wXQAZTc oSCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MFe0YWnh; 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 a73-20020a63904c000000b0057884435a7csi17423937pge.292.2023.09.28.04.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:59:06 -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=MFe0YWnh; 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 E0C73853A92D; Thu, 28 Sep 2023 04:19: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 S232032AbjI1LTm (ORCPT + 21 others); Thu, 28 Sep 2023 07:19:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232018AbjI1LTJ (ORCPT ); Thu, 28 Sep 2023 07:19:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 221E52D6A; Thu, 28 Sep 2023 04:05:48 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EB49C433CB; Thu, 28 Sep 2023 11:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899145; bh=kDD770rcYrkIWsan1bLDTDkXiPkbBnLU7OCnjmn7X9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MFe0YWnhGqAih6g9LXYbcn84RWrbun1ZpctoHzGu+t+jXDKW5Ei8hWmm1+km0gawC SbtiopF5ZN8u51O+ayLfiMVh7dwUcF1e3a7vMJVKYyYY4X2ZuGn4+9AybUAPWkOZAI ntW5ad8Y02rmNiTc5C5iDXGBBc7D84Ua4mu2xGUJhoz4eW4UL9exkBIDnrv4xt9vA9 S8hxN9G7zt8Tj+Tc01UjWm/5D7CiHCZD6M5f+89efatnHpbSLc6ieWkoyBO4BtD1yr NwUQHDib2Edxq+za2H1SP/Rc/t4gOJKRbJX05vQmdZ7WAwHzvSFItPm87lu7wm8NsJ OQYAQm/Z6Okfg== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Johannes Thumshirn Subject: [PATCH 77/87] fs/zonefs: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:26 -0400 Message-ID: <20230928110413.33032-76-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:19:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778282499210796599 X-GMAIL-MSGID: 1778282499210796599 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 Thu Sep 28 11:03: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: 146022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3237934vqu; Thu, 28 Sep 2023 04:28:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFv2ouoyvoh2qhTRWOJP2PT/4ITVs5jMmRYiTyyCJp7ND+9v1UlAotlCCsiLcmw7JhUbnOk X-Received: by 2002:a05:6a20:4405:b0:15e:5952:4fc1 with SMTP id ce5-20020a056a20440500b0015e59524fc1mr987847pzb.29.1695900519989; Thu, 28 Sep 2023 04:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900519; cv=none; d=google.com; s=arc-20160816; b=bpF5CZNYb/c0FFki7mFzAhGHXJdM8jPi0RdnErlZ/sxwzFWDbyuAk/WMr/P0t1K05b fzakyXdWPAvjK/ICJ9cveXzpC6qcft0JBLmvnWISSng3AdONQY//bcUUd2CzKdCbU6X8 22vzsW9WOv2hpRagKbXxbGlOmS3KY8f7pYCG7/40mY6SpXFdGi/UkJg5yuxIE2K8vW3l QoRhRiJsx+kMTMtIHn4kpAii190wTGMtSJXt3ity03EiO+dQXL5dPbHpKZ6trMBq0Uvx hn42qQqKsgFK0wezAVhWaVNBoj5MEIl3+J7AdrG5HpcChinRAKkgW1pzUXApib3igxIK 98lg== 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=CSd5S1quFMmFUvfKmMNcxFM6gPStlOBJu1o7Hwpqmqg=; fh=c1hve9LK7bidUltaxotdOOkNtWZ8Drk/KOyPdUWU/OI=; b=Jc9848b2IMPXNsLgupqjo7n3c0nijMqlNN8of4XwVrD5k9WB0eiG4Wm5wn3W0M9CPS w2ggjwpxQOdXkKk6KHfjCHLJmPTsJukSK74fVSz1eIXwnpNSReoffTWBZBBy/7F4f/r3 tIzDVLd8+dEzKHFDBv4MZ6YGjHJ880NaPCHVcBrTBa3YzBTSDpcAr/pdXl/0cPrpg3WL WWacr+0Wnwv3VRzGS6HCb8xuz1jlQoiCoECKb1mv2ZKrPEfW3juVf7eZipo7sEpmS969 QToYg0FWCgu1R6lHlpIwRKt8P9C4Q8HYPZwB42kiYQHLBDNkBXp5D4obPd+pWI4yM+7U yvIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dd3KOfUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id mw17-20020a17090b4d1100b00263c4af31f2si8699051pjb.157.2023.09.28.04.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:28:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dd3KOfUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 893C38255792; Thu, 28 Sep 2023 04:23:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232165AbjI1LX1 (ORCPT + 21 others); Thu, 28 Sep 2023 07:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231922AbjI1LWz (ORCPT ); Thu, 28 Sep 2023 07:22:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED2B62D50; Thu, 28 Sep 2023 04:05:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21B8CC433B7; Thu, 28 Sep 2023 11:05:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899146; bh=psv5N50RQ81+83BESGrHOV5WciE2V0x7f5SjV0CmxeE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dd3KOfUe0Jj8fLdYUZ8E8NR67Sz2x5IzNfsgDtB65V7PII0B3WxUr3CJ1MzaDieZ0 6Sv7eSDwm0eHzROlHZtFY6fgC24O05Du0wMkK5SU/zFXlOR/n2w8lKxFRluIgSxlXD qeORQhZBysSbrLkQlODOmsFzmkEEAwjeLg3aXqXYnM8L88Wa3hfyB1mbThDN6XxGyb rbUyu3qdljx+ErlYmkR1yXGtij3jlk7TZYQ4yDvfkYvZvg3STVJMy9YodcMYAmh/Hz O+tAIAk3DecBi0ZuwGpbZfn9sEZ6fbaa2hIuqWodtyEdiZeA8tGe3TrHT+EcgqOzg2 ixY4JS5fQKiEw== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 78/87] ipc: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:27 -0400 Message-ID: <20230928110413.33032-77-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:23:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280583815092516 X-GMAIL-MSGID: 1778280583815092516 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 Thu Sep 28 11:03: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: 146029 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3241948vqu; Thu, 28 Sep 2023 04:35:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5uAov8worh6mKWlJnW3RxIjbOKtVCAQdR0a2kQ08JOvqTpEQ6/CgE2JOpS7Qd800MMiaa X-Received: by 2002:a05:6a20:5648:b0:15c:b7ba:ebda with SMTP id is8-20020a056a20564800b0015cb7baebdamr732618pzc.55.1695900937289; Thu, 28 Sep 2023 04:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900937; cv=none; d=google.com; s=arc-20160816; b=zpM+Gk5bwxSb6tWZk3BwTStgxv4DfVUygNVoVvwFTm8L7s37/tEeKRrJtQnjg9J7uR /zwfuJDNiDtA2y3ngwMQ/Dojjy8FGuGXbtEdJMr6uS4LSr7TG9xv907OcODlMLMETo7p 5CxJAlq8fl/umHFoclVsUC7KdWGaBg0IHjSi9w2AWOe/+CRkKgZMJjMUgrY+Hu3Jjkei 91BqW7C4HpwaOFXeUQeI1fX4/voBkDWKlXvL89CuXFoeg0CtSlTAhL3M8ff7oTR5So3l xMPxKQkPrbXYRhb+K9R9IntK4P4HI/zP2uXf5p/B06yn6k2z1U592L3ZZv9aTxoXXqya HzeA== 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=cQftH2Fysoysf7bzBQ1Wrx3YxQ0oANUR0B/2tGQP8rE=; fh=c46m5ey7SAzRIMX10Og2AyTSJ44BS0wa+PqFJ/sgKgY=; b=oSs8iF3Vcg6aPdQGIubh97MU8+77tJJePYZD17GtDG6M9Fvs7+eau1VMRENDP2rBWL ZT2XTot+epa1/QvcXe6vUJFj43Ck9neMx9tdvYGakfSedVoaWY7UWzemwWss4TFRv5B5 xRTxX17A8nFzKJajTU7QtLVlLhxw5xrCd6S7E+NlPtNuoc7Nj80WaM8avp/BdUQadl/S NblWt5sN3j81G2hYvsvWeMIg1HGY/HvH7lFM1kWn7O3z7ICtWmKff2RKEEj/1KsoJvgO hm/9gaftwHhjEeOqiTkEfb6tMm1NmlTJEVw0Y3JJNp5sOk5uheYkik6/VNBqM6HtdbCJ oWNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DuP/wv+a"; 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 az11-20020a17090b028b00b0026d01e90c10si12280625pjb.65.2023.09.28.04.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:35:37 -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="DuP/wv+a"; 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 E00CC80FC712; Thu, 28 Sep 2023 04:22:45 -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 S232215AbjI1LWi (ORCPT + 21 others); Thu, 28 Sep 2023 07:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231868AbjI1LWV (ORCPT ); Thu, 28 Sep 2023 07:22:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C513730C2; Thu, 28 Sep 2023 04:05:50 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EAB7C433C9; Thu, 28 Sep 2023 11:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899148; bh=/OzpYTerhvIxS1I7NYNGCj7AfHI9vs2n0+hMzd5zjnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DuP/wv+atLxYolVz3TsVy7tiJ9223Z4WvylhKVREmBxsCU+CN1xVxwsq/2PSJlKEj 0SeFCWDbJDEV2ld8iYUItZxaNPQKwnCASz+Napuig4CEsneZ1BjStWwJ4HAb+OA7cy SC9iG6X9UH80RRDJ1thj83wDn1k8f+8TcsKMLv9fjOR20LSA6H5T9oflMf7xc2GvJF O+eaXZLTN+H3mhRL9ttNl/zo0SzNSOVAPN7PO6IE8z90ITg/kKteuIEqbh6j7HpWoT JbjgE6gSfyISnBqy3vYQBrzvpMobxvgl/MqrGENhf1ZBiEdRbysBwAoi7vgbpwg+Lw 0YxsoKatJ28nA== 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 79/87] kernel/bpf: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:28 -0400 Message-ID: <20230928110413.33032-78-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:22:45 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281021162181055 X-GMAIL-MSGID: 1778281021162181055 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 Thu Sep 28 11:03: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: 146009 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3235368vqu; Thu, 28 Sep 2023 04:23:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFUCppVRNx6jdLnFKd0wu6cCoi7O7r+V5XWEGcatk767D4Lu7KbEKRs8Qs5wdxkb4blaXSH X-Received: by 2002:a54:4488:0:b0:3a7:366f:3b01 with SMTP id v8-20020a544488000000b003a7366f3b01mr838831oiv.33.1695900203724; Thu, 28 Sep 2023 04:23:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900203; cv=none; d=google.com; s=arc-20160816; b=SEE+7pt1KwM4yotiGm9Cm7C3IAApmdyBZEmYOmSuL3LXG+ICaqRIaA6Hon5EvezgNY mjOEdqC2914QaIcSPPcEJ375GOVeilxQJ+uH0ZcyaYYaOo5YjhrgoJ0WljeKc/gz3tML k0siaR2zcFuNnkRcedGS/YuYZMsJdjf6Gj7bEzdVdeikjYhX+jdMxDGTEYvuWNssLyKy CEV4v1a18R3sBJcPaE+dX5UyBzAaoh0cgPES5Md8Ux6vjVNsgrCcuykcb+m9y4tO6Mce g6iKg92b/OOiPRdSvnYSzNp0jpnBedB6GND3gALOKghwTNYlqwDTP3R8rCcoCEloNhP2 MLIg== 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=AdPVq+Gl0KsbrSlD4qkrIxGVCyOaXKBg1Kci98DRBBw=; fh=YcvKTfjdELTIgtVvxDx+GI7Jag3KQiPyLLfYV96J/gA=; b=eLTRZYJQG7UF6HOdH47tFciOHFsfTTE9woeyNPkybI4WX93EWTWAURpG034BUpHDEV 5aqUn3bMDxcVyqrIORZh0oSUp9nu5nog5hhSMjJEi/PIu50zZx4ri7WskjXkHARTOP4m /WKJ4/xqLqRe9/48Sm37UXsDwh2Uil/ST+u6D1FqmysNVf2dUbNQ1kkBMJcqaq6bKA+K o1OHOENocM/w9OAgKBZcs0Sot2/tDcEVk8FqHYP1dKST+A8sA14LVlXtRpC1gb6RV4cw Dtna7kZ+QCWraLXAeRSBn9/oOudZZHubaMhUcMcNmoIeuQ1HAFwsnByjvC7HZVEd5TbK N+iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=By3nvlPw; 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 cu2-20020a056a00448200b0068e256c6366si18005063pfb.352.2023.09.28.04.23.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:23:23 -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=By3nvlPw; 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 5E3B68057469; Thu, 28 Sep 2023 04:21:27 -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 S232123AbjI1LUr (ORCPT + 21 others); Thu, 28 Sep 2023 07:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231954AbjI1LU1 (ORCPT ); Thu, 28 Sep 2023 07:20:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A71630D0; Thu, 28 Sep 2023 04:05:51 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA775C116A4; Thu, 28 Sep 2023 11:05:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899149; bh=uFrEzvYVQCsriiMGkk8AKLTd0LQsQsSJjSLze8FhJ9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=By3nvlPwwALdU/McvKHBoddMEDKfobu2wT0jBMPExLOGfgXT7dqsgh7GI1xdf7haq wDtMEr6nybvX6l/M/85HTUlMX7yEVTLkzoFkHYiJ/3wP9SVesXSe1RTNOgJhfJ1rdo 3Y13+MJ0VUOStyZz/0Oq/gy3FNncWzGLN29tLpmVFCDOTUuDS2oCpQBF+53VkbPuea wNUZrINU+eN/Rw+31QzziJWDr3kybOsf88fvuRociCfPJ0EOGi8zZjvVrBNP0JHknr jWNtQBkKy0PIMofs4A2OaNWPYgsTY5zB0TzMvYSY0JUMxCdOIl2Wq1XyDxxjA1+F06 vsMHBm6doTiXQ== 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 80/87] mm: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:29 -0400 Message-ID: <20230928110413.33032-79-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:21:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280252237102041 X-GMAIL-MSGID: 1778280252237102041 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 69595d341882..c48239bfa646 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1112,7 +1112,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); @@ -1224,7 +1224,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; @@ -2455,7 +2455,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); @@ -2463,7 +2463,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) @@ -3229,7 +3229,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 */ @@ -3318,8 +3318,8 @@ static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentr } 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 */ @@ -3339,8 +3339,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" - this does all the work */ @@ -3488,7 +3488,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 Thu Sep 28 11:03: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: 146025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3240946vqu; Thu, 28 Sep 2023 04:33:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDckmaQa1UZTAF6NjcvRjQjo9qRzf6MefMc6vbj8w6Xmgh4+fw9EaxWUI/GySdjBd/ipk0 X-Received: by 2002:a17:90b:190f:b0:279:5a3:d5f with SMTP id mp15-20020a17090b190f00b0027905a30d5fmr1678647pjb.9.1695900838534; Thu, 28 Sep 2023 04:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900838; cv=none; d=google.com; s=arc-20160816; b=Wz+5qt0x7+xognFU9/6zOzCicc32XImodrXKN2iuZS8SZyiqyUonBm9fP84+WZm42V BpNaIKG5m2ozjmAcQ3I715H9eMk0bxgduMN9hUqemzJUhYXAFBLJfhpt/E/X5ZOdGTnE 4wJRa47qAjSIrdF4R4X+OeIqXOTMjtFKTyw0png6ZFJPDJ6bzStAB3CNq1V9IPcWpFsE NR0eKabpz8idIf0ZeMCoOo+tU4PxS9JFWY2Po033v1ZcgGK3fzNrutfRGpMmUE4RG3le NWgNl6bqMZwLuVXSjaMD1UK7qMQGlgqPSOzi4hL7uOSdsw3t0eLc7/d+TKJjrMAPy+PO GTaQ== 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=SC2GFuu9sbRTmDPWGu3f6wlSmbY5cdOm1IX/L5hjD08=; fh=f57+WOTreorKF/qXl5as28mzLP2sMCESIPBPN/7u+eE=; b=JoT9zGRb+7xTYGk1pxtXFwyiSdEj5vzHxZ9hYgaic+c5P07urslw1NpWuBw4UmFobB +ioUStBAuYMLXfV5OOm3b/yFLb31mWBlzB8RCsAPlAMOlekEMgavQ1d1Czg0EpamZGaX M7I4fwXcHGPLWJChxmwiXbkXTLdyEsRGrIWvjMXlUBB2Dsy2U97giibbRVHYDlLzFQEj ubdjCcQwdckZT2H0yOtqoGVAMgq5wVVVGH0aAXgYi8hoCEu+/cSZaw18+zHn9+hKnDSe niViWlToLdNgB1qkGDsMLOmsUo0FGOZRpaYCyEYAckQ7sFPBDRwOWGPq3AFE4/ri0VF0 lA6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EA8PS94M; 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 q92-20020a17090a756500b002766bd6d3f3si20123606pjk.10.2023.09.28.04.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:33:58 -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=EA8PS94M; 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 383D5804909B; Thu, 28 Sep 2023 04:21:44 -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 S231922AbjI1LVb (ORCPT + 21 others); Thu, 28 Sep 2023 07:21:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231906AbjI1LVS (ORCPT ); Thu, 28 Sep 2023 07:21:18 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92D8E30DF; Thu, 28 Sep 2023 04:05:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D268FC43395; Thu, 28 Sep 2023 11:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899150; bh=0P4fQQ7SkEsC3hdW3vPp6OWO9DCcnlz/5E+g/XegbtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EA8PS94M7lAThjFIrSWRW/phMmXb7E4FNcL+kYmUWn6cw7DLcdSW5/2gppPEEnfvA +JOVBlG+8UuxuMvUMkJ9MK//m7GaXZP3/jC+uhHT/RcGN+ZcNDI+llhl33R3odfpn9 aTgjA6Q6g57eLFUVH9bkc7dprQP0CRmxZpW1dBhlyLbVfLTsjSSrmY3VEPtGsWPxv4 WVxrjXhTRPigxRgC94P9mX/7RG52Z4zoJTLGsSrBPKZcvRb+uDAaI9itQf6LpqFd3D JjwpgpdE40vHp/XmjgG4t8InfS95vqShUoICMDUdjsVB5D5euNREctIgoEnT/ZDdxh h7QrD3HmWkEIA== 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 81/87] net/sunrpc: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:30 -0400 Message-ID: <20230928110413.33032-80-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:21:44 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280917730669452 X-GMAIL-MSGID: 1778280917730669452 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 Thu Sep 28 11:03: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: 146033 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3242452vqu; Thu, 28 Sep 2023 04:36:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzlJFAuVE07yf+hx3O1rd67tIEx6rLuLNfY2pRV1QtH/yg3rmhMvDWTi5Ef3wh5s5FxOh0 X-Received: by 2002:a05:6a20:be1b:b0:15d:f804:68e8 with SMTP id ge27-20020a056a20be1b00b0015df80468e8mr731168pzb.5.1695900989857; Thu, 28 Sep 2023 04:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900989; cv=none; d=google.com; s=arc-20160816; b=z7NEk5LZ2Sov0BdRHwUsIGdhs5tmILlCWt3UHHkUQ76jcivUd2Ny3gx8KkZyos7cPL 7p6lvgm16rSHYm3BeTeT0ituqyRt4S02DSngpRYJLXT8OuiRJJK4kAc9QvQPfy+dzNEj /UuUuFnSA5zu7j8wRZMVqdtZj45L/ufyqgzm2x6wNbQxCctm79Sb9ckjtWhKS9a9JG6b V/dqvBdNNBFkwHfBPPmwtbHPt/0ZfA33WVdy8LmmFqBYdfbfoqgc3vhr55jty7128PAN 2EnTJgAdQSPRZqM7gtIVo7pdEEpRC2EOgtMDS0fgR+tSqRhTKKqpay3HzoT4eEmzADtt DzcQ== 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=i6LyvgRznKC2BbTiPDq2r4dOHdUwnv2IXXkWq4qdJ4E=; fh=oiowXySz2F+J4jdl2t70kJesSvr0fL+txr5uWibwDGw=; b=m7HUqqrIM+7vhn0jN7eWXY1m029SY5B16QUtb02B92lwEWIJVXc6AkRYJKb1Y3yW/T RKlr6eA7xs/v5NTezEHRdygxoBtHOVd9MVKbMHXpKkRXF6XU3cyr0PRbTqG5b31zznTp Gx1noJd8EMo6Br443PDyG0DQVaIw7jAjsPMTzT66DnZV2jbQ5BiTqlRDcTLheQlpA+2J TLFZ8TjoHlnkWUxeKJwfQiPXMyJTHaumFN8zvG9tCyY0uYMyoYE/1UVB+qeLiue/N6ID 6EEc5BFKGwM4NPlkwLd7IrznGXAr0uEXgE2QuMHPNPg8/bebgsSI6wEZlhxzMeXdYZuY zgvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tjVSq0VZ; 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 a17-20020a170902ecd100b001c62d5b4e00si8030048plh.508.2023.09.28.04.36.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:36:29 -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=tjVSq0VZ; 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 33F0982224E7; Thu, 28 Sep 2023 04:23: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 S231916AbjI1LXt (ORCPT + 21 others); Thu, 28 Sep 2023 07:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232252AbjI1LXd (ORCPT ); Thu, 28 Sep 2023 07:23:33 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1DB719A1; Thu, 28 Sep 2023 04:05:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E2E7C433C7; Thu, 28 Sep 2023 11:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899152; bh=C22B2g/SgAvtHDu6LBtQOcUovQ/o8sJV/B6h/lwEOZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tjVSq0VZ9ZixOCI2LTExv2W1XKrvAXkOB2Akc8mYQZ0QsZj6zFfAFu4f44fI5smx2 qVmZec5FxZblIMmCz0iirOtVMnDEslnixfZ83anyEbHDpve/zrwAIzyUu4DErJXVf6 cNU+yQv2tiT7PgwOKjcBQzsKqOmdjqP+sgm41tk7Usx26UlA6L4oczEmiAlJN94efa yFEuaF9fh9J3LFmffxpG35OtWDN/lVsY7/YgAOitiB9DdYYHwWCIxpMjxkxooBTS0r GgIxU1tFqix6FO+0RxpUrmDN2p7k4Y2C6M3oSEwGwc4TyF09qfkEe4TLwFTfvgdR63 rhHX3YTFl4VCQ== 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 82/87] security/apparmor: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:31 -0400 Message-ID: <20230928110413.33032-81-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 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]); Thu, 28 Sep 2023 04:23:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281075972907831 X-GMAIL-MSGID: 1778281075972907831 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 bd6a910f6528..53a0070ff5df 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; } @@ -2543,7 +2544,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 8b8846073e14..913ec8d0eb63 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 Thu Sep 28 11:03: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: 146074 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3264322vqu; Thu, 28 Sep 2023 05:13:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGSOwBQ3lSf4BEzHy87mpS+tkXdwJUbY1gtaFnRlES2U52yVLtaIeqm6fCNpg1abHq0tFzx X-Received: by 2002:a17:903:22d2:b0:1c7:245a:7fea with SMTP id y18-20020a17090322d200b001c7245a7feamr1204744plg.58.1695903199760; Thu, 28 Sep 2023 05:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695903199; cv=none; d=google.com; s=arc-20160816; b=u7TwVj36JDbbANunHnAR+SUAsjCM8R24RbhSvHy25Eo8YEQ7DO69mAYZMxuhlH5YhS szSVuUXDKiRcRpuAx+NlCoT5y2kFQte6oaUpa9SvEvTzk9p/Zb0xJ77StMyDrvhR+97K POwY24KILjV5gSRzmmbq15ePnjhg5QpH4+De20bLQWokkE+lS0WiTTIOr+db8pkRJU/b W+vzA6TavOsSL8rpFlyK6OShrfutPGQukjsh7I1+Nqn3Xa7nlro7UF3wYap6deWwfsRs qOZJzgVkHSO93ImMfz8UoBeBlW0M+iTPqaE8rRZq9sbBE/Lnvgb5MS9N2js2jXQMiiT6 fZcg== 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=kaEErbevJPVby2eGWTUnwD7McpVF2Psvmhenueqa8zU=; fh=WgBXh9+dqNJSmNIbMrHlim/mlb4wtn4DEPthgFovn4A=; b=E+bPWTmJUuE5+gowMosT8VNRhruYZg1VGlNCV1p9W/nyfMQc7+2wPmByoS6YtX8g4c Pzl76Xp//V604/namPsyI8ecscwoowbgFLvAMSATP9v0vCIz3BW54yNA9geSqsI3FiJ6 YbsTu/f3DBlDRUKoi5ywfN4WkP80t0K+GYDvkoBODiui8PQq9ZvdTa/YA5lARCaPDF5O s1OzpVAhE2S9lP03qnnaQfRT1HwOoT/mF6GzIxfg+hVPtDj9cdSGriEd8Vs1UxM/9dtx Qa5iaSU/4n5Bhl1kIxnpQQtkYuNvjjc4bLw4NFoUxHosuihhgAtdZnL3lLTk1+8TEZyS NMfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKbza3JZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f1-20020a170902ce8100b001c4749ee72csi19167981plg.503.2023.09.28.05.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 05:13:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKbza3JZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 7156681F9647; Thu, 28 Sep 2023 04:24:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232176AbjI1LXp (ORCPT + 21 others); Thu, 28 Sep 2023 07:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232106AbjI1LXZ (ORCPT ); Thu, 28 Sep 2023 07:23:25 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F31CB30E6; Thu, 28 Sep 2023 04:05:53 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93135C4339A; Thu, 28 Sep 2023 11:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899153; bh=WVJs4r3gn56zBo47yqZI/s5Yoqse5Zyy37O4JYc3re8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LKbza3JZRSUAdtu/GjX1l2se+pcdi6B1agIk6YbWgnEjMfFnb0fBX9Ccw57h/EwVp nxPI/qEMicp0DmqTli8iGdhp56iW5KnID9GMhitMPWXAvWLPDrQYJlvfET7eOB6P3n RP9bGQ5yVoLBd8Wx1e7q/eFZeI+q4nKR4BrZw4lDt7BZYsp+URE9c3JehU5eRQF+xd 8GQO3r6ar7/zT8GGJ25AwSdRqDqBqgR5zE8TjkKcOY4A7fzBn9p7dfR6w901Cs0DDF ttZVyDpIoLFPfNLUtn/R8wfxpK1ETx0s2faFpFe8ZSCuBUDVJ2+9yCwX9Mj/8oLLrc 1IKETsFzHXJXA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: selinux@vger.kernel.org Subject: [PATCH 83/87] security/selinux: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:32 -0400 Message-ID: <20230928110413.33032-82-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 28 Sep 2023 04:24:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778283393489508824 X-GMAIL-MSGID: 1778283393489508824 Signed-off-by: Jeff Layton Acked-by: Paul Moore --- security/selinux/selinuxfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 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 Thu Sep 28 11:03: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: 146028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3241607vqu; Thu, 28 Sep 2023 04:35:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHELjNYou5hwYy4qMbUjWGOelbXUyOr57YvduiKiovZogrV47WcL9Z0YumMx1iW2u9VJNM+ X-Received: by 2002:a25:dd02:0:b0:d7e:df89:dda1 with SMTP id u2-20020a25dd02000000b00d7edf89dda1mr786389ybg.7.1695900902287; Thu, 28 Sep 2023 04:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900902; cv=none; d=google.com; s=arc-20160816; b=ghvWKEfqANnXEOHcoFon8Nlj8t1KBlWSFZpxmqmtATEfzBZnIq1ZxGTw0XSkRVS+gp XYxv6sozJz20a8RtClZLidp3wBPC+s9vUrO3IXSGazGW2m4KDkuyFJ4YaYz5FdbWwy9G Ow5yPyzf3sabOcLuEn8VhUs5UzXHO1hanu6nZsmILrM4fCNvgmhWn3GzE4IMzau030q9 TfQR6ExAyW2hIZwmO2+dSvGkIfHANaj5aeiUk65T8gjHtquZRG/NUlWfuCSHBDsvywH8 lcvcV0rkcEKYnESKE2bctUjuLxiI3rJZ+BYrVZ8IU66UVqzi0FGXagM+B2Y5yMSFKSIu Yf6w== 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=24rkF7ih4FoZDlUWL/JBlcDRm68cAJ+3eWLp8kLmYLc=; fh=gCHJsFekNeziAabT6S8Z3/qglWAWufJIu2FsfAuCKVw=; b=ekufA/qnMyEUw0Rk3a3D0GD4BIJpB4KKCEjHSMua+lKtN4dEZjK4qFE+fNVOpagk1H tEqMeVc/zuTI2ERBxBj+cnJUBrpRoJ7MM9/u5NnN3eiXlb/ouuLm1IYNS/QUU3Vdtnxn mNVwvJs3CwIPaUUNM9fs9DIa8QR5T16T3K3+RZdKeqNY3zebpylOGk8YAVOooiIAPdSP 8N99p3agBm8/ke+a9I03AsUXFE8kbb4j8huKJMaE1YGcXWBuoYVfU4psYtYAQmFUOi2d o7HlGqA4w73YkakQwqvDw21TGtiXgHrymP5sJyhDwtuoiAnaqa/F8YVCKYFR663IWtTw momA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ucrCe/jl"; 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 b130-20020a633488000000b005775e2a7951si17977825pga.345.2023.09.28.04.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:35: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="ucrCe/jl"; 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 4C7DF8029DD2; Thu, 28 Sep 2023 04:22:14 -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 S231993AbjI1LWN (ORCPT + 21 others); Thu, 28 Sep 2023 07:22:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232085AbjI1LVh (ORCPT ); Thu, 28 Sep 2023 07:21:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A092630EE; Thu, 28 Sep 2023 04:05:54 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0A97C116CB; Thu, 28 Sep 2023 11:05:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899154; bh=r5SK+jr3EBI0menL2V5UmA+6WeqJoTdE3YJ7XmcoehI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ucrCe/jlvNXPJgL05R1SUNtmRqPO/P0DUsQXZJBddiWRi7Blb7Q+kFkwNaB5OMmj0 tYVo61uaHGMTilnFpPAJX+i2JDQ8SAlezHEXEKJVzFijwYV73XS5FDkalLNESrCDpq M1LXP4gH2JXl9gR/ME/Or0KJQxPD/5KPoOwikmk0Bc1PHLKF0UZaKZlqvPkQxXes6R aMDtJ/A//ISOlIRyD8kgS4Ntx2pZ5CJX01s3dDwVv8x5T9znkp5jExXdqXUWYChbi0 6ytCJGCt01Ht13uHEllSyXZwN72ja6OZpoOIl0eGOdWkC7ocUiTJWURwEOWwvkNfNe 4lqGuONxgu5WA== From: Jeff Layton To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linux-security-module@vger.kernel.org Subject: [PATCH 84/87] security: convert to new inode {a,m}time accessors Date: Thu, 28 Sep 2023 07:03:33 -0400 Message-ID: <20230928110413.33032-83-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110413.33032-1-jlayton@kernel.org> References: <20230928110300.32891-1-jlayton@kernel.org> <20230928110413.33032-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]); Thu, 28 Sep 2023 04:22:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280984605351482 X-GMAIL-MSGID: 1778280984605351482 Signed-off-by: Jeff Layton Acked-by: Paul Moore --- security/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/security/inode.c b/security/inode.c index 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 Thu Sep 28 11:05: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: 145990 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3233684vqu; Thu, 28 Sep 2023 04:20:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7aGwLSfTYi6tMT1mdJou9JE0rgNFZfmPYaxD/h1XQuUOFRoqP0ntWHL/M5BTEPGW2PTbN X-Received: by 2002:a05:6a00:190e:b0:68c:57c7:1eb0 with SMTP id y14-20020a056a00190e00b0068c57c71eb0mr877881pfi.11.1695900008843; Thu, 28 Sep 2023 04:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900008; cv=none; d=google.com; s=arc-20160816; b=ncRdZnYRBT2eo1vUMYTUZ/9Zm1S/Zlca4VoJcqWReLZ0O9Gi5EfR756cULhfjFHDQv ImL/fwRAKjUEAjn4XNHTORj5G3VIRNNEDviWeV7o/Epr71e9D/dfkPDC1jRQDLO8YkXL HpxbCB01/vp2vAU68bOa85rNLDt/mK3x6W2iFej007i6+wvO4rFSGRJ4k/RVoNFjpDno 880RJc1855FgfHISp7U1SyyFm8WcJ/Rq2YVSGThqgJqpFQ4NeNHX6h3m+y9nVf12C4bF esFhE6yUfBKv2rErvfRFS0H7mlmBPWwjRskowyK7r/3aJeP+z9GLgqj54SFzdambcmpV QnUw== 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=f+579iacD2RSgWVCKH/CfEZa/lD9il6pqmO8eji8PO0=; fh=/7vYR5sTG+QGIoCUJVP5WAp5vyxYNiSsOPrHUOdylJE=; b=vfpke75n6Sc96HMzn6Qc8eid/sp9QSA9N8x7rwOIYdeYqLYa0lS9K35TEoA3pxELWi t7yR8sXj8jwmntc5QcWn2Zsy9GqhE5wEw+QCEHOHfA2htDtMK/26+i49ayR1i9ObtPuc 9X5KXUB2sxm+vnDeaJZmDnU2rH2WC380OV29UyOqZ7C3DPqn5KZHjmAGB3htxqNsD6Gv NkxaoR1kGdVR5I6po5D5m2/0J86Ao0+bfSgTt9r38x/Wj1EGW/758m/0jDVfk3Vw94LU PhaRipl5yApO/W/yteYkyLi6sVOf2j8ytVtlu6LwHd2j1ZUDDBCywrG8MrO69TG1dHHy z8JA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V+wOzFnc; 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 g123-20020a636b81000000b0056a55b14f2bsi17388386pgc.285.2023.09.28.04.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:20:08 -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=V+wOzFnc; 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 6656F8243089; Thu, 28 Sep 2023 04:19:55 -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 S232465AbjI1LTN (ORCPT + 21 others); Thu, 28 Sep 2023 07:19:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232043AbjI1LTA (ORCPT ); Thu, 28 Sep 2023 07:19:00 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E9953C0E; Thu, 28 Sep 2023 04:06:10 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B45DC433C8; Thu, 28 Sep 2023 11:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899170; bh=AhfBjRw4Zieo7d/UWgS6g+DDX4jTgfxPdqjByEx9qhM=; h=From:To:Cc:Subject:Date:From; b=V+wOzFncXPhDXQFQdHny1CsSK9qUJSENwQ3KCibIzAaql9xTx9HnhDcijW4/7BOtC kszW/YDyA0AMr7XQAUyJiZeb60fme2uDkyobxKoT8cY6VhZHy5eoMPnsaN6X7TtxCq QTaef29MEouz7MkE+tPPdhmCepxFcMdSgkZxMJFkcJInXSuCSMx/JWDM3dr1kZYemo enoSOcU6aqdkN9wSvXmqf6Z9xnaErzYq51O9jQbKnwkBY5wjm/kE01rgGkYxHItLa5 5cRJCieL6/r3mfMz8yZQYtWkWaXM39nIwleCYU584hrkq3VtvO021SVUVEZ1qpwd4S nSI/tWahGoeXg== 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 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 Subject: [PATCH 85/87] fs: rename i_atime and i_mtime fields to __i_atime and __i_mtime Date: Thu, 28 Sep 2023 07:05:52 -0400 Message-ID: <20230928110554.34758-1-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:19:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280047775924796 X-GMAIL-MSGID: 1778280047775924796 Make it clear that these fields are private now, and that the accessors should be used instead. Signed-off-by: Jeff Layton --- include/linux/fs.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 12d247b82aa0..831657011036 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -671,9 +671,9 @@ 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! */ + struct timespec64 __i_atime; /* use inode_*_atime accessors */ + struct timespec64 __i_mtime; /* use inode_*_mtime accessors */ + struct timespec64 __i_ctime; /* use inode_*_ctime accessors */ spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ unsigned short i_bytes; u8 i_blkbits; @@ -1555,13 +1555,13 @@ static inline struct timespec64 inode_set_ctime(struct inode *inode, 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; } @@ -1575,13 +1575,13 @@ static inline struct timespec64 inode_set_atime(struct inode *inode, 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 Thu Sep 28 11:05: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: 146026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3241170vqu; Thu, 28 Sep 2023 04:34:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNeQRBvwgOEDtBfGSbyXXa+U2dGamiX34l0fhljmLU3nAE6llBqhcaVOuPl0Wn8NCJTrOE X-Received: by 2002:a05:6a21:47ca:b0:15d:ad11:748 with SMTP id as10-20020a056a2147ca00b0015dad110748mr684801pzc.30.1695900858333; Thu, 28 Sep 2023 04:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900858; cv=none; d=google.com; s=arc-20160816; b=BVh5lCmS6cBb7nvosVIR92f16Nj52TwoH0uIxcomkFy+nchuUQw48QB7pZrDEwTB8G LzluPh7JHuxOmfLATYfOpk9oft/wIdSF7dFNT36v0Mh+Me39C4EGkWAmE9YevDyvDqP6 idQxhhGFyYu5PrkOVHbfB6GElX/R0om/4u1IfITHk0/xWmt6WVDf7xk3g2tbiS15V6mb RplTPno2mOwl9pGTjG/kYUfeMZdnReBjJU5rL6cvCcGcQpH4fVCJ1+BBooLT6NWTzRpi EQ/xrwRu6/AXYHzyLi2qg3/Evw4N/o3DkcpSVmeCeAX949qI+bUevDeq06wqIRx2Ga8G zeLQ== 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=0YEv1V3zZSOHcgruK+mvOq6BiG3lZhaaQ3ES0cY6BjM=; fh=/7vYR5sTG+QGIoCUJVP5WAp5vyxYNiSsOPrHUOdylJE=; b=0WVbGRAHNh86IQGxl7DKwPmrTtB1Bz1WzN2vu9Pss2h9KDXWJX5RNaRtwTSRwGG6D/ I2YuYzRoIoRtoqKfWVcg5HBeVXf8LD3usVA48l/aDuEiQhdu2guhdAryI8N37wYR6+CD LZwLy7Hs2N1cA2VQ8BrqjUFMpnF7CgG8vZ+MmqiUAYy+LpHhZTU7x9udAMVgs7wWZrLP 3y013U8UuuaP7qaOpm3ThCIYp/9ADYutEmFq4mhe9LGZtRvezsj4crPk4eczuJfCYgmG vhWedfbFBHudWh9otm2vnldrLnf7rRK3Q8TCYzVKQ8g5lSSclS8Qu2sgfrvVfiHP3YPt JImg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bFxyq+wI; 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 z22-20020a17090ad79600b0027756e1f0c2si10616510pju.7.2023.09.28.04.34.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:34:18 -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=bFxyq+wI; 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 53FE0832C2F8; Thu, 28 Sep 2023 04:23:06 -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 S232562AbjI1LXA (ORCPT + 21 others); Thu, 28 Sep 2023 07:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232317AbjI1LWl (ORCPT ); Thu, 28 Sep 2023 07:22:41 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF59F49C4; Thu, 28 Sep 2023 04:06:29 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28B2DC07618; Thu, 28 Sep 2023 11:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899185; bh=EREGf1zcL5EA1z4Sr1OlKcRcr7XPDG3rng7QCUAKDtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bFxyq+wI82J/WQ/3LWfsBekhh8OiaT2wYsSAjrDQk/NrGOURDgw5PWuMWCgk6npZ6 gYLI9nWuVeVxeze31PlhCET+PdMZY70Xy9a1ckPrunnaxH93RrMhwAf8QKEfxBAiMW A3cOqQLFufYccE9l6906MspLgdIVzFHYGgIdgAYxkIU2uPLpvYnElaoBbxLu/GOElz nfJ0kqX0lpMPX7fozYTYh3xQ6uUVAew7yxgjGjuRy8Oehoifs61PNFQPPpZBViM2G3 Q4xpsOM8kKsqE0iTJbEpoU+nreDJHiQfBK4Xqt/1AbCybTiYxp8gYPp3ucvOuJLoxK YlW0JpzEkcqqQ== 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 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 Subject: [PATCH 86/87] fs: switch timespec64 fields in inode to discrete integers Date: Thu, 28 Sep 2023 07:05:53 -0400 Message-ID: <20230928110554.34758-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110554.34758-1-jlayton@kernel.org> References: <20230928110554.34758-1-jlayton@kernel.org> MIME-Version: 1.0 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]); Thu, 28 Sep 2023 04:23:06 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778280938306384991 X-GMAIL-MSGID: 1778280938306384991 This shaves 8 bytes off struct inode, according to pahole. Signed-off-by: Jeff Layton --- include/linux/fs.h | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 831657011036..de902ff2938b 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; /* use inode_*_atime accessors */ - struct timespec64 __i_mtime; /* use inode_*_mtime accessors */ - 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; @@ -1519,7 +1522,9 @@ struct timespec64 inode_set_ctime_current(struct inode *inode); */ static inline struct timespec64 inode_get_ctime(const struct inode *inode) { - return inode->__i_ctime; + struct timespec64 ts = { .tv_sec = inode->i_ctime_sec, + .tv_nsec = inode->i_ctime_nsec }; + return ts; } /** @@ -1532,7 +1537,8 @@ static inline struct timespec64 inode_get_ctime(const struct inode *inode) 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_sec; return ts; } @@ -1555,13 +1561,17 @@ static inline struct timespec64 inode_set_ctime(struct inode *inode, static inline struct timespec64 inode_get_atime(const struct inode *inode) { - return inode->__i_atime; + struct timespec64 ts = { .tv_sec = inode->i_atime_sec, + .tv_nsec = inode->i_atime_nsec }; + + 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_sec; return ts; } @@ -1575,13 +1585,17 @@ static inline struct timespec64 inode_set_atime(struct inode *inode, static inline struct timespec64 inode_get_mtime(const struct inode *inode) { - return inode->__i_mtime; + struct timespec64 ts = { .tv_sec = inode->i_mtime_sec, + .tv_nsec = inode->i_mtime_nsec }; + + return ts; } static inline struct timespec64 inode_set_mtime_to_ts(struct inode *inode, struct timespec64 ts) { - inode->__i_mtime = ts; + inode->i_atime_sec = ts.tv_sec; + inode->i_atime_nsec = ts.tv_sec; return ts; } From patchwork Thu Sep 28 11:05: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: 146031 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3242163vqu; Thu, 28 Sep 2023 04:36:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFz/VB2xmT91zX2VDj6uxNUI71LCgvDfIw+XWErxAHF+k+25JVuGq4EcPVQzIOOIiU/rROe X-Received: by 2002:a5b:b51:0:b0:d77:dcff:e7b2 with SMTP id b17-20020a5b0b51000000b00d77dcffe7b2mr806267ybr.39.1695900961822; Thu, 28 Sep 2023 04:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695900961; cv=none; d=google.com; s=arc-20160816; b=Eh7a767j5V5hG/MXuJuyMjYK7S7B+ID9nJe5BZYfLfdHtRr4eYl0dV0/mxXlBY/ADi JWmxHt1wbTU02YyIYFVbRdPc0NI1MWLptIAMpi+kx/mgluWL3++w5fbTfBH3+t6BC5gq CuwtcEIlXcmikzIlXcjCniHbiUS1OXGuDWGD2gaokz2Zim8rjgUE+PF4W4bIat/hHdsm HD5N95GOfDtj9MSUtiC69WRWt1rdN4o8BPFrYmMkb0rXqQ4ZFRRsXlQP9lDwb+TMD4y/ jEB10D3sDVHNGo5qLIWqml+NRx+rMoG5TK5zSu26zfhe00/Y908/gvrld20wHztahzpW ennQ== 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=AZYm+3IMy7PsScQJ1WtwjofEM45ISgwj290K5ddP3W4=; fh=/7vYR5sTG+QGIoCUJVP5WAp5vyxYNiSsOPrHUOdylJE=; b=mCDwykRZtc0+yRCRMgaEoRgyqDyDlRM2BYTTEn/xgX67A4tKKbKWwKt5zdMU2F34Ys s4BgEYdLsSP3uA+MCv+ZoEN1orPjom4wYJcNAB+/66NYS0bZkwshtMgqd0WnAxgkT3yo N99+/LESDf7qAJ21S4bc8CVx8pNyx5V0kznUigCg67IKlfx4dys6Nsa3XFKW1y8X12K2 poVQvmhcfiXLrBE3kdT33pAytRmfdXO3+icDNK9EzCiJQOubb9sjLF/IJNINZrtmI1Hv vo+UXSb4KE5icVEB6YXg0UtKnA2PYzY0DpkUSSY6eRbWFdukJ4F+BXIx8sZZ1GvKeKcs kCuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LIvJMQV9; 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 t71-20020a63814a000000b0056c297d163asi17623813pgd.523.2023.09.28.04.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 04:36:01 -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=LIvJMQV9; 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 CB2B481E3E1F; Thu, 28 Sep 2023 04:22:03 -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 S232456AbjI1LVr (ORCPT + 21 others); Thu, 28 Sep 2023 07:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232521AbjI1LV3 (ORCPT ); Thu, 28 Sep 2023 07:21:29 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0C275264; Thu, 28 Sep 2023 04:06:58 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF540C4160E; Thu, 28 Sep 2023 11:06:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695899200; bh=KcEb7Ur9VnfCswhdPaiHlW6A+8Un/231FkVSjN0vVmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LIvJMQV9gV0uW8yl32NSd4yb2599TLMQSz3pZ7A8RvzTMK+/pPweiGT83QuRE6Ap1 RJ4tHrEtdELF24JEcAXBlbRxCLgD4fFKMvaVxDYJKFUi3JGR08fTlWqCpRUQLEU1eL PLdctIni/gLihdwFGrq6SVBHRpLIcoURicUh3JGLAt4t51ztAQPhDNYHtf1HHGTOrp XAB3XmZIrDME0ElXf57Dd8FtxB0Uiap7czp3ZlR45ObMUeHSnxd6fREH7G/U4RgfCh xv1/nw1L9/w3ErqEe74BXlZqblyXh/mVR1R03Etd6mg/RnXyu8EBj+lRYoEkTAJg+R yYzEQo7GNicAA== 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 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 Subject: [PATCH 87/87] fs: move i_blocks up a few places in struct inode Date: Thu, 28 Sep 2023 07:05:54 -0400 Message-ID: <20230928110554.34758-3-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230928110554.34758-1-jlayton@kernel.org> References: <20230928110554.34758-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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]); Thu, 28 Sep 2023 04:22:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778281046709483660 X-GMAIL-MSGID: 1778281046709483660 The recent change to use discrete integers instead of struct timespec64 in struct inode shaved 8 bytes off of it, but it also moves the i_lock into the previous cacheline, away from the fields that it protects. Move i_blocks up above the i_lock, which moves the new 4 byte hole to just after the timestamps, without changing the size of the structure. 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 de902ff2938b..3e0fe0f52e7c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -677,11 +677,11 @@ struct inode { u32 i_atime_nsec; u32 i_mtime_nsec; u32 i_ctime_nsec; + blkcnt_t i_blocks; spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ unsigned short i_bytes; u8 i_blkbits; u8 i_write_hint; - blkcnt_t i_blocks; #ifdef __NEED_I_SIZE_ORDERED seqcount_t i_size_seqcount;