aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@redhat.com>2011-05-03 10:40:22 -0400
committerJosef Bacik <josef@redhat.com>2011-05-23 13:03:08 -0400
commitfcb80c2affd63237cff5b34cba5756be7c976a5a (patch)
tree49c37dce49ebd9a1ada939d1fd2cfa57bba6f500 /fs/btrfs/ctree.h
parenta4abeea41adfa3c143c289045f4625dfaeba2212 (diff)
Btrfs: fix how we do space reservation for truncate
The ceph guys keep running into problems where we have space reserved in our orphan block rsv when freeing it up. This is because they tend to do snapshots alot, so their truncates tend to use a bunch of space, so when we go to do things like update the inode we have to steal reservation space in order to make the reservation happen. This happens because truncate can use as much space as it freaking feels like, but we still have to hold space for removing the orphan item and updating the inode, which will definitely always happen. So in order to fix this we need to split all of the reservation stuf up. So with this patch we have 1) The orphan block reserve which only holds the space for deleting our orphan item when everything is over. 2) The truncate block reserve which gets allocated and used specifically for the space that the truncate will use on a per truncate basis. 3) The transaction will always have 1 item's worth of data reserved so we can update the inode normally. Hopefully this will make the ceph problem go away. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 522a39b0033d..f31aed7fedd9 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2224,6 +2224,9 @@ int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv,
2224void btrfs_block_rsv_release(struct btrfs_root *root, 2224void btrfs_block_rsv_release(struct btrfs_root *root,
2225 struct btrfs_block_rsv *block_rsv, 2225 struct btrfs_block_rsv *block_rsv,
2226 u64 num_bytes); 2226 u64 num_bytes);
2227int btrfs_truncate_reserve_metadata(struct btrfs_trans_handle *trans,
2228 struct btrfs_root *root,
2229 struct btrfs_block_rsv *rsv);
2227int btrfs_set_block_group_ro(struct btrfs_root *root, 2230int btrfs_set_block_group_ro(struct btrfs_root *root,
2228 struct btrfs_block_group_cache *cache); 2231 struct btrfs_block_group_cache *cache);
2229int btrfs_set_block_group_rw(struct btrfs_root *root, 2232int btrfs_set_block_group_rw(struct btrfs_root *root,