Skip to content

Commit 417d2b6

Browse files
jtlaytonbrauner
authored andcommitted
bpf: convert to ctime accessor functions
In later patches, we're going to change how the inode's ctime field is used. Switch to using accessor functions instead of raw accesses of inode->i_ctime. Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Jan Kara <[email protected]> Message-Id: <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
1 parent 783904f commit 417d2b6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/bpf/inode.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,8 @@ 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 = current_time(inode);
121+
inode->i_atime = inode_set_ctime_current(inode);
122122
inode->i_mtime = inode->i_atime;
123-
inode->i_ctime = inode->i_atime;
124123

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

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

151-
dir->i_mtime = current_time(dir);
152-
dir->i_ctime = dir->i_mtime;
150+
dir->i_mtime = inode_set_ctime_current(dir);
153151
}
154152

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

0 commit comments

Comments
 (0)