diff options
author | Josef Bacik <jbacik@fb.com> | 2016-01-13 13:21:20 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-02-18 05:22:41 -0500 |
commit | 88d3a5aaf6171d9a222961837ba329b850f140e3 (patch) | |
tree | 299737a955fc7d32f0edd0fdd8a16c60522fe677 | |
parent | dc95f7bfc57fa4b75a77d0da84d5db249d74aa3f (diff) |
Btrfs: add transaction space reservation tracepoints
There are a few places where we add to trans->bytes_reserved but don't have the
corresponding trace point. With these added my tool no longer sees transaction
leaks.
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/transaction.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index b6031ce474f7..e9e95ef0644f 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -637,6 +637,8 @@ struct btrfs_trans_handle *btrfs_start_transaction_fallback_global_rsv( | |||
637 | 637 | ||
638 | trans->block_rsv = &root->fs_info->trans_block_rsv; | 638 | trans->block_rsv = &root->fs_info->trans_block_rsv; |
639 | trans->bytes_reserved = num_bytes; | 639 | trans->bytes_reserved = num_bytes; |
640 | trace_btrfs_space_reservation(root->fs_info, "transaction", | ||
641 | trans->transid, num_bytes, 1); | ||
640 | 642 | ||
641 | return trans; | 643 | return trans; |
642 | } | 644 | } |
@@ -1375,7 +1377,9 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1375 | rsv = trans->block_rsv; | 1377 | rsv = trans->block_rsv; |
1376 | trans->block_rsv = &pending->block_rsv; | 1378 | trans->block_rsv = &pending->block_rsv; |
1377 | trans->bytes_reserved = trans->block_rsv->reserved; | 1379 | trans->bytes_reserved = trans->block_rsv->reserved; |
1378 | 1380 | trace_btrfs_space_reservation(root->fs_info, "transaction", | |
1381 | trans->transid, | ||
1382 | trans->bytes_reserved, 1); | ||
1379 | dentry = pending->dentry; | 1383 | dentry = pending->dentry; |
1380 | parent_inode = pending->dir; | 1384 | parent_inode = pending->dir; |
1381 | parent_root = BTRFS_I(parent_inode)->root; | 1385 | parent_root = BTRFS_I(parent_inode)->root; |