diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-06-21 12:04:06 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 07:12:39 -0400 |
commit | d3c6be6fdab48dd26af3d3e01c5972ffe20985b9 (patch) | |
tree | 7872ddc78464e8f2015db66b33db7494e62b959f | |
parent | afd48513f0019a2048afed0d98904d3fec7e05dd (diff) |
btrfs: use timespec64 for i_otime
While the regular inode timestamps all use timespec64 now, the i_otime
field is btrfs specific and still needs to be converted to correctly
represent times beyond 2038.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 7e075343daa5..1343ac57b438 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -178,7 +178,7 @@ struct btrfs_inode { | |||
178 | struct btrfs_delayed_node *delayed_node; | 178 | struct btrfs_delayed_node *delayed_node; |
179 | 179 | ||
180 | /* File creation time. */ | 180 | /* File creation time. */ |
181 | struct timespec i_otime; | 181 | struct timespec64 i_otime; |
182 | 182 | ||
183 | /* Hook into fs_info->delayed_iputs */ | 183 | /* Hook into fs_info->delayed_iputs */ |
184 | struct list_head delayed_iput; | 184 | struct list_head delayed_iput; |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1ade43c02b81..2858bc355920 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5744,7 +5744,7 @@ static struct inode *new_simple_dir(struct super_block *s, | |||
5744 | inode->i_mtime = current_time(inode); | 5744 | inode->i_mtime = current_time(inode); |
5745 | inode->i_atime = inode->i_mtime; | 5745 | inode->i_atime = inode->i_mtime; |
5746 | inode->i_ctime = inode->i_mtime; | 5746 | inode->i_ctime = inode->i_mtime; |
5747 | BTRFS_I(inode)->i_otime = timespec64_to_timespec(inode->i_mtime); | 5747 | BTRFS_I(inode)->i_otime = inode->i_mtime; |
5748 | 5748 | ||
5749 | return inode; | 5749 | return inode; |
5750 | } | 5750 | } |
@@ -6348,7 +6348,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
6348 | inode->i_mtime = current_time(inode); | 6348 | inode->i_mtime = current_time(inode); |
6349 | inode->i_atime = inode->i_mtime; | 6349 | inode->i_atime = inode->i_mtime; |
6350 | inode->i_ctime = inode->i_mtime; | 6350 | inode->i_ctime = inode->i_mtime; |
6351 | BTRFS_I(inode)->i_otime = timespec64_to_timespec(inode->i_mtime); | 6351 | BTRFS_I(inode)->i_otime = inode->i_mtime; |
6352 | 6352 | ||
6353 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], | 6353 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], |
6354 | struct btrfs_inode_item); | 6354 | struct btrfs_inode_item); |