Message ID | 20240228173031.3208743-1-phind.uet@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-85441-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3496628dyb; Wed, 28 Feb 2024 09:31:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAPkWIjdt0hsCM+UlpW4S/h6QO9u6je2lusuVZxvxnQD+jXnsWNRWl/GBpP5NFEIz0PD+QPlrwl8B7u5FtkfcjjlxYGg== X-Google-Smtp-Source: AGHT+IFYMZQdjNkcZsHn0/kAHsXsOsLlZL6Zmv2CWCWMzbISNVdYiSRCRgYLIu0TTOjVcB+7cOQE X-Received: by 2002:aa7:cf16:0:b0:565:874:8534 with SMTP id a22-20020aa7cf16000000b0056508748534mr53991edy.29.1709141481727; Wed, 28 Feb 2024 09:31:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709141481; cv=pass; d=google.com; s=arc-20160816; b=t3giaRlM1oUSHNmflHdXGfhiborje9fNhnLTmCF8l1SWKn6l2H8G9w8wmJNvEnx8Fn F8dlI40eL/9f+2v2K+Lw09bSWMVfnGMs/hwTCZeTof8pUNP1uaJ54XmcsQjMcCJkzE3Q bvhAFK/qz+qoemLofMNmEQDA2BUtccAKE1vYVXdOKB9NtOV0aQYMHtIChAhAWLFbmdUn 2cPSP1pPYFxnGpp455DItTvrUiawtUnONO60IPOG1sgXXOl7FesRK6JvNbOxeG7ZgCSy jhd5A7tn5YnObYJ4m/AOin9516ib+6hCxLCEdHk/RwArM1twJsVLbgGwBNatpSPDPfOS IlOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+1B6Wdy58qhImm+FGHcgFzCMtrDaanKZM3JrnRwFVxk=; fh=hK49gnZIAO/v2YaotsumoUfgJ1xoBLhImxVmOVkeehw=; b=JdexaPUpHJe0p2KQigMuflM4Y/lItQDX5Q8vqb2vKcSJUtdcL9dBNC6aCliNx0YgdP XZyqmUNsnKf6vNob5zZHpCRJiSM8rPE/aadRygKOGY7vuo8HGASAf1F/OwPkhRo0dT3L jvW7wP0y+jToRkWpREeBfAjw4Zx66RarPZKcmtA7x0T7Gcq4xU9dznE/vH5x9ZrZsT2E AaJR/OGJoRGWSadRlHHdTZJJbYqFVkzKjNjnjaZOb4nBF7rBcKG+t+qnRvA8QrI6u+fr 86euGkGT5c6+Jm3n7i+FzqdBj/oZl0HZ0mhde+skM6rDNRnIBRtnCKjVLqlzyDPxo1Pj vuwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jCxevNJM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85441-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85441-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b22-20020aa7cd16000000b00565aec51b6dsi1896367edw.391.2024.02.28.09.31.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:31:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85441-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=jCxevNJM; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-85441-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85441-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5A76B1F22AC6 for <ouuuleilei@gmail.com>; Wed, 28 Feb 2024 17:31:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D44515CD4A; Wed, 28 Feb 2024 17:31:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jCxevNJM" Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72CC83FBA2; Wed, 28 Feb 2024 17:31:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709141461; cv=none; b=nzmS7jRB+BvXpvVriW44VPZd/qd+n0/7w4vGfDsT+wVThVurwN3kIXoo8gpatllIDYZC2xTYZJaQY9r3R8zeQQ3X5Mv0HSwF6HGXI3QjfTiwXuCncTirzTavPq9atYKLoQnmId5QS8tqM9drxK/Gv4MkwSqPdh6xuO/BUH2OOjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709141461; c=relaxed/simple; bh=jRBtZuKeERtGAw31LmqF50r1/ss/xfk5LRp9GqVgqTg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=dw5ypLYHbn1+8m/tFYAgY6ugDrVc6j2dlGptMmOVrY/4Zs+EJhMlP4BmHYuFFYtQD+YWSbWBnYdqWodS3waoH0cgh8sxdauuFndYI4Yl6C4NctWW71MoA08dHjd+wsH17x4Lc8CM0LJ9FXxe2tEJn/ahHe94j8dEkSLM5HFKMec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jCxevNJM; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6e572dbbc5cso2632b3a.0; Wed, 28 Feb 2024 09:31:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709141460; x=1709746260; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=+1B6Wdy58qhImm+FGHcgFzCMtrDaanKZM3JrnRwFVxk=; b=jCxevNJMJ/N9RuuRLfLPoJJYPyiy3o0VsLUqna/C5O8rV+FfWbeyYMj8VMNoZ8TF4R 7B05wwOWVy2dqSi7m/Mp0lwaxNVZeIn+vKhZ/7Am86wheFOB/XtXldATtpiFx9eisoyH jSLRlrGOaRyEEEI04jtq1Q4rDsVYbZ618OCtMf5p6FvPXOFCGFT7Vqs5/9ZkNFZOKFEO O6LhYGVfboxSE9an8DzJ8bwp2irzFgWZJhEB1f+ctT5a3SC6gVQ7dTu/A8fidlGCMeTC C73E3ufzs/NbOEpOa2wbbx41SNr8wzn5faZL8PQ4q330kOf03kFNYap9gPag1eTFX7wn g/0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709141460; x=1709746260; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+1B6Wdy58qhImm+FGHcgFzCMtrDaanKZM3JrnRwFVxk=; b=M6kWHmfoNXzHpx6jFuOxLnuVUj9df/2iDfs3Ouc6yER0TOYFG+c88jxdI05UJEBow+ KrUnWzEUvcHhfbkf+x2tgiIPDYb4FLDQWoGMD4gr2ODm5IGt4vu1gZGKBuaFTYva7QoL sGwZBsL1JpiYL5sZY0AWWK0ClUGVUk+TU09ygAH32lh7WdU9Pv6uQU7UPAU7y1hOGvoV QVOnStXA5+TEbgja8ERIkytFET0abmkbKuP+lW4dokD+hTAcQla33uPcMmqcAnIdhct5 LlfrUTXpGUIFIWsSda7YKAlrSZrv0HaK+1eDnj0QC5Mk8Hm4jWKS1BJ5PH2dffckG9PQ or8w== X-Forwarded-Encrypted: i=1; AJvYcCUvDZzE9JgxU6frwmzPOYyqudjtXndamd9DduL+W5F9QroZ/7WywRjhwR3aEluPG7uabdDo8ORv7/cNk6W6bsunEEWCBgYSMpEMz3R82n7k/vOUAYxCiarYarIbuzQ7pW13oXcmawBErOnbYw== X-Gm-Message-State: AOJu0Yx5L9cgLYOCB9OXETyZGzTbctehcYNJ/9DMuz2c3pF37ImRGhmh Xds0SMQhBJMP9whP367Z8b21xulw66gbX7ZUxAdm9jJrQLhpUE6VXuRMv2llL2A= X-Received: by 2002:a62:f209:0:b0:6e5:3b0e:9f36 with SMTP id m9-20020a62f209000000b006e53b0e9f36mr65248pfh.3.1709141459484; Wed, 28 Feb 2024 09:30:59 -0800 (PST) Received: from ubuntu-VirtualBox.. ([42.60.173.150]) by smtp.googlemail.com with ESMTPSA id t26-20020a62d15a000000b006e56bf07483sm1369424pfl.77.2024.02.28.09.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:30:59 -0800 (PST) From: Nguyen Dinh Phi <phind.uet@gmail.com> To: Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz> Cc: Nguyen Dinh Phi <phind.uet@gmail.com>, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fs: use inode_set_ctime_to_ts to set inode ctime to current time Date: Thu, 29 Feb 2024 01:30:31 +0800 Message-Id: <20240228173031.3208743-1-phind.uet@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792164738285363598 X-GMAIL-MSGID: 1792164738285363598 |
Series |
fs: use inode_set_ctime_to_ts to set inode ctime to current time
|
|
Commit Message
Nguyen Dinh Phi
Feb. 28, 2024, 5:30 p.m. UTC
The function inode_set_ctime_current simply retrieves the current time
and assigns it to the field __i_ctime without any alterations. Therefore,
it is possible to set ctime to now directly using inode_set_ctime_to_ts
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
---
fs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Thu, 29 Feb 2024 01:30:31 +0800, Nguyen Dinh Phi wrote: > The function inode_set_ctime_current simply retrieves the current time > and assigns it to the field __i_ctime without any alterations. Therefore, > it is possible to set ctime to now directly using inode_set_ctime_to_ts > > Applied to the vfs.misc branch of the vfs/vfs.git tree. Patches in the vfs.misc branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.misc [1/1] fs: use inode_set_ctime_to_ts to set inode ctime to current time https://git.kernel.org/vfs/vfs/c/6adf169c32c2
diff --git a/fs/inode.c b/fs/inode.c index 91048c4c9c9e..0b1327be581a 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -2509,7 +2509,7 @@ 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); + inode_set_ctime_to_ts(inode, now); return now; } EXPORT_SYMBOL(inode_set_ctime_current);