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

ocfs2: 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-54-jlayton@kernel.orgSigned-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 2be861fa
...@@ -193,8 +193,8 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh, ...@@ -193,8 +193,8 @@ static int ocfs2_acl_set_mode(struct inode *inode, struct buffer_head *di_bh,
inode->i_mode = new_mode; inode->i_mode = new_mode;
inode_set_ctime_current(inode); inode_set_ctime_current(inode);
di->i_mode = cpu_to_le16(inode->i_mode); di->i_mode = cpu_to_le16(inode->i_mode);
di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode));
di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_update_inode_fsync_trans(handle, inode, 0);
ocfs2_journal_dirty(handle, di_bh); ocfs2_journal_dirty(handle, di_bh);
......
...@@ -7436,10 +7436,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, ...@@ -7436,10 +7436,10 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
} }
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
inode->i_mtime = inode_set_ctime_current(inode); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(inode).tv_sec); di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime_sec(inode));
di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_update_inode_fsync_trans(handle, inode, 1); ocfs2_update_inode_fsync_trans(handle, inode, 1);
ocfs2_journal_dirty(handle, di_bh); ocfs2_journal_dirty(handle, di_bh);
......
...@@ -2048,9 +2048,9 @@ int ocfs2_write_end_nolock(struct address_space *mapping, ...@@ -2048,9 +2048,9 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
} }
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
di->i_size = cpu_to_le64((u64)i_size_read(inode)); di->i_size = cpu_to_le64((u64)i_size_read(inode));
inode->i_mtime = inode_set_ctime_current(inode); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_mtime = di->i_ctime = cpu_to_le64(inode_get_mtime_sec(inode));
di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); di->i_mtime_nsec = di->i_ctime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode));
if (handle) if (handle)
ocfs2_update_inode_fsync_trans(handle, inode, 1); ocfs2_update_inode_fsync_trans(handle, inode, 1);
} }
......
...@@ -1658,7 +1658,8 @@ int __ocfs2_add_entry(handle_t *handle, ...@@ -1658,7 +1658,8 @@ int __ocfs2_add_entry(handle_t *handle,
offset, ocfs2_dir_trailer_blk_off(dir->i_sb)); offset, ocfs2_dir_trailer_blk_off(dir->i_sb));
if (ocfs2_dirent_would_fit(de, rec_len)) { if (ocfs2_dirent_would_fit(de, rec_len)) {
dir->i_mtime = inode_set_ctime_current(dir); inode_set_mtime_to_ts(dir,
inode_set_ctime_current(dir));
retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh);
if (retval < 0) { if (retval < 0) {
mlog_errno(retval); mlog_errno(retval);
...@@ -2962,11 +2963,11 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh, ...@@ -2962,11 +2963,11 @@ static int ocfs2_expand_inline_dir(struct inode *dir, struct buffer_head *di_bh,
ocfs2_dinode_new_extent_list(dir, di); ocfs2_dinode_new_extent_list(dir, di);
i_size_write(dir, sb->s_blocksize); i_size_write(dir, sb->s_blocksize);
dir->i_mtime = inode_set_ctime_current(dir); inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
di->i_size = cpu_to_le64(sb->s_blocksize); di->i_size = cpu_to_le64(sb->s_blocksize);
di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(dir).tv_sec); di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime_sec(dir));
di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(dir).tv_nsec); di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime_nsec(dir));
ocfs2_update_inode_fsync_trans(handle, dir, 1); ocfs2_update_inode_fsync_trans(handle, dir, 1);
/* /*
......
...@@ -337,7 +337,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb) ...@@ -337,7 +337,7 @@ static struct inode *dlmfs_get_root_inode(struct super_block *sb)
if (inode) { if (inode) {
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode_init_owner(&nop_mnt_idmap, inode, NULL, mode); inode_init_owner(&nop_mnt_idmap, inode, NULL, mode);
inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); simple_inode_init_ts(inode);
inc_nlink(inode); inc_nlink(inode);
inode->i_fop = &simple_dir_operations; inode->i_fop = &simple_dir_operations;
...@@ -360,7 +360,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent, ...@@ -360,7 +360,7 @@ static struct inode *dlmfs_get_inode(struct inode *parent,
inode->i_ino = get_next_ino(); inode->i_ino = get_next_ino();
inode_init_owner(&nop_mnt_idmap, inode, parent, mode); inode_init_owner(&nop_mnt_idmap, inode, parent, mode);
inode->i_atime = inode->i_mtime = inode_set_ctime_current(inode); simple_inode_init_ts(inode);
ip = DLMFS_I(inode); ip = DLMFS_I(inode);
ip->ip_conn = DLMFS_I(parent)->ip_conn; ip->ip_conn = DLMFS_I(parent)->ip_conn;
......
...@@ -2162,7 +2162,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) ...@@ -2162,7 +2162,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres;
struct ocfs2_meta_lvb *lvb; struct ocfs2_meta_lvb *lvb;
struct timespec64 ctime = inode_get_ctime(inode); struct timespec64 ts;
lvb = ocfs2_dlm_lvb(&lockres->l_lksb); lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
...@@ -2183,12 +2183,12 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) ...@@ -2183,12 +2183,12 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); lvb->lvb_igid = cpu_to_be32(i_gid_read(inode));
lvb->lvb_imode = cpu_to_be16(inode->i_mode); lvb->lvb_imode = cpu_to_be16(inode->i_mode);
lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); lvb->lvb_inlink = cpu_to_be16(inode->i_nlink);
lvb->lvb_iatime_packed = ts = inode_get_atime(inode);
cpu_to_be64(ocfs2_pack_timespec(&inode->i_atime)); lvb->lvb_iatime_packed = cpu_to_be64(ocfs2_pack_timespec(&ts));
lvb->lvb_ictime_packed = ts = inode_get_ctime(inode);
cpu_to_be64(ocfs2_pack_timespec(&ctime)); lvb->lvb_ictime_packed = cpu_to_be64(ocfs2_pack_timespec(&ts));
lvb->lvb_imtime_packed = ts = inode_get_mtime(inode);
cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); lvb->lvb_imtime_packed = cpu_to_be64(ocfs2_pack_timespec(&ts));
lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); lvb->lvb_iattr = cpu_to_be32(oi->ip_attr);
lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features);
lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); lvb->lvb_igeneration = cpu_to_be32(inode->i_generation);
...@@ -2209,7 +2209,7 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) ...@@ -2209,7 +2209,7 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode)
struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres;
struct ocfs2_meta_lvb *lvb; struct ocfs2_meta_lvb *lvb;
struct timespec64 ctime; struct timespec64 ts;
mlog_meta_lvb(0, lockres); mlog_meta_lvb(0, lockres);
...@@ -2236,13 +2236,12 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode) ...@@ -2236,13 +2236,12 @@ static int ocfs2_refresh_inode_from_lvb(struct inode *inode)
i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); i_gid_write(inode, be32_to_cpu(lvb->lvb_igid));
inode->i_mode = be16_to_cpu(lvb->lvb_imode); inode->i_mode = be16_to_cpu(lvb->lvb_imode);
set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); set_nlink(inode, be16_to_cpu(lvb->lvb_inlink));
ocfs2_unpack_timespec(&inode->i_atime, ocfs2_unpack_timespec(&ts, be64_to_cpu(lvb->lvb_iatime_packed));
be64_to_cpu(lvb->lvb_iatime_packed)); inode_set_atime_to_ts(inode, ts);
ocfs2_unpack_timespec(&inode->i_mtime, ocfs2_unpack_timespec(&ts, be64_to_cpu(lvb->lvb_imtime_packed));
be64_to_cpu(lvb->lvb_imtime_packed)); inode_set_mtime_to_ts(inode, ts);
ocfs2_unpack_timespec(&ctime, ocfs2_unpack_timespec(&ts, be64_to_cpu(lvb->lvb_ictime_packed));
be64_to_cpu(lvb->lvb_ictime_packed)); inode_set_ctime_to_ts(inode, ts);
inode_set_ctime_to_ts(inode, ctime);
spin_unlock(&oi->ip_lock); spin_unlock(&oi->ip_lock);
return 0; return 0;
} }
......
...@@ -233,16 +233,18 @@ int ocfs2_should_update_atime(struct inode *inode, ...@@ -233,16 +233,18 @@ int ocfs2_should_update_atime(struct inode *inode,
if (vfsmnt->mnt_flags & MNT_RELATIME) { if (vfsmnt->mnt_flags & MNT_RELATIME) {
struct timespec64 ctime = inode_get_ctime(inode); struct timespec64 ctime = inode_get_ctime(inode);
struct timespec64 atime = inode_get_atime(inode);
struct timespec64 mtime = inode_get_mtime(inode);
if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) || if ((timespec64_compare(&atime, &mtime) <= 0) ||
(timespec64_compare(&inode->i_atime, &ctime) <= 0)) (timespec64_compare(&atime, &ctime) <= 0))
return 1; return 1;
return 0; return 0;
} }
now = current_time(inode); now = current_time(inode);
if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) if ((now.tv_sec - inode_get_atime_sec(inode) <= osb->s_atime_quantum))
return 0; return 0;
else else
return 1; return 1;
...@@ -275,9 +277,9 @@ int ocfs2_update_inode_atime(struct inode *inode, ...@@ -275,9 +277,9 @@ int ocfs2_update_inode_atime(struct inode *inode,
* have i_rwsem to guard against concurrent changes to other * have i_rwsem to guard against concurrent changes to other
* inode fields. * inode fields.
*/ */
inode->i_atime = current_time(inode); inode_set_atime_to_ts(inode, current_time(inode));
di->i_atime = cpu_to_le64(inode->i_atime.tv_sec); di->i_atime = cpu_to_le64(inode_get_atime_sec(inode));
di->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); di->i_atime_nsec = cpu_to_le32(inode_get_atime_nsec(inode));
ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_update_inode_fsync_trans(handle, inode, 0);
ocfs2_journal_dirty(handle, bh); ocfs2_journal_dirty(handle, bh);
...@@ -296,7 +298,7 @@ int ocfs2_set_inode_size(handle_t *handle, ...@@ -296,7 +298,7 @@ int ocfs2_set_inode_size(handle_t *handle,
i_size_write(inode, new_i_size); i_size_write(inode, new_i_size);
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
inode->i_mtime = inode_set_ctime_current(inode); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); status = ocfs2_mark_inode_dirty(handle, inode, fe_bh);
if (status < 0) { if (status < 0) {
...@@ -417,12 +419,12 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb, ...@@ -417,12 +419,12 @@ static int ocfs2_orphan_for_truncate(struct ocfs2_super *osb,
} }
i_size_write(inode, new_i_size); i_size_write(inode, new_i_size);
inode->i_mtime = inode_set_ctime_current(inode); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
di = (struct ocfs2_dinode *) fe_bh->b_data; di = (struct ocfs2_dinode *) fe_bh->b_data;
di->i_size = cpu_to_le64(new_i_size); di->i_size = cpu_to_le64(new_i_size);
di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime(inode).tv_sec); di->i_ctime = di->i_mtime = cpu_to_le64(inode_get_ctime_sec(inode));
di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); di->i_ctime_nsec = di->i_mtime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_update_inode_fsync_trans(handle, inode, 0);
ocfs2_journal_dirty(handle, fe_bh); ocfs2_journal_dirty(handle, fe_bh);
...@@ -821,9 +823,9 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, ...@@ -821,9 +823,9 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from,
i_size_write(inode, abs_to); i_size_write(inode, abs_to);
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
di->i_size = cpu_to_le64((u64)i_size_read(inode)); di->i_size = cpu_to_le64((u64)i_size_read(inode));
inode->i_mtime = inode_set_ctime_current(inode); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
di->i_mtime = di->i_ctime = cpu_to_le64(inode->i_mtime.tv_sec); di->i_mtime = di->i_ctime = cpu_to_le64(inode_get_mtime_sec(inode));
di->i_ctime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); di->i_ctime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode));
di->i_mtime_nsec = di->i_ctime_nsec; di->i_mtime_nsec = di->i_ctime_nsec;
if (handle) { if (handle) {
ocfs2_journal_dirty(handle, di_bh); ocfs2_journal_dirty(handle, di_bh);
...@@ -2040,7 +2042,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode, ...@@ -2040,7 +2042,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
goto out_inode_unlock; goto out_inode_unlock;
} }
inode->i_mtime = inode_set_ctime_current(inode); inode_set_mtime_to_ts(inode, inode_set_ctime_current(inode));
ret = ocfs2_mark_inode_dirty(handle, inode, di_bh); ret = ocfs2_mark_inode_dirty(handle, inode, di_bh);
if (ret < 0) if (ret < 0)
mlog_errno(ret); mlog_errno(ret);
......
...@@ -302,10 +302,10 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, ...@@ -302,10 +302,10 @@ void ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe,
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
inode->i_mapping->a_ops = &ocfs2_aops; inode->i_mapping->a_ops = &ocfs2_aops;
} }
inode->i_atime.tv_sec = le64_to_cpu(fe->i_atime); inode_set_atime(inode, le64_to_cpu(fe->i_atime),
inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec); le32_to_cpu(fe->i_atime_nsec));
inode->i_mtime.tv_sec = le64_to_cpu(fe->i_mtime); inode_set_mtime(inode, le64_to_cpu(fe->i_mtime),
inode->i_mtime.tv_nsec = le32_to_cpu(fe->i_mtime_nsec); le32_to_cpu(fe->i_mtime_nsec));
inode_set_ctime(inode, le64_to_cpu(fe->i_ctime), inode_set_ctime(inode, le64_to_cpu(fe->i_ctime),
le32_to_cpu(fe->i_ctime_nsec)); le32_to_cpu(fe->i_ctime_nsec));
...@@ -1312,12 +1312,12 @@ int ocfs2_mark_inode_dirty(handle_t *handle, ...@@ -1312,12 +1312,12 @@ int ocfs2_mark_inode_dirty(handle_t *handle,
fe->i_uid = cpu_to_le32(i_uid_read(inode)); fe->i_uid = cpu_to_le32(i_uid_read(inode));
fe->i_gid = cpu_to_le32(i_gid_read(inode)); fe->i_gid = cpu_to_le32(i_gid_read(inode));
fe->i_mode = cpu_to_le16(inode->i_mode); fe->i_mode = cpu_to_le16(inode->i_mode);
fe->i_atime = cpu_to_le64(inode->i_atime.tv_sec); fe->i_atime = cpu_to_le64(inode_get_atime_sec(inode));
fe->i_atime_nsec = cpu_to_le32(inode->i_atime.tv_nsec); fe->i_atime_nsec = cpu_to_le32(inode_get_atime_nsec(inode));
fe->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); fe->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode));
fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
fe->i_mtime = cpu_to_le64(inode->i_mtime.tv_sec); fe->i_mtime = cpu_to_le64(inode_get_mtime_sec(inode));
fe->i_mtime_nsec = cpu_to_le32(inode->i_mtime.tv_nsec); fe->i_mtime_nsec = cpu_to_le32(inode_get_mtime_nsec(inode));
ocfs2_journal_dirty(handle, bh); ocfs2_journal_dirty(handle, bh);
ocfs2_update_inode_fsync_trans(handle, inode, 1); ocfs2_update_inode_fsync_trans(handle, inode, 1);
...@@ -1348,10 +1348,10 @@ void ocfs2_refresh_inode(struct inode *inode, ...@@ -1348,10 +1348,10 @@ void ocfs2_refresh_inode(struct inode *inode,
inode->i_blocks = 0; inode->i_blocks = 0;
else else
inode->i_blocks = ocfs2_inode_sector_count(inode); inode->i_blocks = ocfs2_inode_sector_count(inode);
inode->i_atime.tv_sec = le64_to_cpu(fe->i_atime); inode_set_atime(inode, le64_to_cpu(fe->i_atime),
inode->i_atime.tv_nsec = le32_to_cpu(fe->i_atime_nsec); le32_to_cpu(fe->i_atime_nsec));
inode->i_mtime.tv_sec = le64_to_cpu(fe->i_mtime); inode_set_mtime(inode, le64_to_cpu(fe->i_mtime),
inode->i_mtime.tv_nsec = le32_to_cpu(fe->i_mtime_nsec); le32_to_cpu(fe->i_mtime_nsec));
inode_set_ctime(inode, le64_to_cpu(fe->i_ctime), inode_set_ctime(inode, le64_to_cpu(fe->i_ctime),
le32_to_cpu(fe->i_ctime_nsec)); le32_to_cpu(fe->i_ctime_nsec));
......
...@@ -951,8 +951,8 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context) ...@@ -951,8 +951,8 @@ static int ocfs2_move_extents(struct ocfs2_move_extents_context *context)
di = (struct ocfs2_dinode *)di_bh->b_data; di = (struct ocfs2_dinode *)di_bh->b_data;
inode_set_ctime_current(inode); inode_set_ctime_current(inode);
di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode));
di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_update_inode_fsync_trans(handle, inode, 0); ocfs2_update_inode_fsync_trans(handle, inode, 0);
ocfs2_journal_dirty(handle, di_bh); ocfs2_journal_dirty(handle, di_bh);
......
...@@ -795,8 +795,8 @@ static int ocfs2_link(struct dentry *old_dentry, ...@@ -795,8 +795,8 @@ static int ocfs2_link(struct dentry *old_dentry,
inc_nlink(inode); inc_nlink(inode);
inode_set_ctime_current(inode); inode_set_ctime_current(inode);
ocfs2_set_links_count(fe, inode->i_nlink); ocfs2_set_links_count(fe, inode->i_nlink);
fe->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); fe->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode));
fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_journal_dirty(handle, fe_bh); ocfs2_journal_dirty(handle, fe_bh);
err = ocfs2_add_entry(handle, dentry, inode, err = ocfs2_add_entry(handle, dentry, inode,
...@@ -995,7 +995,7 @@ static int ocfs2_unlink(struct inode *dir, ...@@ -995,7 +995,7 @@ static int ocfs2_unlink(struct inode *dir,
ocfs2_set_links_count(fe, inode->i_nlink); ocfs2_set_links_count(fe, inode->i_nlink);
ocfs2_journal_dirty(handle, fe_bh); ocfs2_journal_dirty(handle, fe_bh);
dir->i_mtime = inode_set_ctime_current(dir); inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir));
if (S_ISDIR(inode->i_mode)) if (S_ISDIR(inode->i_mode))
drop_nlink(dir); drop_nlink(dir);
...@@ -1550,8 +1550,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, ...@@ -1550,8 +1550,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap,
if (status >= 0) { if (status >= 0) {
old_di = (struct ocfs2_dinode *) old_inode_bh->b_data; old_di = (struct ocfs2_dinode *) old_inode_bh->b_data;
old_di->i_ctime = cpu_to_le64(inode_get_ctime(old_inode).tv_sec); old_di->i_ctime = cpu_to_le64(inode_get_ctime_sec(old_inode));
old_di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(old_inode).tv_nsec); old_di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(old_inode));
ocfs2_journal_dirty(handle, old_inode_bh); ocfs2_journal_dirty(handle, old_inode_bh);
} else } else
mlog_errno(status); mlog_errno(status);
...@@ -1592,7 +1592,7 @@ static int ocfs2_rename(struct mnt_idmap *idmap, ...@@ -1592,7 +1592,7 @@ static int ocfs2_rename(struct mnt_idmap *idmap,
drop_nlink(new_inode); drop_nlink(new_inode);
inode_set_ctime_current(new_inode); inode_set_ctime_current(new_inode);
} }
old_dir->i_mtime = inode_set_ctime_current(old_dir); inode_set_mtime_to_ts(old_dir, inode_set_ctime_current(old_dir));
if (update_dot_dot) { if (update_dot_dot) {
status = ocfs2_update_entry(old_inode, handle, status = ocfs2_update_entry(old_inode, handle,
...@@ -1614,8 +1614,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap, ...@@ -1614,8 +1614,8 @@ static int ocfs2_rename(struct mnt_idmap *idmap,
if (old_dir != new_dir) { if (old_dir != new_dir) {
/* Keep the same times on both directories.*/ /* Keep the same times on both directories.*/
new_dir->i_mtime = inode_set_ctime_to_ts(new_dir, inode_set_mtime_to_ts(new_dir,
inode_get_ctime(old_dir)); inode_set_ctime_to_ts(new_dir, inode_get_ctime(old_dir)));
/* /*
* This will also pick up the i_nlink change from the * This will also pick up the i_nlink change from the
......
...@@ -3751,8 +3751,8 @@ static int ocfs2_change_ctime(struct inode *inode, ...@@ -3751,8 +3751,8 @@ static int ocfs2_change_ctime(struct inode *inode,
} }
inode_set_ctime_current(inode); inode_set_ctime_current(inode);
di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode));
di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_journal_dirty(handle, di_bh); ocfs2_journal_dirty(handle, di_bh);
...@@ -4075,10 +4075,10 @@ static int ocfs2_complete_reflink(struct inode *s_inode, ...@@ -4075,10 +4075,10 @@ static int ocfs2_complete_reflink(struct inode *s_inode,
*/ */
inode_set_ctime_current(t_inode); inode_set_ctime_current(t_inode);
di->i_ctime = cpu_to_le64(inode_get_ctime(t_inode).tv_sec); di->i_ctime = cpu_to_le64(inode_get_ctime_sec(t_inode));
di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(t_inode).tv_nsec); di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(t_inode));
t_inode->i_mtime = s_inode->i_mtime; inode_set_mtime_to_ts(t_inode, inode_get_mtime(s_inode));
di->i_mtime = s_di->i_mtime; di->i_mtime = s_di->i_mtime;
di->i_mtime_nsec = s_di->i_mtime_nsec; di->i_mtime_nsec = s_di->i_mtime_nsec;
} }
...@@ -4456,7 +4456,7 @@ int ocfs2_reflink_update_dest(struct inode *dest, ...@@ -4456,7 +4456,7 @@ int ocfs2_reflink_update_dest(struct inode *dest,
if (newlen > i_size_read(dest)) if (newlen > i_size_read(dest))
i_size_write(dest, newlen); i_size_write(dest, newlen);
spin_unlock(&OCFS2_I(dest)->ip_lock); spin_unlock(&OCFS2_I(dest)->ip_lock);
dest->i_mtime = inode_set_ctime_current(dest); inode_set_mtime_to_ts(dest, inode_set_ctime_current(dest));
ret = ocfs2_mark_inode_dirty(handle, dest, d_bh); ret = ocfs2_mark_inode_dirty(handle, dest, d_bh);
if (ret) { if (ret) {
......
...@@ -3422,8 +3422,8 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, ...@@ -3422,8 +3422,8 @@ static int __ocfs2_xattr_set_handle(struct inode *inode,
} }
inode_set_ctime_current(inode); inode_set_ctime_current(inode);
di->i_ctime = cpu_to_le64(inode_get_ctime(inode).tv_sec); di->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode));
di->i_ctime_nsec = cpu_to_le32(inode_get_ctime(inode).tv_nsec); di->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode));
ocfs2_journal_dirty(ctxt->handle, xis->inode_bh); ocfs2_journal_dirty(ctxt->handle, xis->inode_bh);
} }
out: out:
......
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