diff options
author | Josef Bacik <josef@redhat.com> | 2011-10-14 14:40:17 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-10-19 15:12:58 -0400 |
commit | b24e03db0df3e9164c9649db12fecc8c2d81b0d1 (patch) | |
tree | e7742796bf98c1211babe8d1bdc464ad3e3a98a1 /fs/btrfs/extent-tree.c | |
parent | 877da174301dde9062b915da4c8103048be49702 (diff) | |
download | lwn-b24e03db0df3e9164c9649db12fecc8c2d81b0d1.tar.gz lwn-b24e03db0df3e9164c9649db12fecc8c2d81b0d1.zip |
Btrfs: release trans metadata bytes before flushing delayed refs
We started setting trans->block_rsv = NULL to allow the delayed refs flushing
stuff to use the right block_rsv and then just made
btrfs_trans_release_metadata() unconditionally use the trans block rsv. The
problem with this is we need to reserve some space in the transaction and then
migrate it to the global block rsv, so we need to be able to free that out
properly. So instead just move btrfs_trans_release_metadata() before the
delayed ref flushing and use trans->block_rsv for the freeing. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 424ae82855c8..eb4fe56b08bb 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3909,13 +3909,10 @@ static void release_global_block_rsv(struct btrfs_fs_info *fs_info) void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, struct btrfs_root *root) { - struct btrfs_block_rsv *block_rsv; - if (!trans->bytes_reserved) return; - block_rsv = &root->fs_info->trans_block_rsv; - btrfs_block_rsv_release(root, block_rsv, trans->bytes_reserved); + btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); trans->bytes_reserved = 0; } |