Skip to content

Commit

Permalink
bpf: convert to new timestamp accessors
Browse files Browse the repository at this point in the history
Convert to using the new inode timestamp accessor functions.

Signed-off-by: Jeff Layton <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
jtlayton authored and brauner committed Oct 18, 2023
1 parent d162a3c commit 1bc628a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/bpf/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ static struct inode *bpf_get_inode(struct super_block *sb,
return ERR_PTR(-ENOSPC);

inode->i_ino = get_next_ino();
inode->i_atime = inode_set_ctime_current(inode);
inode->i_mtime = inode->i_atime;
simple_inode_init_ts(inode);

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

Expand Down Expand Up @@ -147,7 +146,7 @@ static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode,
d_instantiate(dentry, inode);
dget(dentry);

dir->i_mtime = inode_set_ctime_current(dir);
inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
}

static int bpf_mkdir(struct mnt_idmap *idmap, struct inode *dir,
Expand Down

0 comments on commit 1bc628a

Please sign in to comment.