diff options
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 49035c5a2c4..b83f91edebd 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -726,7 +726,7 @@ static int ext4_splice_branch(handle_t *handle, struct inode *inode, | |||
726 | 726 | ||
727 | /* We are done with atomic stuff, now do the rest of housekeeping */ | 727 | /* We are done with atomic stuff, now do the rest of housekeeping */ |
728 | 728 | ||
729 | inode->i_ctime = CURRENT_TIME_SEC; | 729 | inode->i_ctime = ext4_current_time(inode); |
730 | ext4_mark_inode_dirty(handle, inode); | 730 | ext4_mark_inode_dirty(handle, inode); |
731 | 731 | ||
732 | /* had we spliced it onto indirect block? */ | 732 | /* had we spliced it onto indirect block? */ |
@@ -2375,7 +2375,7 @@ do_indirects: | |||
2375 | ext4_discard_reservation(inode); | 2375 | ext4_discard_reservation(inode); |
2376 | 2376 | ||
2377 | mutex_unlock(&ei->truncate_mutex); | 2377 | mutex_unlock(&ei->truncate_mutex); |
2378 | inode->i_mtime = inode->i_ctime = CURRENT_TIME_SEC; | 2378 | inode->i_mtime = inode->i_ctime = ext4_current_time(inode); |
2379 | ext4_mark_inode_dirty(handle, inode); | 2379 | ext4_mark_inode_dirty(handle, inode); |
2380 | 2380 | ||
2381 | /* | 2381 | /* |
@@ -2629,10 +2629,6 @@ void ext4_read_inode(struct inode * inode) | |||
2629 | } | 2629 | } |
2630 | inode->i_nlink = le16_to_cpu(raw_inode->i_links_count); | 2630 | inode->i_nlink = le16_to_cpu(raw_inode->i_links_count); |
2631 | inode->i_size = le32_to_cpu(raw_inode->i_size); | 2631 | inode->i_size = le32_to_cpu(raw_inode->i_size); |
2632 | inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime); | ||
2633 | inode->i_ctime.tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime); | ||
2634 | inode->i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode->i_mtime); | ||
2635 | inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec = inode->i_mtime.tv_nsec = 0; | ||
2636 | 2632 | ||
2637 | ei->i_state = 0; | 2633 | ei->i_state = 0; |
2638 | ei->i_dir_start_lookup = 0; | 2634 | ei->i_dir_start_lookup = 0; |
@@ -2710,6 +2706,11 @@ void ext4_read_inode(struct inode * inode) | |||
2710 | } else | 2706 | } else |
2711 | ei->i_extra_isize = 0; | 2707 | ei->i_extra_isize = 0; |
2712 | 2708 | ||
2709 | EXT4_INODE_GET_XTIME(i_ctime, inode, raw_inode); | ||
2710 | EXT4_INODE_GET_XTIME(i_mtime, inode, raw_inode); | ||
2711 | EXT4_INODE_GET_XTIME(i_atime, inode, raw_inode); | ||
2712 | EXT4_EINODE_GET_XTIME(i_crtime, ei, raw_inode); | ||
2713 | |||
2713 | if (S_ISREG(inode->i_mode)) { | 2714 | if (S_ISREG(inode->i_mode)) { |
2714 | inode->i_op = &ext4_file_inode_operations; | 2715 | inode->i_op = &ext4_file_inode_operations; |
2715 | inode->i_fop = &ext4_file_operations; | 2716 | inode->i_fop = &ext4_file_operations; |
@@ -2791,9 +2792,12 @@ static int ext4_do_update_inode(handle_t *handle, | |||
2791 | } | 2792 | } |
2792 | raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); | 2793 | raw_inode->i_links_count = cpu_to_le16(inode->i_nlink); |
2793 | raw_inode->i_size = cpu_to_le32(ei->i_disksize); | 2794 | raw_inode->i_size = cpu_to_le32(ei->i_disksize); |
2794 | raw_inode->i_atime = cpu_to_le32(inode->i_atime.tv_sec); | 2795 | |
2795 | raw_inode->i_ctime = cpu_to_le32(inode->i_ctime.tv_sec); | 2796 | EXT4_INODE_SET_XTIME(i_ctime, inode, raw_inode); |
2796 | raw_inode->i_mtime = cpu_to_le32(inode->i_mtime.tv_sec); | 2797 | EXT4_INODE_SET_XTIME(i_mtime, inode, raw_inode); |
2798 | EXT4_INODE_SET_XTIME(i_atime, inode, raw_inode); | ||
2799 | EXT4_EINODE_SET_XTIME(i_crtime, ei, raw_inode); | ||
2800 | |||
2797 | raw_inode->i_blocks = cpu_to_le32(inode->i_blocks); | 2801 | raw_inode->i_blocks = cpu_to_le32(inode->i_blocks); |
2798 | raw_inode->i_dtime = cpu_to_le32(ei->i_dtime); | 2802 | raw_inode->i_dtime = cpu_to_le32(ei->i_dtime); |
2799 | raw_inode->i_flags = cpu_to_le32(ei->i_flags); | 2803 | raw_inode->i_flags = cpu_to_le32(ei->i_flags); |