diff options
author | Josef Bacik <jbacik@fb.com> | 2016-03-25 13:25:48 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-07 18:45:53 +0200 |
commit | 25d609f86d6808eb1f0e8a6cafc3edb4a2b5ae35 (patch) | |
tree | 24b8d9a911aa57675c5ade8f46028d32e77c521a /fs/btrfs/inode.c | |
parent | e40edf2da4fc6ab10c707b0522372b08b38171e6 (diff) | |
download | op-kernel-dev-25d609f86d6808eb1f0e8a6cafc3edb4a2b5ae35.zip op-kernel-dev-25d609f86d6808eb1f0e8a6cafc3edb4a2b5ae35.tar.gz |
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/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 4421954..3e61bd1 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5264,7 +5264,7 @@ void btrfs_evict_inode(struct inode *inode) if (steal_from_global) { if (!btrfs_check_space_for_delayed_refs(trans, root)) ret = btrfs_block_rsv_migrate(global_rsv, rsv, - min_size); + min_size, 0); else ret = -ENOSPC; } @@ -9116,7 +9116,7 @@ static int btrfs_truncate(struct inode *inode) /* Migrate the slack space for the truncate to our reserve */ ret = btrfs_block_rsv_migrate(&root->fs_info->trans_block_rsv, rsv, - min_size); + min_size, 0); BUG_ON(ret); /* @@ -9156,7 +9156,7 @@ static int btrfs_truncate(struct inode *inode) } ret = btrfs_block_rsv_migrate(&root->fs_info->trans_block_rsv, - rsv, min_size); + rsv, min_size, 0); BUG_ON(ret); /* shouldn't happen */ trans->block_rsv = rsv; } @@ -9177,7 +9177,6 @@ static int btrfs_truncate(struct inode *inode) ret = btrfs_end_transaction(trans, root); btrfs_btree_balance_dirty(root); } - out: btrfs_free_block_rsv(root, rsv); |