BPF List
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 73/79] bpf: switch to new ctime accessors
Date: Wed, 21 Jun 2023 10:46:26 -0400	[thread overview]
Message-ID: <20230621144735.55953-72-jlayton@kernel.org> (raw)
In-Reply-To: <20230621144735.55953-1-jlayton@kernel.org>

In later patches, we're going to change how the ctime.tv_nsec field is
utilized. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 kernel/bpf/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/bpf/inode.c b/kernel/bpf/inode.c
index 4174f76133df..d4489bb761df 100644
--- a/kernel/bpf/inode.c
+++ b/kernel/bpf/inode.c
@@ -120,7 +120,7 @@ static struct inode *bpf_get_inode(struct super_block *sb,
 	inode->i_ino = get_next_ino();
 	inode->i_atime = current_time(inode);
 	inode->i_mtime = inode->i_atime;
-	inode->i_ctime = inode->i_atime;
+	inode_ctime_set(inode, inode->i_atime);
 
 	inode_init_owner(&nop_mnt_idmap, inode, dir, mode);
 
@@ -149,7 +149,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode,
 	dget(dentry);
 
 	dir->i_mtime = current_time(dir);
-	dir->i_ctime = dir->i_mtime;
+	inode_ctime_set(dir, dir->i_mtime);
 }
 
 static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir,
-- 
2.41.0


  parent reply	other threads:[~2023-06-21 14:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 14:45 [PATCH 00/79] fs: new accessors for inode->i_ctime Jeff Layton
2023-06-21 14:45 ` [PATCH 01/79] fs: add ctime accessors infrastructure Jeff Layton
2023-06-21 16:34   ` Jan Kara
2023-06-21 17:29   ` Tom Talpey
2023-06-21 18:01     ` Jeff Layton
2023-06-21 18:19       ` Tom Talpey
2023-06-21 18:48         ` Jeff Layton
2023-06-22  0:46   ` Damien Le Moal
2023-06-22 10:14     ` Jeff Layton
2023-06-30 22:12   ` Luis Chamberlain
     [not found] ` <20230621144735.55953-1-jlayton@kernel.org>
2023-06-21 14:46   ` Jeff Layton [this message]
2023-06-21 14:49 ` [PATCH 79/79] fs: rename i_ctime field to __i_ctime Jeff Layton
2023-06-21 19:21 ` [PATCH 00/79] fs: new accessors for inode->i_ctime Steven Rostedt
2023-06-21 19:52   ` Jeff Layton
2023-06-23 12:41     ` Christian Brauner
2023-06-30 22:11   ` Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230621144735.55953-72-jlayton@kernel.org \
    --to=jlayton@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=jack@suse.cz \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox