Skip to content

Commit 1bc628a

Browse files
jtlaytonbrauner
authored andcommitted
bpf: convert to new timestamp accessors
Convert to using the new inode timestamp accessor functions. Signed-off-by: Jeff Layton <jlayton@kernel.org> Link: https://lore.kernel.org/r/20231004185347.80880-79-jlayton@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent d162a3c commit 1bc628a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

kernel/bpf/inode.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ static struct inode *bpf_get_inode(struct super_block *sb,
118118
return ERR_PTR(-ENOSPC);
119119

120120
inode->i_ino = get_next_ino();
121-
inode->i_atime = inode_set_ctime_current(inode);
122-
inode->i_mtime = inode->i_atime;
121+
simple_inode_init_ts(inode);
123122

124123
inode_init_owner(&nop_mnt_idmap, inode, dir, mode);
125124

@@ -147,7 +146,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode,
147146
d_instantiate(dentry, inode);
148147
dget(dentry);
149148

150-
dir->i_mtime = inode_set_ctime_current(dir);
149+
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
151150
}
152151

153152
static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir,

0 commit comments

Comments
 (0)