Commit cfd87e76 authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner

hugetlbfs: convert to new timestamp accessors

Convert to using the new inode timestamp accessor functions.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20231004185347.80880-43-jlayton@kernel.orgSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 83c1d74c
...@@ -980,7 +980,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb, ...@@ -980,7 +980,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb,
inode->i_mode = S_IFDIR | ctx->mode; inode->i_mode = S_IFDIR | ctx->mode;
inode->i_uid = ctx->uid; inode->i_uid = ctx->uid;
inode->i_gid = ctx->gid; inode->i_gid = ctx->gid;
inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); simple_inode_init_ts(inode);
inode->i_op = &hugetlbfs_dir_inode_operations; inode->i_op = &hugetlbfs_dir_inode_operations;
inode->i_fop = &simple_dir_operations; inode->i_fop = &simple_dir_operations;
/* directory inodes start off with i_nlink == 2 (for "." entry) */ /* directory inodes start off with i_nlink == 2 (for "." entry) */
...@@ -1024,7 +1024,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb, ...@@ -1024,7 +1024,7 @@ static struct inode *hugetlbfs_get_inode(struct super_block *sb,
lockdep_set_class(&inode->i_mapping->i_mmap_rwsem, lockdep_set_class(&inode->i_mapping->i_mmap_rwsem,
&hugetlbfs_i_mmap_rwsem_key); &hugetlbfs_i_mmap_rwsem_key);
inode->i_mapping->a_ops = &hugetlbfs_aops; inode->i_mapping->a_ops = &hugetlbfs_aops;
inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); simple_inode_init_ts(inode);
inode->i_mapping->private_data = resv_map; inode->i_mapping->private_data = resv_map;
info->seals = F_SEAL_SEAL; info->seals = F_SEAL_SEAL;
switch (mode & S_IFMT) { switch (mode & S_IFMT) {
...@@ -1067,7 +1067,7 @@ static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir, ...@@ -1067,7 +1067,7 @@ static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev);
if (!inode) if (!inode)
return -ENOSPC; return -ENOSPC;
dir->i_mtime = inode_set_ctime_current(dir); inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
dget(dentry);/* Extra count - pin the dentry in core */ dget(dentry);/* Extra count - pin the dentry in core */
return 0; return 0;
...@@ -1099,7 +1099,7 @@ static int hugetlbfs_tmpfile(struct mnt_idmap *idmap, ...@@ -1099,7 +1099,7 @@ static int hugetlbfs_tmpfile(struct mnt_idmap *idmap,
inode = hugetlbfs_get_inode(dir->i_sb, dir, mode | S_IFREG, 0); inode = hugetlbfs_get_inode(dir->i_sb, dir, mode | S_IFREG, 0);
if (!inode) if (!inode)
return -ENOSPC; return -ENOSPC;
dir->i_mtime = inode_set_ctime_current(dir); inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
d_tmpfile(file, inode); d_tmpfile(file, inode);
return finish_open_simple(file, 0); return finish_open_simple(file, 0);
} }
...@@ -1121,7 +1121,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap, ...@@ -1121,7 +1121,7 @@ static int hugetlbfs_symlink(struct mnt_idmap *idmap,
} else } else
iput(inode); iput(inode);
} }
dir->i_mtime = inode_set_ctime_current(dir); inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment