diff options
author | Josef Bacik <jbacik@fb.com> | 2016-03-25 20:25:48 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-07 19:45:53 +0300 |
commit | 25d609f86d6808eb1f0e8a6cafc3edb4a2b5ae35 (patch) | |
tree | 24b8d9a911aa57675c5ade8f46028d32e77c521a /fs/btrfs/delayed-inode.c | |
parent | e40edf2da4fc6ab10c707b0522372b08b38171e6 (diff) | |
download | linux-25d609f86d6808eb1f0e8a6cafc3edb4a2b5ae35.tar.xz |
Btrfs: fix callers of btrfs_block_rsv_migrate
So btrfs_block_rsv_migrate just unconditionally calls block_rsv_migrate_bytes.
Not only this but it unconditionally changes the size of the block_rsv. This
isn't a bug strictly speaking, but it makes truncate block rsv's look funny
because every time we migrate bytes over its size grows, even though we only
want it to be a specific size. So collapse this into one function that takes an
update_size argument and make truncate and evict not update the size for
consistency sake. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index d3aaabbfada0..f749a5447b2a 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -553,7 +553,7 @@ static int btrfs_delayed_item_reserve_metadata(struct btrfs_trans_handle *trans, dst_rsv = &root->fs_info->delayed_block_rsv; num_bytes = btrfs_calc_trans_metadata_size(root, 1); - ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes); + ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1); if (!ret) { trace_btrfs_space_reservation(root->fs_info, "delayed_item", item->key.objectid, @@ -649,7 +649,7 @@ static int btrfs_delayed_inode_reserve_metadata( if (!ret) goto out; - ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes); + ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1); if (!ret) goto out; @@ -663,12 +663,12 @@ static int btrfs_delayed_inode_reserve_metadata( * since this really shouldn't happen that often. */ ret = btrfs_block_rsv_migrate(&root->fs_info->global_block_rsv, - dst_rsv, num_bytes); + dst_rsv, num_bytes, 1); goto out; } migrate: - ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes); + ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes, 1); out: /* |