]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/btrfs/transaction.c
Merge branch 'misc-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux...
[mirror_ubuntu-bionic-kernel.git] / fs / btrfs / transaction.c
index b6031ce474f7c06f90c764c0bf520a95480ef561..43885e51b88299d1015d75c3eb2d138b67d2b6d8 100644 (file)
@@ -637,6 +637,8 @@ struct btrfs_trans_handle *btrfs_start_transaction_fallback_global_rsv(
 
        trans->block_rsv = &root->fs_info->trans_block_rsv;
        trans->bytes_reserved = num_bytes;
+       trace_btrfs_space_reservation(root->fs_info, "transaction",
+                                     trans->transid, num_bytes, 1);
 
        return trans;
 }
@@ -1333,7 +1335,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
        struct dentry *dentry;
        struct extent_buffer *tmp;
        struct extent_buffer *old;
-       struct timespec cur_time = CURRENT_TIME;
+       struct timespec cur_time;
        int ret = 0;
        u64 to_reserve = 0;
        u64 index = 0;
@@ -1375,12 +1377,16 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
        rsv = trans->block_rsv;
        trans->block_rsv = &pending->block_rsv;
        trans->bytes_reserved = trans->block_rsv->reserved;
-
+       trace_btrfs_space_reservation(root->fs_info, "transaction",
+                                     trans->transid,
+                                     trans->bytes_reserved, 1);
        dentry = pending->dentry;
        parent_inode = pending->dir;
        parent_root = BTRFS_I(parent_inode)->root;
        record_root_in_trans(trans, parent_root);
 
+       cur_time = current_fs_time(parent_inode->i_sb);
+
        /*
         * insert the directory item
         */
@@ -1523,7 +1529,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
 
        btrfs_i_size_write(parent_inode, parent_inode->i_size +
                                         dentry->d_name.len * 2);
-       parent_inode->i_mtime = parent_inode->i_ctime = CURRENT_TIME;
+       parent_inode->i_mtime = parent_inode->i_ctime =
+               current_fs_time(parent_inode->i_sb);
        ret = btrfs_update_inode_fallback(trans, parent_root, parent_inode);
        if (ret) {
                btrfs_abort_transaction(trans, root, ret);