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

affs: 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.
Acked-by: default avatarDavid Sterba <dsterba@suse.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-21-jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 96894147
...@@ -60,7 +60,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh) ...@@ -60,7 +60,7 @@ affs_insert_hash(struct inode *dir, struct buffer_head *bh)
mark_buffer_dirty_inode(dir_bh, dir); mark_buffer_dirty_inode(dir_bh, dir);
affs_brelse(dir_bh); affs_brelse(dir_bh);
dir->i_mtime = dir->i_ctime = current_time(dir); dir->i_mtime = inode_set_ctime_current(dir);
inode_inc_iversion(dir); inode_inc_iversion(dir);
mark_inode_dirty(dir); mark_inode_dirty(dir);
...@@ -114,7 +114,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh) ...@@ -114,7 +114,7 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
affs_brelse(bh); affs_brelse(bh);
dir->i_mtime = dir->i_ctime = current_time(dir); dir->i_mtime = inode_set_ctime_current(dir);
inode_inc_iversion(dir); inode_inc_iversion(dir);
mark_inode_dirty(dir); mark_inode_dirty(dir);
...@@ -315,7 +315,7 @@ affs_remove_header(struct dentry *dentry) ...@@ -315,7 +315,7 @@ affs_remove_header(struct dentry *dentry)
else else
clear_nlink(inode); clear_nlink(inode);
affs_unlock_link(inode); affs_unlock_link(inode);
inode->i_ctime = current_time(inode); inode_set_ctime_current(inode);
mark_inode_dirty(inode); mark_inode_dirty(inode);
done: done:
......
...@@ -149,13 +149,13 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino) ...@@ -149,13 +149,13 @@ struct inode *affs_iget(struct super_block *sb, unsigned long ino)
break; break;
} }
inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec inode->i_mtime.tv_sec = inode->i_atime.tv_sec =
= (be32_to_cpu(tail->change.days) * 86400LL + inode_set_ctime(inode,
be32_to_cpu(tail->change.mins) * 60 + (be32_to_cpu(tail->change.days) * 86400LL +
be32_to_cpu(tail->change.ticks) / 50 + be32_to_cpu(tail->change.mins) * 60 +
AFFS_EPOCH_DELTA) + be32_to_cpu(tail->change.ticks) / 50 + AFFS_EPOCH_DELTA)
sys_tz.tz_minuteswest * 60; + sys_tz.tz_minuteswest * 60, 0).tv_sec;
inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = 0;
affs_brelse(bh); affs_brelse(bh);
unlock_new_inode(inode); unlock_new_inode(inode);
return inode; return inode;
...@@ -314,7 +314,7 @@ affs_new_inode(struct inode *dir) ...@@ -314,7 +314,7 @@ affs_new_inode(struct inode *dir)
inode->i_gid = current_fsgid(); inode->i_gid = current_fsgid();
inode->i_ino = block; inode->i_ino = block;
set_nlink(inode, 1); set_nlink(inode, 1);
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode);
atomic_set(&AFFS_I(inode)->i_opencnt, 0); atomic_set(&AFFS_I(inode)->i_opencnt, 0);
AFFS_I(inode)->i_blkcnt = 0; AFFS_I(inode)->i_blkcnt = 0;
AFFS_I(inode)->i_lc = NULL; AFFS_I(inode)->i_lc = NULL;
......
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