From patchwork Thu Jun 27 01:00:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13713673 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 714C7C27C4F for ; Thu, 27 Jun 2024 01:00:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 058D86B00B3; Wed, 26 Jun 2024 21:00:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 008506B00B4; Wed, 26 Jun 2024 21:00:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DC4196B00B5; Wed, 26 Jun 2024 21:00:41 -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 BC1576B00B3 for ; Wed, 26 Jun 2024 21:00:41 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 84810A45B7 for ; Thu, 27 Jun 2024 01:00:41 +0000 (UTC) X-FDA: 82274863482.21.594A370 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf21.hostedemail.com (Postfix) with ESMTP id A320D1C0008 for ; Thu, 27 Jun 2024 01:00:39 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gwls8z49; spf=pass (imf21.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=1719450027; 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=NC4aXYcOuRdqBKxS88rxgvltp9fcYZDkhSRNom2QayU=; b=yK3JhLDilBc49E9YCOAcMbyGkZ0lqzhaS/xl6LumbQX6f6zA6K4ZKdKggfGd2xAX4UbfDC i7H6v6y2aefsiJ1fayGXsV8IclfMDwUxU38ZtYlKPOosL1Rpf4n3TmVrywYs9uUnFVbKI7 4QwF7my5eyBsMD1EO/ZyfATWtnjx8W4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=gwls8z49; spf=pass (imf21.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719450027; a=rsa-sha256; cv=none; b=4lZC4XO3rpCdAW0iuV/AjoycIhiHu1jQ++FJLkeM9CAc/wxlVUvBJF0Llf3X5aMIQdXWmx FIixQRCutmRzHzbEkCAdoNtwBFC9oJ2mfmrfPRrAu3t4Jvn1h6ba+xpfvyUEFKOOEhyGy9 Qit9dJPZuqsS4xE3Z7yLZNjPkuC8Zq8= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D972461D72; Thu, 27 Jun 2024 01:00:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90D1CC116B1; Thu, 27 Jun 2024 01:00:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719450038; bh=nUcEwSwalHgLZDUtP3erKKCOQirbIJlYfFYWIa0nODA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=gwls8z49Bh6Z5E9hFJjXsBHm9SIs3cp2ZvAOef69OmFSUYxfKHGAVuX7LlJovim/5 SOafG37Usb6GgKtzkT0nz61+eEqb8xuu4hcpr7Hp8uXmTD9dHHTJYoJky7EOIrUzKS xPXP68NHYs6kL5d2drislL3eImS37sOgVS5w8cIee2N1ffPopUER5AIJKrYBI9CUTa H/cCqB0eyQLUc4dFwsYoUV9Tu5W9/EX4j4y82h1eqmSF3IEsqTMRSRDxFEa8dZBvhF Bvu5d61LKLUifHm4lGDnvgWLQDNH+VloCxi+AOd2FGnxxOkPj4PKblhSCxJVwkWDiK Bezx1LULDHrag== From: Jeff Layton Date: Wed, 26 Jun 2024 21:00:22 -0400 Subject: [PATCH 02/10] fs: uninline inode_get_ctime and inode_set_ctime_to_ts MIME-Version: 1.0 Message-Id: <20240626-mgtime-v1-2-a189352d0f8f@kernel.org> References: <20240626-mgtime-v1-0-a189352d0f8f@kernel.org> In-Reply-To: <20240626-mgtime-v1-0-a189352d0f8f@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: 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=nUcEwSwalHgLZDUtP3erKKCOQirbIJlYfFYWIa0nODA=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBmfLmu8R1wuP4JGpygk6wU7fHbGTPeS3QYH6KLh UBB5zc49iOJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZny5rgAKCRAADmhBGVaC FabcD/4mM1N+8adbvf5i1jdMSPTFwAr4F+w2yWSohHk9014i/dOuMmEmBpgENJ9AtMK5P2y/bv+ P4MY+eEzXnZ05buHgOs0fdObTEpWuMllwhp2KLU68Z2WG+m11BNai7RUYL0EBU31kOwlFLhRVbq ZTMo+6ORcgl4cWZXadf1Tn01l3772cp/xMeDoyS7kDe3MjgcYqxBwzIiLLAXLiBuqbpAXS5rrnP QEn6NCAGzt+LK1V+YTfi1YVsfMyHmROqpLaQ1XzN7SwmwPErX+ZAy/Cc5aImHBmQcaaTE9hq4Bm s6Tc+KRNHo9U75RN/LaCGPOfbOchz4QB78rXLAOEGt2GHWzBb2Djp3g81jLUpVNRajBNPmlVUdw +HqFECfXB6Mo3uUmG8pJo6++cuB9YZaGG+XVolyOHgH8THScVWV8qKc3XWA5Gph32Xgp34I0g+v rUqtcNJdxkVIThR5M0aJP7NBzNupu/cXUq4GzXMB465v30QcD9xvBcknMCWM18UgfD2x33oRuHV SNxQLu6ZlxnzkGbki8odyQYjD/cDeYIwq2kiQNrxlG+y5m7q1ypr6sfh41VWgY9xHiHNSCZOoPr ZNw8ruynyO9s8OBJfE2sgYZvJw7bRXa69ctiGQGq0u0sbxgokuiDD/3m1oody4GB9YB7nDqAI0u W20ZxJx5YHBWvEg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 X-Stat-Signature: 53of3oqxhp1cekwex4dobtkxboh411n6 X-Rspam-User: X-Rspamd-Queue-Id: A320D1C0008 X-Rspamd-Server: rspam02 X-HE-Tag: 1719450039-778156 X-HE-Meta: U2FsdGVkX1/wteDrt35mVYbTiC+InWbVXTRH/0LmY5wvmF3OCvQJeBMkIj1CFMJs31Z8C0/A3sQsj496WYghUze4iROj99vi182rwHhmBDoOmicw0QrVE9fUdKYZnubegOmAWkE7IX5/27VgrNsxEfGkCXHqeroA6lSCK8u/LgHJnCEAex7tb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fzGXlb9yfVImf6veK86e541N99cD280fc0vUgTVIc= 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 5139dec085f2..4b10db12725d 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