From patchwork Wed Jul 5 18:58: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: 13302668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3D93C001B0 for ; Wed, 5 Jul 2023 18:58:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7CFB98D0003; Wed, 5 Jul 2023 14:58:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 77FD48D0001; Wed, 5 Jul 2023 14:58:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 566DD8D0003; Wed, 5 Jul 2023 14:58:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4461F8D0001 for ; Wed, 5 Jul 2023 14:58:54 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 167DE40454 for ; Wed, 5 Jul 2023 18:58:54 +0000 (UTC) X-FDA: 80978470188.08.3E722BE Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id 32D04C0012 for ; Wed, 5 Jul 2023 18:58:51 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=aMKB7Eaj; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688583532; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LlpChOzqdGMpOWppsGoACq3Og+Rj4uzOB0D2aUi9/78=; b=1ESmdv0O1ZNhuehjS0sYR48ab+U4ZCGXwd0+j6TBd27i5XQzDIcMbvesIsFRTtEdmoMHAr XdDle67mor3jOJ1mQe3LymwC/gtgmxpemHl0kIQMo6nQOznhYPD/k3i26lDElYa9ZVk7pK r+8oxn2NPsm+vtg3JME0mWZmkwisENk= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=aMKB7Eaj; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688583532; a=rsa-sha256; cv=none; b=Ky2PArura8K5AN7QoZAwZgqXjS3atup0rLm2yOJkpKvQGAThtlVnycqfs+y4J41rBaWe8n /8b1/d1QGmyGmXiiW52Kn4O+0IIjW+FjF+Z/+wG/noqdN6qVGAdWWQjw5fiMhaaBs7UYc7 Oi+2vrqafn1Wh5WHn1wPUnKOmXHqSjM= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3605D616DD; Wed, 5 Jul 2023 18:58:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 048E0C433BB; Wed, 5 Jul 2023 18:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583530; bh=rS7mHrqZmoO2H68n3RxhES3IzDPLPysS3UyH3PinCQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aMKB7Eajzv0HN0RjiqoVKTtlq5KN/eWgB5BWIXdR4yS+qXLo9oJ2A8CvARGhR38SH AGVvIkEZAbD+2gqh1hM5AgL3ExspR2noywBNBHZ/Zbz6Jipv98b24C+FbaNuj7Id30 /vjMmqLNAVgc3TMo2RGbDruAikPadReZuK3KcfWQJbROt+tSH7hONNDFEXZgGO8FCp rZUVAJaTqC0bKLSAziTq7i3tC8AVeG/+sFMf01eIn4wnADMCMY5hp3fCv+if/Zhei+ dNlf5J971crJund4f35sQB+fqWVZ1Rv/WEt2CJNhYXge8soEVT4A/D9IhrSNkZ2pHG dVcbUJJd2L7+A== From: Jeff Layton To: jk@ozlabs.org, arnd@arndb.de, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com, maco@android.com, joel@joelfernandes.org, brauner@kernel.org, cmllamas@google.com, surenb@google.com, dennis.dalessandro@cornelisnetworks.com, jgg@ziepe.ca, leon@kernel.org, bwarrum@linux.ibm.com, rituagar@linux.ibm.com, ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com, dsterba@suse.com, dhowells@redhat.com, marc.dionne@auristor.com, viro@zeniv.linux.org.uk, raven@themaw.net, luisbg@kernel.org, salah.triki@gmail.com, aivazian.tigran@gmail.com, ebiederm@xmission.com, keescook@chromium.org, clm@fb.com, josef@toxicpanda.com, xiubli@redhat.com, idryomov@gmail.com, jlayton@kernel.org, jaharkes@cs.cmu.edu, coda@cs.cmu.edu, jlbec@evilplan.org, hch@lst.de, nico@fluxnic.net, rafael@kernel.org, code@tyhicks.com, ardb@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, linkinjeon@kernel.org, sj1557.seo@samsung.com, jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, hirofumi@mail.parknet.co.jp, miklos@szeredi.hu, rpeterso@redhat.com, agruenba@redhat.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net, mikulas@artax.karlin.mff.cuni.cz, mike.kravetz@oracle.com, muchun.song@linux.dev, dwmw2@infradead.org, shaggy@kernel.org, tj@kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, chuck.lever@oracle.com, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, konishi.ryusuke@gmail.com, anton@tuxera.com, almaz.alexandrovich@paragon-software.com, mark@fasheh.com, joseph.qi@linux.alibaba.com, me@bobcopeland.com, hubcap@omnibond.com, martin@omnibond.com, amir73il@gmail.com, mcgrof@kernel.org, yzaikin@google.com, tony.luck@intel.com, gpiccoli@igalia.com, al@alarsen.net, sfrench@samba.org, pc@manguebit.com, lsahlber@redhat.com, sprasad@microsoft.com, senozhatsky@chromium.org, phillip@squashfs.org.uk, rostedt@goodmis.org, mhiramat@kernel.org, dushistov@mail.ru, hdegoede@redhat.com, djwong@kernel.org, dlemoal@kernel.org, naohiro.aota@wdc.com, jth@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, hughd@google.com, akpm@linux-foundation.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, john.johansen@canonical.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, jgross@suse.com, stern@rowland.harvard.edu, lrh2000@pku.edu.cn, sebastian.reichel@collabora.com, wsa+renesas@sang-engineering.com, quic_ugoswami@quicinc.com, quic_linyyuan@quicinc.com, john@keeping.me.uk, error27@gmail.com, quic_uaggarwa@quicinc.com, hayama@lineo.co.jp, jomajm@gmail.com, axboe@kernel.dk, dhavale@google.com, dchinner@redhat.com, hannes@cmpxchg.org, zhangpeng362@huawei.com, slava@dubeyko.com, gargaditya08@live.com, penguin-kernel@I-love.SAKURA.ne.jp, yifeliu@cs.stonybrook.edu, madkar@cs.stonybrook.edu, ezk@cs.stonybrook.edu, yuzhe@nfschina.com, willy@infradead.org, okanatov@gmail.com, jeffxu@chromium.org, linux@treblig.org, mirimmad17@gmail.com, yijiangshan@kylinos.cn, yang.yang29@zte.com.cn, xu.xin16@zte.com.cn, chengzhihao1@huawei.com, shr@devkernel.io, Liam.Howlett@Oracle.com, adobriyan@gmail.com, chi.minghao@zte.com.cn, roberto.sassu@huawei.com, linuszeng@tencent.com, bvanassche@acm.org, zohar@linux.ibm.com, yi.zhang@huawei.com, trix@redhat.com, fmdefrancesco@gmail.com, ebiggers@google.com, princekumarmaurya06@gmail.com, chenzhongjin@huawei.com, riel@surriel.com, shaozhengchao@huawei.com, jingyuwang_vip@163.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, 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 Cc: Jan Kara Subject: [PATCH v2 07/92] fs: add ctime accessors infrastructure Date: Wed, 5 Jul 2023 14:58:10 -0400 Message-ID: <20230705185812.579118-2-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705185812.579118-1-jlayton@kernel.org> References: <20230705185812.579118-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 32D04C0012 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 8ucgrpmwsbzkgfhrrdnq5xezpa15zo39 X-HE-Tag: 1688583531-265600 X-HE-Meta: U2FsdGVkX19/siDmNig+PMKAk7Wqj7yHsJ7ppldaA3tf55PrTCPfxqODDuE7jSRywqXb5LNHVBPRhiCnUrWe6IdBYzVN0z8go/JP3WsDVXIw4dxd9MDOi0Iby0u7vZKSf5ocZsS7MXACTA9gijv7pq31ZFNuKIm/U/wfYbK83AB+eQnlADgjH416S3xNp4ImQwxBcgyHQMojAzRTXViLTblaFiNjqxjo1LOKP/E2Dlvd531zjdprc82BlhoUI3K3Fq8sbXibryBXlMJCYm4U1Vv+x+k+VEOmzja07g9/OLleOTpXKcF5u4iO5+MSEWqs8V/T9oix6UIotcUp4vRR59Cjy+l8w9hlMk5ZwTOl3nJyitc204wvVEUlEywW/Ni1chqpepV1RcBqMSIQCdVfXg64Qh2hsTHeCjdFc1DN7YLcaLrIoMZWKd8ubPMBIUSETkGDEEdcmw9WCeVoJjWKQhdQ0MEu2P/Qz5+x0PII4jIkHbHKaNJr/P5DeXOYRUdUmE/M806mZQQDeg3/rhTEF728Hpw7xMD34ZFJjxtJxe1yyXz3dlyTiGeU+qzv7/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rZdA+z44OBvIkoWrpnGUPOK8rfrPD2cbwhEYrgKyU/kwQZhXNofb/wBXLCbyICkG01675yLXkFg4oHOsMxWFqB2T2k6AGAhFKGHEBIxfVo/+IlZ1B32C2xRqoyljCV9N8v6P9VnNB72 b1vdbpYW TXtac8zmZhBwN15xl5MqKURPZ+oDymQEieSyZH9PXcMtvHjdbQ184//rJIgb0kJBvu6I4A7FLcKbWflvy9qtPNZ40icR++jOtDXbdCOXABwIYS9PdBQLFLhARIK3xj3+aG+gkS3KaPqnJqBRasaDrieuq3OUdS24l3n5vV7il2wKWMa/HDf1GjWJE1CYm7DjzQ9Ivu839BkimvxILOKaKsrCKG4Un1KWTZGsmR73wKFDUArRLLzLuvaTM95WpIF1WS9zEuvo7dDnjFWJNIT5fWUkPwQ3P7RIVw/c4u0JmIIIMollZ+02mi3Sya0YM0iYjsq1mw5C7NCwY7VXE5pRh02vRTk1MZpLwdOz+1UV7XRADVPX6j8qJ555pP8Mx2c9YHQA1Ids6uaxRVUHx466ytDbpOZ455MHcNBzGTLz3QwfGsuW8BAUbmKwXwbUCRRRE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000033, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: struct timespec64 has unused bits in the tv_nsec field that can be used for other purposes. In future patches, we're going to change how the inode->i_ctime is accessed in certain inodes in order to make use of them. In order to do that safely though, we'll need to eradicate raw accesses of the inode->i_ctime field from the kernel. Add new accessor functions for the ctime that we use to replace them. Reviewed-by: Jan Kara Reviewed-by: Luis Chamberlain Signed-off-by: Jeff Layton Reviewed-by: Damien Le Moal --- fs/inode.c | 16 ++++++++++++++++ include/linux/fs.h | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/fs/inode.c b/fs/inode.c index d37fad91c8da..21b026d95b51 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2499,6 +2499,22 @@ struct timespec64 current_time(struct inode *inode) } EXPORT_SYMBOL(current_time); +/** + * inode_set_ctime_current - set the ctime to current_time + * @inode: inode + * + * Set the inode->i_ctime to the current value for the inode. Returns + * the current value that was assigned to i_ctime. + */ +struct timespec64 inode_set_ctime_current(struct inode *inode) +{ + struct timespec64 now = current_time(inode); + + inode_set_ctime(inode, now.tv_sec, now.tv_nsec); + return now; +} +EXPORT_SYMBOL(inode_set_ctime_current); + /** * in_group_or_capable - check whether caller is CAP_FSETID privileged * @idmap: idmap of the mount @inode was found from diff --git a/include/linux/fs.h b/include/linux/fs.h index 824accb89a91..bdfbd11a5811 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1474,7 +1474,50 @@ static inline bool fsuidgid_has_mapping(struct super_block *sb, kgid_has_mapping(fs_userns, kgid); } -extern struct timespec64 current_time(struct inode *inode); +struct timespec64 current_time(struct inode *inode); +struct timespec64 inode_set_ctime_current(struct inode *inode); + +/** + * inode_get_ctime - fetch the current ctime from the inode + * @inode: inode from which to fetch ctime + * + * Grab the current ctime from the inode and return it. + */ +static inline struct timespec64 inode_get_ctime(const struct inode *inode) +{ + return inode->i_ctime; +} + +/** + * inode_set_ctime_to_ts - set the ctime in the inode + * @inode: inode in which to set the ctime + * @ts: value to set in the ctime field + * + * Set the ctime in @inode to @ts + */ +static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, + struct timespec64 ts) +{ + inode->i_ctime = ts; + return ts; +} + +/** + * inode_set_ctime - set the ctime in the inode + * @inode: inode in which to set the ctime + * @sec: tv_sec value to set + * @nsec: tv_nsec value to set + * + * Set the ctime in @inode to { @sec, @nsec } + */ +static inline struct timespec64 inode_set_ctime(struct inode *inode, + time64_t sec, long nsec) +{ + struct timespec64 ts = { .tv_sec = sec, + .tv_nsec = nsec }; + + return inode_set_ctime_to_ts(inode, ts); +} /* * Snapshotting support. From patchwork Wed Jul 5 18:58: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: 13302669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E8B5EB64DD for ; Wed, 5 Jul 2023 18:59:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 585118D0003; Wed, 5 Jul 2023 14:59:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 50EA08D0001; Wed, 5 Jul 2023 14:59:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EBFC8D0003; Wed, 5 Jul 2023 14:59:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1EF138D0001 for ; Wed, 5 Jul 2023 14:59:13 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id E4B211A0497 for ; Wed, 5 Jul 2023 18:59:12 +0000 (UTC) X-FDA: 80978470944.16.53CCE3A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 075B640009 for ; Wed, 5 Jul 2023 18:59:10 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="SV/pROPi"; spf=pass (imf12.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688583551; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ReqA6iULWNP01vdMNQO/9GaGuHnlFE8K/R95B3vy3dg=; b=zIgEsuBtv3dNe93gkuFZ3ouXVZPjLtzQB/Yee3FmKeDc3zBLB/m7BAI3kQn++8Zx405/vm kKWEJ21fo2zeuiC1nzfUgWcWfwARjg5doWuDRq/BMnyRC2uC3AVacsErINOsNqsNhA988r pYanBLa3x2zFwYMAMVRl47LYxMab+rU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688583551; a=rsa-sha256; cv=none; b=NZH/BpnkAE2kUa15vluGu5RgNM/lgDU5ewAaD+K59rg1e0e+DTYOoLkgFKXBy0oDac+GR7 DZVgvuwuPywGULP8GPQ3K+94cx/ivFkyrYTnuA7XZSdg7uleLcWV6M1Zco8ub5X3TUPuYN ATuqWkPEm6qeA537cHhbSy/jpGmpUYo= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="SV/pROPi"; spf=pass (imf12.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8E12A616E0; Wed, 5 Jul 2023 18:59:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEEF1C4167D; Wed, 5 Jul 2023 18:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583549; bh=96h56beXLMAvkoYPxw1Hf+1T9dWrr7543/fVCrKiiH8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SV/pROPiikvWgbuJG9o5j/mdUiyRGcRaEJl1K0hVl0eCHK9Ob+YmgZ0cOVDNwxcd0 s3XXK3FiPaVML6VBfbeTny5HiSuKA0KEKAjFDlBtEkXvpck7V4KUAdjnzKCg5fiugt aiOuDDRaoB7EF/ycBMYU5USexpq/ceGXPIb8HpDBW4vIvyY547qmZyivJt5T6PXA4H rtd7d3FTcpVX0DGPx74bauINVbOI0AHI9Zym6FoqdyCXdEJPTgmmD/blFQIJoOkcln fC0uEV1EXwoGgwuuPieKxDXph4tQwZUYbTrLEd3zCpi9KdekgoBzBb9kt9un4ZFr7M 0DXS4Kyxlm/3g== From: Jeff Layton To: jk@ozlabs.org, arnd@arndb.de, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com, maco@android.com, joel@joelfernandes.org, brauner@kernel.org, cmllamas@google.com, surenb@google.com, dennis.dalessandro@cornelisnetworks.com, jgg@ziepe.ca, leon@kernel.org, bwarrum@linux.ibm.com, rituagar@linux.ibm.com, ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com, dsterba@suse.com, dhowells@redhat.com, marc.dionne@auristor.com, viro@zeniv.linux.org.uk, raven@themaw.net, luisbg@kernel.org, salah.triki@gmail.com, aivazian.tigran@gmail.com, ebiederm@xmission.com, keescook@chromium.org, clm@fb.com, josef@toxicpanda.com, xiubli@redhat.com, idryomov@gmail.com, jlayton@kernel.org, jaharkes@cs.cmu.edu, coda@cs.cmu.edu, jlbec@evilplan.org, hch@lst.de, nico@fluxnic.net, rafael@kernel.org, code@tyhicks.com, ardb@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, linkinjeon@kernel.org, sj1557.seo@samsung.com, jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, hirofumi@mail.parknet.co.jp, miklos@szeredi.hu, rpeterso@redhat.com, agruenba@redhat.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net, mikulas@artax.karlin.mff.cuni.cz, mike.kravetz@oracle.com, muchun.song@linux.dev, dwmw2@infradead.org, shaggy@kernel.org, tj@kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, chuck.lever@oracle.com, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, konishi.ryusuke@gmail.com, anton@tuxera.com, almaz.alexandrovich@paragon-software.com, mark@fasheh.com, joseph.qi@linux.alibaba.com, me@bobcopeland.com, hubcap@omnibond.com, martin@omnibond.com, amir73il@gmail.com, mcgrof@kernel.org, yzaikin@google.com, tony.luck@intel.com, gpiccoli@igalia.com, al@alarsen.net, sfrench@samba.org, pc@manguebit.com, lsahlber@redhat.com, sprasad@microsoft.com, senozhatsky@chromium.org, phillip@squashfs.org.uk, rostedt@goodmis.org, mhiramat@kernel.org, dushistov@mail.ru, hdegoede@redhat.com, djwong@kernel.org, dlemoal@kernel.org, naohiro.aota@wdc.com, jth@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, hughd@google.com, akpm@linux-foundation.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, john.johansen@canonical.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, jgross@suse.com, stern@rowland.harvard.edu, lrh2000@pku.edu.cn, sebastian.reichel@collabora.com, wsa+renesas@sang-engineering.com, quic_ugoswami@quicinc.com, quic_linyyuan@quicinc.com, john@keeping.me.uk, error27@gmail.com, quic_uaggarwa@quicinc.com, hayama@lineo.co.jp, jomajm@gmail.com, axboe@kernel.dk, dhavale@google.com, dchinner@redhat.com, hannes@cmpxchg.org, zhangpeng362@huawei.com, slava@dubeyko.com, gargaditya08@live.com, penguin-kernel@I-love.SAKURA.ne.jp, yifeliu@cs.stonybrook.edu, madkar@cs.stonybrook.edu, ezk@cs.stonybrook.edu, yuzhe@nfschina.com, willy@infradead.org, okanatov@gmail.com, jeffxu@chromium.org, linux@treblig.org, mirimmad17@gmail.com, yijiangshan@kylinos.cn, yang.yang29@zte.com.cn, xu.xin16@zte.com.cn, chengzhihao1@huawei.com, shr@devkernel.io, Liam.Howlett@Oracle.com, adobriyan@gmail.com, chi.minghao@zte.com.cn, roberto.sassu@huawei.com, linuszeng@tencent.com, bvanassche@acm.org, zohar@linux.ibm.com, yi.zhang@huawei.com, trix@redhat.com, fmdefrancesco@gmail.com, ebiggers@google.com, princekumarmaurya06@gmail.com, chenzhongjin@huawei.com, riel@surriel.com, shaozhengchao@huawei.com, jingyuwang_vip@163.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, 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 v2 08/92] fs: new helper: simple_rename_timestamp Date: Wed, 5 Jul 2023 14:58:11 -0400 Message-ID: <20230705185812.579118-3-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705185812.579118-1-jlayton@kernel.org> References: <20230705185812.579118-1-jlayton@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 075B640009 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: gbt9ea4amqsghpwy5jbti8hdc1c6dfw7 X-HE-Tag: 1688583550-799822 X-HE-Meta: U2FsdGVkX190m3YpefOXE9RdkWegw5VicLrQ2fg1LHBY+XkLS+Y/ljot2huLb7AaoYB5b3l/hSeqE1XGKRCE1l3AFGk5wfWiGLqG7KkqLLjqP825xdkNjj3Wv0nlVg7FtedzlH0K4USUFdaWe3Ekz+IBtJY1jxARZrvMy1Okp8ZCS/XnoAWpAdzLnKM5teqrLBZIvdT9+nrCairY3OVmsmmJQMgmyfoWXepJ9YHqy0TmWmFhMamCvNbgnjDiS8Jtd6ZVqZJr5G0udbdks5GpYw2JaSPNA3CgcJID/CRphRwhzJBCOTOUdXBbiQvqJS/plMevPVFXixZ9uixlL5JyCLblQwIFkFzZfiX6XbZR5evecPoGtAnIMbqyNfdus0FBzDxQbNIDTOzcAnhewavrXTwema1AdKB372u3YkYaIQqMAxR693wwFQENHBGkV/PLej5fAoYoXcQoB1sL6OCmKa4Ms98OlxCXUKkSd+m+FptlgFSGfuiqG5e2SL1E/M0Ltr3KahmDPiJyOe6excJWm0KEEXU9Gbu9IMBBoGZoD3DlrezTBxV+L7RrJuXc7WCKVCheX02SzAQxWf6wxieCE4DFgXsVLr1LmA8n2CwyGLxhnKAcPW3avcHlwmWY5Xcf2jDWdnZYFLL9xHFmj1mhtbeCnJptHTlxBQ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flb6raujGLp8nCcQ/9QWw8FDJ76tJMtIh0ab1Gv0LLICUk19AZv3rSvzuzs XSJEgl1L MxpwlVx6zya9YG6yrolvToKWLNimMFCDv9C9tDg3dYDQyeiUbsasO+Nk8LwMypSE/dlWD1qlkj707lFXFTe5b9EEHAGl2NOIA7uhBA2D5KjDnqjnN3LceoY8Xbtwmjaid+qCS+TsJywBswd11nGuFQ0RbIShupwDUf+n+Sqzlj2/IgDSE7z6HVBoicq2EO7MFsWrrlSsN/UlWqSXlRCPFYdDRP4nFOzZa3YxGt8CcrY7rJar9Ukdb4Sj5c+7IVWcWpSe+VyCVVmldYwYk0494Qg/jxm7eNRAXZXuiF4iUYfJAbOqSup5BKYzwaOoqJSYQojGJkJuAenOOdD1NGGliDmyd1ToWqtUq52QV6kQqdYawJod3jFLv28MYWZaE+ycpGsxlqEZN4PG+IyTHHzk3IC7bz9wi3wqVWSvZDgPc8GfeeqkdtpYJpebZ78I1IhHkyq8UXehwZurbfVM9LPdh1y+f/R70eJHXCl9SXLwha5g== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000233, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: A rename potentially involves updating 4 different inode timestamps. Add a function that handles the details sanely, and convert the libfs.c callers to use it. Signed-off-by: Jeff Layton Reviewed-by: Jan Kara --- fs/libfs.c | 36 +++++++++++++++++++++++++++--------- include/linux/fs.h | 2 ++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/fs/libfs.c b/fs/libfs.c index a7e56baf8bbd..9ee79668c909 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -692,6 +692,31 @@ int simple_rmdir(struct inode *dir, struct dentry *dentry) } EXPORT_SYMBOL(simple_rmdir); +/** + * simple_rename_timestamp - update the various inode timestamps for rename + * @old_dir: old parent directory + * @old_dentry: dentry that is being renamed + * @new_dir: new parent directory + * @new_dentry: target for rename + * + * POSIX mandates that the old and new parent directories have their ctime and + * mtime updated, and that inodes of @old_dentry and @new_dentry (if any), have + * their ctime updated. + */ +void simple_rename_timestamp(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry) +{ + struct inode *newino = d_inode(new_dentry); + + old_dir->i_mtime = inode_set_ctime_current(old_dir); + if (new_dir != old_dir) + new_dir->i_mtime = inode_set_ctime_current(new_dir); + inode_set_ctime_current(d_inode(old_dentry)); + if (newino) + inode_set_ctime_current(newino); +} +EXPORT_SYMBOL_GPL(simple_rename_timestamp); + int simple_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { @@ -707,11 +732,7 @@ int simple_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, inc_nlink(old_dir); } } - old_dir->i_ctime = old_dir->i_mtime = - new_dir->i_ctime = new_dir->i_mtime = - d_inode(old_dentry)->i_ctime = - d_inode(new_dentry)->i_ctime = current_time(old_dir); - + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); return 0; } EXPORT_SYMBOL_GPL(simple_rename_exchange); @@ -720,7 +741,6 @@ int simple_rename(struct mnt_idmap *idmap, struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry, unsigned int flags) { - struct inode *inode = d_inode(old_dentry); int they_are_dirs = d_is_dir(old_dentry); if (flags & ~(RENAME_NOREPLACE | RENAME_EXCHANGE)) @@ -743,9 +763,7 @@ int simple_rename(struct mnt_idmap *idmap, struct inode *old_dir, inc_nlink(new_dir); } - old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime = - new_dir->i_mtime = inode->i_ctime = current_time(old_dir); - + simple_rename_timestamp(old_dir, old_dentry, new_dir, new_dentry); return 0; } EXPORT_SYMBOL(simple_rename); diff --git a/include/linux/fs.h b/include/linux/fs.h index bdfbd11a5811..14e38bd900f1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2979,6 +2979,8 @@ extern int simple_open(struct inode *inode, struct file *file); extern int simple_link(struct dentry *, struct inode *, struct dentry *); extern int simple_unlink(struct inode *, struct dentry *); extern int simple_rmdir(struct inode *, struct dentry *); +void simple_rename_timestamp(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry); extern int simple_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry); extern int simple_rename(struct mnt_idmap *, struct inode *, From patchwork Wed Jul 5 18:58: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: 13302670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37F5AC04FDF for ; Wed, 5 Jul 2023 18:59:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 907978D0002; Wed, 5 Jul 2023 14:59:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 890DA8D0001; Wed, 5 Jul 2023 14:59:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66E358D0002; Wed, 5 Jul 2023 14:59:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 576598D0001 for ; Wed, 5 Jul 2023 14:59:32 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id ECFB9B0497 for ; Wed, 5 Jul 2023 18:59:31 +0000 (UTC) X-FDA: 80978471742.14.8025707 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 480DB20005 for ; Wed, 5 Jul 2023 18:59:30 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lcNGsVln; spf=pass (imf13.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688583570; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=R7MSuU1mdVZCSC5B0T9mYRKityO5tOlNXZ/D6zp029E=; b=pYR+IaPGvDqLSyYNwIli4mYz1Zwv5at0IUimBPCuDt+HGPqmOzV4dtkpc8vplb5KdNQjoQ 0uVpgcjys1bStIOwOHRqxnfxhsKx+EyKSUSiN3RZwQDidl5PIVNr+5RaskT9Yf1EAxq1ul TRPz9wV8l5r8Fde0ENqdGU35SVQHDak= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688583570; a=rsa-sha256; cv=none; b=puVH2yO5h+VFF//UgZEyjAAsS5UUzpQJLjpqYz3u35L70RYcevZWe9CVxOB39iwY+vP3VY gBRSDT0+R+zd0pCVOItOobXux6tWhF0zAxzGeVOHGKswL9DrAbjhaQhc6BSR/KnrNahuVz E2OIueRZ+Hcer5oTZ/I/nUThANl15dk= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=lcNGsVln; spf=pass (imf13.hostedemail.com: domain of jlayton@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 028D8616DF; Wed, 5 Jul 2023 18:59:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54945C433BC; Wed, 5 Jul 2023 18:59:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688583567; bh=upDmKDv+6xjSiy7POdUF+8WFopDSBgqOL9aHcGqhK2Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lcNGsVlnIbVft2o9WVSu7oStzcC7UruKn4c1DTBWmjGO00DNBCt3+ZZxjK6miMMj/ GBdLPvZ/RE2acwmtA26p1q8MtPtZ6AFXE1afuhwSlwu52+nzTrcPM9ox138DUXq3pP a+auUEyCQ5+EySj5vT4AGLwnwLHJre6WjBG5uo1Fk/D4NwBI39aiCvuIo2r0b4YzkK eGFkZHIr8aozqfMt+EZCLKVtueQinWQYpN5V9F3hby1Tiu5AXVWEdS37dhPfamlHdD XsiVC3GdeisubCKxKkTGzRJBTmma2JIDfH5g8iF/7cOUhrr8m/tq4qK4hAP5wOyo8R g+tGtW7J9HY7Q== From: Jeff Layton To: jk@ozlabs.org, arnd@arndb.de, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, gregkh@linuxfoundation.org, arve@android.com, tkjos@android.com, maco@android.com, joel@joelfernandes.org, brauner@kernel.org, cmllamas@google.com, surenb@google.com, dennis.dalessandro@cornelisnetworks.com, jgg@ziepe.ca, leon@kernel.org, bwarrum@linux.ibm.com, rituagar@linux.ibm.com, ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org, linux_oss@crudebyte.com, dsterba@suse.com, dhowells@redhat.com, marc.dionne@auristor.com, viro@zeniv.linux.org.uk, raven@themaw.net, luisbg@kernel.org, salah.triki@gmail.com, aivazian.tigran@gmail.com, ebiederm@xmission.com, keescook@chromium.org, clm@fb.com, josef@toxicpanda.com, xiubli@redhat.com, idryomov@gmail.com, jlayton@kernel.org, jaharkes@cs.cmu.edu, coda@cs.cmu.edu, jlbec@evilplan.org, hch@lst.de, nico@fluxnic.net, rafael@kernel.org, code@tyhicks.com, ardb@kernel.org, xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com, linkinjeon@kernel.org, sj1557.seo@samsung.com, jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, jaegeuk@kernel.org, hirofumi@mail.parknet.co.jp, miklos@szeredi.hu, rpeterso@redhat.com, agruenba@redhat.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net, mikulas@artax.karlin.mff.cuni.cz, mike.kravetz@oracle.com, muchun.song@linux.dev, dwmw2@infradead.org, shaggy@kernel.org, tj@kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, chuck.lever@oracle.com, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, konishi.ryusuke@gmail.com, anton@tuxera.com, almaz.alexandrovich@paragon-software.com, mark@fasheh.com, joseph.qi@linux.alibaba.com, me@bobcopeland.com, hubcap@omnibond.com, martin@omnibond.com, amir73il@gmail.com, mcgrof@kernel.org, yzaikin@google.com, tony.luck@intel.com, gpiccoli@igalia.com, al@alarsen.net, sfrench@samba.org, pc@manguebit.com, lsahlber@redhat.com, sprasad@microsoft.com, senozhatsky@chromium.org, phillip@squashfs.org.uk, rostedt@goodmis.org, mhiramat@kernel.org, dushistov@mail.ru, hdegoede@redhat.com, djwong@kernel.org, dlemoal@kernel.org, naohiro.aota@wdc.com, jth@kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, hughd@google.com, akpm@linux-foundation.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, john.johansen@canonical.com, paul@paul-moore.com, jmorris@namei.org, serge@hallyn.com, stephen.smalley.work@gmail.com, eparis@parisplace.org, jgross@suse.com, stern@rowland.harvard.edu, lrh2000@pku.edu.cn, sebastian.reichel@collabora.com, wsa+renesas@sang-engineering.com, quic_ugoswami@quicinc.com, quic_linyyuan@quicinc.com, john@keeping.me.uk, error27@gmail.com, quic_uaggarwa@quicinc.com, hayama@lineo.co.jp, jomajm@gmail.com, axboe@kernel.dk, dhavale@google.com, dchinner@redhat.com, hannes@cmpxchg.org, zhangpeng362@huawei.com, slava@dubeyko.com, gargaditya08@live.com, penguin-kernel@I-love.SAKURA.ne.jp, yifeliu@cs.stonybrook.edu, madkar@cs.stonybrook.edu, ezk@cs.stonybrook.edu, yuzhe@nfschina.com, willy@infradead.org, okanatov@gmail.com, jeffxu@chromium.org, linux@treblig.org, mirimmad17@gmail.com, yijiangshan@kylinos.cn, yang.yang29@zte.com.cn, xu.xin16@zte.com.cn, chengzhihao1@huawei.com, shr@devkernel.io, Liam.Howlett@Oracle.com, adobriyan@gmail.com, chi.minghao@zte.com.cn, roberto.sassu@huawei.com, linuszeng@tencent.com, bvanassche@acm.org, zohar@linux.ibm.com, yi.zhang@huawei.com, trix@redhat.com, fmdefrancesco@gmail.com, ebiggers@google.com, princekumarmaurya06@gmail.com, chenzhongjin@huawei.com, riel@surriel.com, shaozhengchao@huawei.com, jingyuwang_vip@163.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org, linux-usb@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, autofs@vger.kernel.org, linux-mm@kvack.org, linux-btrfs@vger.kernel.org, ceph-devel@vger.kernel.org, codalist@coda.cs.cmu.edu, ecryptfs@vger.kernel.org, linux-efi@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, 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 v2 92/92] fs: rename i_ctime field to __i_ctime Date: Wed, 5 Jul 2023 14:58:12 -0400 Message-ID: <20230705185812.579118-4-jlayton@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230705185812.579118-1-jlayton@kernel.org> References: <20230705185812.579118-1-jlayton@kernel.org> MIME-Version: 1.0 X-Stat-Signature: gmwtgzsfdwbqs6nj5jroj5uwfp96a1dj X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 480DB20005 X-Rspam-User: X-HE-Tag: 1688583570-961037 X-HE-Meta: U2FsdGVkX19aGcGQ5IKjMDKwh6Qqp//EtQcGj948nTkf9HRrRH4uDL393Qvo+rsBodQ7qUkH2cCmUBAFU8EpUYc0wMkk52zJAb00RgP//elJfm62MBSy+s67b/RdV5Q0ngFkT99tE29iPC0BUQbw3VD5DbAGJdq4C+mSJFoVNllc4C8yop3JT7f5h1Ldc1ukbxA1Z+DzwrhBpAywh4+PwtEofw+KAHz/UVVZvWa9w+cupvHn0/5F5Rjw2cD9Jfra+W+4e/ZutiVfpXa35gfsEHlr8bwTF+oK3qZUfxeIwpwxpFl2D6VnHUjjDwH1ibiUnf3gCGRsC5TaDmVcdJS9uOZ8sMj3QKZlFRAuFRaacpOVsU3yURKtUHpnFXGB/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ao3VODKHuwDeJ+Yi6sgQ6f2kISWQAzvITB0NJZRlR4FBcl6GuTuSUNT7HY4bzGXfxEsTqv97qtCc2N41/ZMjP+vC2UBdCo9qHIlI8cR6eZGHdhBRrm1WOq9fQIbLcAYWSPg2q0gcSEMRb1FsGkvUzrYGyACf5qiO8rGBuwK83UMhvFGSzsBKwoAanEisg2HYcwYosPY2vZm4htT1ooKDwO+B6yA1/hHY8bse0wUqFzwoi5d7JRO/Y1ONhtztIpCa2/fzEhxXZQSMEhESm7AZ/WlOrvhuh9pAZlXM8AkM6WCQ8Vf/rqVrGDPbNZejnufUeST57QHkOfx5avBUAvZlNoEd+koC lMVZfFyZ q1FjjpvkqsXD01c8FhYWq76y/PLGZaRagNH80UBy0H0K0X32xp9nczXNr/PAj3qy8yHHjOsrDTg50qpnX9EjUbBoyKi3UZMJ6RsMHsGIk46diylKuaEKE0QTUym9icQgDrWIvCnjEyYfBkJ8aOtMGbIfDE2Dvrjryi1VATqhAWK+DCdA4gZP1jzxmeXAjjpnADswwwTQMry/f1Aibv+wX4o60zX1H+OZq3oM+KoBCpnjuulPTYMu4Hn/q4rYHNT2IySE37wTKaBShE4TdKEKQpphSm7or5ccu+3k3E+USGnE1UMwCvBDXFgHB/hoWv63i73gWsgQ+gCeZGikRZgLuy49Cz3rAO7irRevR/T3YR/oCUa6yD0fzfU6AoW8TxsCdHjkgR1jDHY7NVOcDK+WKeS/QGChk2vylxZ+Y7bW9Ee2sOaNIv3FS9N14UMbXJLmAiyqlIXUEvM7x+58Hhhytds0Gag2bWex1WK2Pg7U4Tiw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000253, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Now that everything in-tree is converted to use the accessor functions, rename the i_ctime field in the inode to discourage direct access. Signed-off-by: Jeff Layton Reviewed-by: Damien Le Moal Reviewed-by: Jan Kara --- include/linux/fs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index 14e38bd900f1..b66442f91835 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -642,7 +642,7 @@ struct inode { loff_t i_size; struct timespec64 i_atime; struct timespec64 i_mtime; - struct timespec64 i_ctime; + 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; @@ -1485,7 +1485,7 @@ struct timespec64 inode_set_ctime_current(struct inode *inode); */ static inline struct timespec64 inode_get_ctime(const struct inode *inode) { - return inode->i_ctime; + return inode->__i_ctime; } /** @@ -1498,7 +1498,7 @@ 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 = ts; return ts; }