diff options
-rw-r--r-- | fs/btrfs/file.c | 4 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 25 | ||||
-rw-r--r-- | fs/btrfs/ioctl.c | 8 | ||||
-rw-r--r-- | fs/btrfs/root-tree.c | 2 | ||||
-rw-r--r-- | fs/btrfs/transaction.c | 7 | ||||
-rw-r--r-- | fs/btrfs/xattr.c | 2 |
6 files changed, 26 insertions, 22 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 098bb8f690c9..610f56992464 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -2544,7 +2544,7 @@ out_trans: | |||
2544 | goto out_free; | 2544 | goto out_free; |
2545 | 2545 | ||
2546 | inode_inc_iversion(inode); | 2546 | inode_inc_iversion(inode); |
2547 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 2547 | inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); |
2548 | 2548 | ||
2549 | trans->block_rsv = &root->fs_info->trans_block_rsv; | 2549 | trans->block_rsv = &root->fs_info->trans_block_rsv; |
2550 | ret = btrfs_update_inode(trans, root, inode); | 2550 | ret = btrfs_update_inode(trans, root, inode); |
@@ -2794,7 +2794,7 @@ static long btrfs_fallocate(struct file *file, int mode, | |||
2794 | if (IS_ERR(trans)) { | 2794 | if (IS_ERR(trans)) { |
2795 | ret = PTR_ERR(trans); | 2795 | ret = PTR_ERR(trans); |
2796 | } else { | 2796 | } else { |
2797 | inode->i_ctime = CURRENT_TIME; | 2797 | inode->i_ctime = current_fs_time(inode->i_sb); |
2798 | i_size_write(inode, actual_end); | 2798 | i_size_write(inode, actual_end); |
2799 | btrfs_ordered_update_i_size(inode, actual_end, NULL); | 2799 | btrfs_ordered_update_i_size(inode, actual_end, NULL); |
2800 | ret = btrfs_update_inode(trans, root, inode); | 2800 | ret = btrfs_update_inode(trans, root, inode); |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5f06eb1f4384..cf0b3795364a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4013,7 +4013,8 @@ err: | |||
4013 | btrfs_i_size_write(dir, dir->i_size - name_len * 2); | 4013 | btrfs_i_size_write(dir, dir->i_size - name_len * 2); |
4014 | inode_inc_iversion(inode); | 4014 | inode_inc_iversion(inode); |
4015 | inode_inc_iversion(dir); | 4015 | inode_inc_iversion(dir); |
4016 | inode->i_ctime = dir->i_mtime = dir->i_ctime = CURRENT_TIME; | 4016 | inode->i_ctime = dir->i_mtime = |
4017 | dir->i_ctime = current_fs_time(inode->i_sb); | ||
4017 | ret = btrfs_update_inode(trans, root, dir); | 4018 | ret = btrfs_update_inode(trans, root, dir); |
4018 | out: | 4019 | out: |
4019 | return ret; | 4020 | return ret; |
@@ -4156,7 +4157,7 @@ int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, | |||
4156 | 4157 | ||
4157 | btrfs_i_size_write(dir, dir->i_size - name_len * 2); | 4158 | btrfs_i_size_write(dir, dir->i_size - name_len * 2); |
4158 | inode_inc_iversion(dir); | 4159 | inode_inc_iversion(dir); |
4159 | dir->i_mtime = dir->i_ctime = CURRENT_TIME; | 4160 | dir->i_mtime = dir->i_ctime = current_fs_time(dir->i_sb); |
4160 | ret = btrfs_update_inode_fallback(trans, root, dir); | 4161 | ret = btrfs_update_inode_fallback(trans, root, dir); |
4161 | if (ret) | 4162 | if (ret) |
4162 | btrfs_abort_transaction(trans, root, ret); | 4163 | btrfs_abort_transaction(trans, root, ret); |
@@ -5588,7 +5589,7 @@ static struct inode *new_simple_dir(struct super_block *s, | |||
5588 | inode->i_op = &btrfs_dir_ro_inode_operations; | 5589 | inode->i_op = &btrfs_dir_ro_inode_operations; |
5589 | inode->i_fop = &simple_dir_operations; | 5590 | inode->i_fop = &simple_dir_operations; |
5590 | inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; | 5591 | inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO; |
5591 | inode->i_mtime = CURRENT_TIME; | 5592 | inode->i_mtime = current_fs_time(inode->i_sb); |
5592 | inode->i_atime = inode->i_mtime; | 5593 | inode->i_atime = inode->i_mtime; |
5593 | inode->i_ctime = inode->i_mtime; | 5594 | inode->i_ctime = inode->i_mtime; |
5594 | BTRFS_I(inode)->i_otime = inode->i_mtime; | 5595 | BTRFS_I(inode)->i_otime = inode->i_mtime; |
@@ -6160,7 +6161,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
6160 | inode_init_owner(inode, dir, mode); | 6161 | inode_init_owner(inode, dir, mode); |
6161 | inode_set_bytes(inode, 0); | 6162 | inode_set_bytes(inode, 0); |
6162 | 6163 | ||
6163 | inode->i_mtime = CURRENT_TIME; | 6164 | inode->i_mtime = current_fs_time(inode->i_sb); |
6164 | inode->i_atime = inode->i_mtime; | 6165 | inode->i_atime = inode->i_mtime; |
6165 | inode->i_ctime = inode->i_mtime; | 6166 | inode->i_ctime = inode->i_mtime; |
6166 | BTRFS_I(inode)->i_otime = inode->i_mtime; | 6167 | BTRFS_I(inode)->i_otime = inode->i_mtime; |
@@ -6273,7 +6274,8 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, | |||
6273 | btrfs_i_size_write(parent_inode, parent_inode->i_size + | 6274 | btrfs_i_size_write(parent_inode, parent_inode->i_size + |
6274 | name_len * 2); | 6275 | name_len * 2); |
6275 | inode_inc_iversion(parent_inode); | 6276 | inode_inc_iversion(parent_inode); |
6276 | parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME; | 6277 | parent_inode->i_mtime = parent_inode->i_ctime = |
6278 | current_fs_time(parent_inode->i_sb); | ||
6277 | ret = btrfs_update_inode(trans, root, parent_inode); | 6279 | ret = btrfs_update_inode(trans, root, parent_inode); |
6278 | if (ret) | 6280 | if (ret) |
6279 | btrfs_abort_transaction(trans, root, ret); | 6281 | btrfs_abort_transaction(trans, root, ret); |
@@ -6491,7 +6493,7 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, | |||
6491 | BTRFS_I(inode)->dir_index = 0ULL; | 6493 | BTRFS_I(inode)->dir_index = 0ULL; |
6492 | inc_nlink(inode); | 6494 | inc_nlink(inode); |
6493 | inode_inc_iversion(inode); | 6495 | inode_inc_iversion(inode); |
6494 | inode->i_ctime = CURRENT_TIME; | 6496 | inode->i_ctime = current_fs_time(inode->i_sb); |
6495 | ihold(inode); | 6497 | ihold(inode); |
6496 | set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); | 6498 | set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); |
6497 | 6499 | ||
@@ -9254,7 +9256,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
9254 | struct btrfs_root *dest = BTRFS_I(new_dir)->root; | 9256 | struct btrfs_root *dest = BTRFS_I(new_dir)->root; |
9255 | struct inode *new_inode = d_inode(new_dentry); | 9257 | struct inode *new_inode = d_inode(new_dentry); |
9256 | struct inode *old_inode = d_inode(old_dentry); | 9258 | struct inode *old_inode = d_inode(old_dentry); |
9257 | struct timespec ctime = CURRENT_TIME; | ||
9258 | u64 index = 0; | 9259 | u64 index = 0; |
9259 | u64 root_objectid; | 9260 | u64 root_objectid; |
9260 | int ret; | 9261 | int ret; |
@@ -9351,9 +9352,9 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
9351 | inode_inc_iversion(old_dir); | 9352 | inode_inc_iversion(old_dir); |
9352 | inode_inc_iversion(new_dir); | 9353 | inode_inc_iversion(new_dir); |
9353 | inode_inc_iversion(old_inode); | 9354 | inode_inc_iversion(old_inode); |
9354 | old_dir->i_ctime = old_dir->i_mtime = ctime; | 9355 | old_dir->i_ctime = old_dir->i_mtime = |
9355 | new_dir->i_ctime = new_dir->i_mtime = ctime; | 9356 | new_dir->i_ctime = new_dir->i_mtime = |
9356 | old_inode->i_ctime = ctime; | 9357 | old_inode->i_ctime = current_fs_time(old_dir->i_sb); |
9357 | 9358 | ||
9358 | if (old_dentry->d_parent != new_dentry->d_parent) | 9359 | if (old_dentry->d_parent != new_dentry->d_parent) |
9359 | btrfs_record_unlink_dir(trans, old_dir, old_inode, 1); | 9360 | btrfs_record_unlink_dir(trans, old_dir, old_inode, 1); |
@@ -9378,7 +9379,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
9378 | 9379 | ||
9379 | if (new_inode) { | 9380 | if (new_inode) { |
9380 | inode_inc_iversion(new_inode); | 9381 | inode_inc_iversion(new_inode); |
9381 | new_inode->i_ctime = CURRENT_TIME; | 9382 | new_inode->i_ctime = current_fs_time(new_inode->i_sb); |
9382 | if (unlikely(btrfs_ino(new_inode) == | 9383 | if (unlikely(btrfs_ino(new_inode) == |
9383 | BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { | 9384 | BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) { |
9384 | root_objectid = BTRFS_I(new_inode)->location.objectid; | 9385 | root_objectid = BTRFS_I(new_inode)->location.objectid; |
@@ -9856,7 +9857,7 @@ next: | |||
9856 | *alloc_hint = ins.objectid + ins.offset; | 9857 | *alloc_hint = ins.objectid + ins.offset; |
9857 | 9858 | ||
9858 | inode_inc_iversion(inode); | 9859 | inode_inc_iversion(inode); |
9859 | inode->i_ctime = CURRENT_TIME; | 9860 | inode->i_ctime = current_fs_time(inode->i_sb); |
9860 | BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; | 9861 | BTRFS_I(inode)->flags |= BTRFS_INODE_PREALLOC; |
9861 | if (!(mode & FALLOC_FL_KEEP_SIZE) && | 9862 | if (!(mode & FALLOC_FL_KEEP_SIZE) && |
9862 | (actual_len > inode->i_size) && | 9863 | (actual_len > inode->i_size) && |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e65fdc8550b1..0cdcdf216a1b 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -347,7 +347,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | |||
347 | 347 | ||
348 | btrfs_update_iflags(inode); | 348 | btrfs_update_iflags(inode); |
349 | inode_inc_iversion(inode); | 349 | inode_inc_iversion(inode); |
350 | inode->i_ctime = CURRENT_TIME; | 350 | inode->i_ctime = current_fs_time(inode->i_sb); |
351 | ret = btrfs_update_inode(trans, root, inode); | 351 | ret = btrfs_update_inode(trans, root, inode); |
352 | 352 | ||
353 | btrfs_end_transaction(trans, root); | 353 | btrfs_end_transaction(trans, root); |
@@ -443,7 +443,7 @@ static noinline int create_subvol(struct inode *dir, | |||
443 | struct btrfs_root *root = BTRFS_I(dir)->root; | 443 | struct btrfs_root *root = BTRFS_I(dir)->root; |
444 | struct btrfs_root *new_root; | 444 | struct btrfs_root *new_root; |
445 | struct btrfs_block_rsv block_rsv; | 445 | struct btrfs_block_rsv block_rsv; |
446 | struct timespec cur_time = CURRENT_TIME; | 446 | struct timespec cur_time = current_fs_time(dir->i_sb); |
447 | struct inode *inode; | 447 | struct inode *inode; |
448 | int ret; | 448 | int ret; |
449 | int err; | 449 | int err; |
@@ -3144,7 +3144,7 @@ static int clone_finish_inode_update(struct btrfs_trans_handle *trans, | |||
3144 | 3144 | ||
3145 | inode_inc_iversion(inode); | 3145 | inode_inc_iversion(inode); |
3146 | if (!no_time_update) | 3146 | if (!no_time_update) |
3147 | inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 3147 | inode->i_mtime = inode->i_ctime = current_fs_time(inode->i_sb); |
3148 | /* | 3148 | /* |
3149 | * We round up to the block size at eof when determining which | 3149 | * We round up to the block size at eof when determining which |
3150 | * extents to clone above, but shouldn't round up the file size. | 3150 | * extents to clone above, but shouldn't round up the file size. |
@@ -4952,7 +4952,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, | |||
4952 | struct btrfs_root *root = BTRFS_I(inode)->root; | 4952 | struct btrfs_root *root = BTRFS_I(inode)->root; |
4953 | struct btrfs_root_item *root_item = &root->root_item; | 4953 | struct btrfs_root_item *root_item = &root->root_item; |
4954 | struct btrfs_trans_handle *trans; | 4954 | struct btrfs_trans_handle *trans; |
4955 | struct timespec ct = CURRENT_TIME; | 4955 | struct timespec ct = current_fs_time(inode->i_sb); |
4956 | int ret = 0; | 4956 | int ret = 0; |
4957 | int received_uuid_changed; | 4957 | int received_uuid_changed; |
4958 | 4958 | ||
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 7cf8509deda7..a25f3b21491b 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -488,7 +488,7 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, | |||
488 | struct btrfs_root *root) | 488 | struct btrfs_root *root) |
489 | { | 489 | { |
490 | struct btrfs_root_item *item = &root->root_item; | 490 | struct btrfs_root_item *item = &root->root_item; |
491 | struct timespec ct = CURRENT_TIME; | 491 | struct timespec ct = current_fs_time(root->fs_info->sb); |
492 | 492 | ||
493 | spin_lock(&root->root_item_lock); | 493 | spin_lock(&root->root_item_lock); |
494 | btrfs_set_root_ctransid(item, trans->transid); | 494 | btrfs_set_root_ctransid(item, trans->transid); |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index b6031ce474f7..37562d614abc 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1333,7 +1333,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1333 | struct dentry *dentry; | 1333 | struct dentry *dentry; |
1334 | struct extent_buffer *tmp; | 1334 | struct extent_buffer *tmp; |
1335 | struct extent_buffer *old; | 1335 | struct extent_buffer *old; |
1336 | struct timespec cur_time = CURRENT_TIME; | 1336 | struct timespec cur_time; |
1337 | int ret = 0; | 1337 | int ret = 0; |
1338 | u64 to_reserve = 0; | 1338 | u64 to_reserve = 0; |
1339 | u64 index = 0; | 1339 | u64 index = 0; |
@@ -1381,6 +1381,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1381 | parent_root = BTRFS_I(parent_inode)->root; | 1381 | parent_root = BTRFS_I(parent_inode)->root; |
1382 | record_root_in_trans(trans, parent_root); | 1382 | record_root_in_trans(trans, parent_root); |
1383 | 1383 | ||
1384 | cur_time = current_fs_time(parent_inode->i_sb); | ||
1385 | |||
1384 | /* | 1386 | /* |
1385 | * insert the directory item | 1387 | * insert the directory item |
1386 | */ | 1388 | */ |
@@ -1523,7 +1525,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1523 | 1525 | ||
1524 | btrfs_i_size_write(parent_inode, parent_inode->i_size + | 1526 | btrfs_i_size_write(parent_inode, parent_inode->i_size + |
1525 | dentry->d_name.len * 2); | 1527 | dentry->d_name.len * 2); |
1526 | parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME; | 1528 | parent_inode->i_mtime = parent_inode->i_ctime = |
1529 | current_fs_time(parent_inode->i_sb); | ||
1527 | ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode); | 1530 | ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode); |
1528 | if (ret) { | 1531 | if (ret) { |
1529 | btrfs_abort_transaction(trans, root, ret); | 1532 | btrfs_abort_transaction(trans, root, ret); |
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 6c68d6356197..f2a20d52b9db 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -249,7 +249,7 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans, | |||
249 | goto out; | 249 | goto out; |
250 | 250 | ||
251 | inode_inc_iversion(inode); | 251 | inode_inc_iversion(inode); |
252 | inode->i_ctime = CURRENT_TIME; | 252 | inode->i_ctime = current_fs_time(inode->i_sb); |
253 | set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); | 253 | set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); |
254 | ret = btrfs_update_inode(trans, root, inode); | 254 | ret = btrfs_update_inode(trans, root, inode); |
255 | BUG_ON(ret); | 255 | BUG_ON(ret); |