summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2012-08-29 14:27:18 -0400
committerChris Mason <chris.mason@fusionio.com>2012-10-01 15:19:07 -0400
commit2aaa66558172b017f36bf38ae69372813dedee9d (patch)
treed6150a615935d36166cd06d69e3252451e62e724 /fs/btrfs/extent-tree.c
parent2671485d395c07fca104c972785898d7c52fc942 (diff)
downloadblackbird-obmc-linux-2aaa66558172b017f36bf38ae69372813dedee9d.tar.gz
blackbird-obmc-linux-2aaa66558172b017f36bf38ae69372813dedee9d.zip
Btrfs: add hole punching
This patch adds hole punching via fallocate. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index df2f17b0ac5d..ee51b7afe97d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4132,6 +4132,8 @@ struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root)
void btrfs_free_block_rsv(struct btrfs_root *root,
struct btrfs_block_rsv *rsv)
{
+ if (!rsv)
+ return;
btrfs_block_rsv_release(root, rsv, (u64)-1);
kfree(rsv);
}
OpenPOWER on IntegriCloud