]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/transaction.c
Btrfs: add transaction space reservation tracepoints
[karo-tx-linux.git] / fs / btrfs / transaction.c
index b6031ce474f7c06f90c764c0bf520a95480ef561..e9e95ef0644f209508615b2632bd5083462f7bb4 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;
 }
@@ -1375,7 +1377,9 @@ 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;