diff options
author | Josef Bacik <josef@redhat.com> | 2011-10-18 12:15:48 -0400 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-10-19 15:12:59 -0400 |
commit | 36ba022ac0b748dd543f43430b03198e899426c9 (patch) | |
tree | 3175872760ac769cde046b3ac43900fc42856bb8 /fs/btrfs/ctree.h | |
parent | 3880a1b46d87a6b030c31889875befc745d95dff (diff) |
Btrfs: seperate out btrfs_block_rsv_check out into 2 different functions
Currently btrfs_block_rsv_check does 2 things, it will either refill a block
reserve like in the truncate or refill case, or it will check to see if there is
enough space in the global reserve and possibly refill it. However because of
overcommit we could be well overcommitting ourselves just to try and refill the
global reserve, when really we should just be committing the transaction. So
breack this out into btrfs_block_rsv_refill and btrfs_block_rsv_check. Refill
will try to reserve more metadata if it can and btrfs_block_rsv_check will not,
it will only tell you if the factor of the total space is still reserved.
Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ea60897a9171..227620993bce 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2252,8 +2252,10 @@ int btrfs_block_rsv_add(struct btrfs_root *root, | |||
2252 | struct btrfs_block_rsv *block_rsv, | 2252 | struct btrfs_block_rsv *block_rsv, |
2253 | u64 num_bytes); | 2253 | u64 num_bytes); |
2254 | int btrfs_block_rsv_check(struct btrfs_root *root, | 2254 | int btrfs_block_rsv_check(struct btrfs_root *root, |
2255 | struct btrfs_block_rsv *block_rsv, int min_factor); | ||
2256 | int btrfs_block_rsv_refill(struct btrfs_root *root, | ||
2255 | struct btrfs_block_rsv *block_rsv, | 2257 | struct btrfs_block_rsv *block_rsv, |
2256 | u64 min_reserved, int min_factor, int flush); | 2258 | u64 min_reserved); |
2257 | int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, | 2259 | int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, |
2258 | struct btrfs_block_rsv *dst_rsv, | 2260 | struct btrfs_block_rsv *dst_rsv, |
2259 | u64 num_bytes); | 2261 | u64 num_bytes); |