From patchwork Mon Jul 1 10:26:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13717782 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 40ACBC30653 for ; Mon, 1 Jul 2024 10:27:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C220B6B009A; Mon, 1 Jul 2024 06:27:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BAAB26B009B; Mon, 1 Jul 2024 06:27:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9FD286B009C; Mon, 1 Jul 2024 06:27:19 -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 7A74E6B009A for ; Mon, 1 Jul 2024 06:27:19 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 244BF8120E for ; Mon, 1 Jul 2024 10:27:19 +0000 (UTC) X-FDA: 82290806598.08.A4541D4 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf21.hostedemail.com (Postfix) with ESMTP id BD11E1C000C for ; Mon, 1 Jul 2024 10:27:16 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YLs4U1yk; spf=pass (imf21.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719829617; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DL7KnWgv8BjNXe3zLubPpQhmk5E4gZYXOfvsXPMQ0rU=; b=WB+No0yJP0b/efGfB8z6f0OO6jVKKxmQM4dvL+3adqOot0MuiIPOgBSLi+xDV30AYZooQo jOz7E6ABAmPeXGm7A+V3Vat0taKY/RF+OOUUHVye/KQ5iTsGPxi+zuW/x8vj8kcvVbtdni c9gOlv/VfA8lxF8hRr8VkOpUH4YKPY8= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719829617; a=rsa-sha256; cv=none; b=N4kpVgBalPlZ5koQSZfj6TELBGhEAg4XdsbV+0ioUAS7QiXyE7AdBadRqN4WNNkTavMN8h vvKPeSVlEPH+sIGsMz4gthvcBdM2zvMD7X/uHbseVCUVlbSiQ60WNDzB4t4wddP89wgAaw MosGM3Od60FSbDAXHQzfC+gsYd4NbPw= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=YLs4U1yk; spf=pass (imf21.hostedemail.com: domain of jlayton@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=jlayton@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 7085DCE1173; Mon, 1 Jul 2024 10:27:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AFD53C4AF0D; Mon, 1 Jul 2024 10:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719829632; bh=+Ll5hg7fP/HJuANKEHFNQPWIdpLiw73n3t3+REkgl74=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YLs4U1yk31/nkByopNeyavqaYbshC2B3idXBrhXHXRo2CcqTf76gc7chybjngqegu 4i8ky0uvI81yiLqr3gc1M2z69PEWNKsksBPjh4PM1UpwzLF15an2pnmGEuGQpvVzpM kNtJxzZW27XgO31tmYxQb+sOB8Q/MVNfNcAhRRjFIDF4PGhPTjkeXTRO/h5YyjyFBZ dpaEMVm8YEW1LEFMvaC3h5qSOFDM3Mq/oiRMq60sfJDzXQks7WTbpzUFXvuk0+40F1 HP/zsQmVq2PxVJP4pG6RP+3c9ireNOi2t0mSMPi85aMTTXdnal2UTVLJbETSHU4bOp laaBRljmQ3/NA== From: Jeff Layton Date: Mon, 01 Jul 2024 06:26:38 -0400 Subject: [PATCH v2 02/11] fs: uninline inode_get_ctime and inode_set_ctime_to_ts MIME-Version: 1.0 Message-Id: <20240701-mgtime-v2-2-19d412a940d9@kernel.org> References: <20240701-mgtime-v2-0-19d412a940d9@kernel.org> In-Reply-To: <20240701-mgtime-v2-0-19d412a940d9@kernel.org> To: Alexander Viro , Christian Brauner , Jan Kara , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Chandan Babu R , "Darrick J. Wong" , Theodore Ts'o , Andreas Dilger , Chris Mason , Josef Bacik , David Sterba , Hugh Dickins , Andrew Morton Cc: Andi Kleen , kernel-team@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, Jeff Layton X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2576; i=jlayton@kernel.org; h=from:subject:message-id; bh=+Ll5hg7fP/HJuANKEHFNQPWIdpLiw73n3t3+REkgl74=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmgoR4Q8RRSxWkQGur2eUnM/gRhrlIRHemdFcK6 Pl9reaXAbSJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZoKEeAAKCRAADmhBGVaC Fb2HEACJ1w7tWJnhLJJHKtIkdTLk/MbD2FV/05Q8JpoUDULrSi2uxwNwsZyUcSTvWlJ7jcH5Th0 dJM6XvoRTYVsd5gyGTJJgTNwCu6GiSbenps/IatnCVH+aGz5ziOxYS4WIYicKw04VP0cxp4oJ34 pdnfOxTgVlSGiSIdeqy1n4Rjbtz3fRosxKP9Et4XlbzVbyRkbUbwjKYuMLcRESjAh507dfENdAi B4fHUsSmf1Sl2IiPZ+kDr/15LDbCqG+nhjQC6ksB+WyYiZE/0VfYXCuJcHJFT9loALbpGS2avhN 9SKYEAF1LMptopK1PAC/qTr9R9sFAmqF6S+s0HHVcI/RNmOLgr664ZHAdGCgxDjZ1kp1VKN27QQ esvHwRRCQaU2cHSGpdg02ajzEQWmtiC3bP4P9XCJJFmsM/pfLRMbQ9WscHTWUUVVThq/56/Lply 5PnVt9ZZbqq1r9kvwbUii4CBn/Z84D/5nYHYWS+i66DNp6/hIm2kCPBJaN8VrVeY6Wodv5JzIt/ KPHC/Lyntosv80bsit416E/riPN6u79SOs4HshmdZbJeW/PLyRasc2YRZehXMqh9ufqdsvUhMs0 Nfc40554ynAy/xY9i1/lZ0v8xjyAgjRsRBl0hxBSKaLqinyOHIsaUoLuwewvhg08NAXaQIGKwuO YG+8TUTESXdJNZA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-Rspamd-Queue-Id: BD11E1C000C X-Stat-Signature: pg9wok18sfbhzg6j8fchf96mwqejq48j X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1719829636-388722 X-HE-Meta: U2FsdGVkX19RdXMFbG+zmeHVB6cr+4ZjktPYZ87SdmjqG5+XJOOgGoSNcumndXb7n+RH9j4DqXF5+e0a8zaURsDz5pr7J47LmuuRkBUVqSW2RqUrThYnZZ8OSuqPYgv2igoMXR49si8YoyWxSK7FkfljcBUMhKv4F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CkOVIXdNR+bN58uMJFGiQ+WhzAsYS3eZVRyMSI1tjkE2mloptgDKM1KnUReBcrLrTycmJPjDRY9Kv7Rd0KOcQPzx3gUCDZAnEwZHmzVtJbFXm/7rHUR8cf4+4yyk5+QCFfRrqhdDedXZF38te9DkME1MKzd X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Move both functions to fs/inode.c as they have grown a little large for inlining. Signed-off-by: Jeff Layton --- fs/inode.c | 25 +++++++++++++++++++++++++ include/linux/fs.h | 13 ++----------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index e0815acc5abb..7b0a73ed499d 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2501,6 +2501,31 @@ struct timespec64 current_time(struct inode *inode) } EXPORT_SYMBOL(current_time); +/** + * inode_get_ctime - fetch the current ctime from the inode + * @inode: inode from which to fetch ctime + * + * Grab the current ctime tv_nsec field from the inode, mask off the + * I_CTIME_QUERIED flag and return it. This is mostly intended for use by + * internal consumers of the ctime that aren't concerned with ensuring a + * fine-grained update on the next change (e.g. when preparing to store + * the value in the backing store for later retrieval). + */ +struct timespec64 inode_get_ctime(const struct inode *inode) +{ + ktime_t ctime = inode->__i_ctime; + + return ktime_to_timespec64(ctime); +} +EXPORT_SYMBOL(inode_get_ctime); + +struct timespec64 inode_set_ctime_to_ts(struct inode *inode, struct timespec64 ts) +{ + inode->__i_ctime = ktime_set(ts.tv_sec, ts.tv_nsec); + return ts; +} +EXPORT_SYMBOL(inode_set_ctime_to_ts); + /** * inode_set_ctime_current - set the ctime to current_time * @inode: inode diff --git a/include/linux/fs.h b/include/linux/fs.h index 7110d6dc9aab..8e271c9e4a00 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1608,10 +1608,8 @@ static inline struct timespec64 inode_set_mtime(struct inode *inode, return inode_set_mtime_to_ts(inode, ts); } -static inline struct timespec64 inode_get_ctime(const struct inode *inode) -{ - return ktime_to_timespec64(inode->__i_ctime); -} +struct timespec64 inode_get_ctime(const struct inode *inode); +struct timespec64 inode_set_ctime_to_ts(struct inode *inode, struct timespec64 ts); static inline time64_t inode_get_ctime_sec(const struct inode *inode) { @@ -1623,13 +1621,6 @@ static inline long inode_get_ctime_nsec(const struct inode *inode) return inode_get_ctime(inode).tv_nsec; } -static inline struct timespec64 inode_set_ctime_to_ts(struct inode *inode, - struct timespec64 ts) -{ - inode->__i_ctime = ktime_set(ts.tv_sec, ts.tv_nsec); - return ts; -} - /** * inode_set_ctime - set the ctime in the inode * @inode: inode in which to set the ctime