summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorMiao Xie2013-05-15 09:48:20 +0200
committerJosef Bacik2013-06-14 17:29:38 +0200
commitb0feb9d96e71a88d7eec56f41b8f23e92af889b0 (patch)
treee808deeb4f3b33636d6481ff1bc88ae269880fa3 /fs/btrfs/extent-tree.c
parentBtrfs: cleanup the similar code of the fs root read (diff)
downloadkernel-qcow2-linux-b0feb9d96e71a88d7eec56f41b8f23e92af889b0.tar.gz
kernel-qcow2-linux-b0feb9d96e71a88d7eec56f41b8f23e92af889b0.tar.xz
kernel-qcow2-linux-b0feb9d96e71a88d7eec56f41b8f23e92af889b0.zip
Btrfs: introduce grab/put functions for the root of the fs/file tree
The grab/put funtions will be used in the next patch, which need grab the root object and ensure it is not freed. We use reference counter instead of the srcu lock is to aovid blocking the memory reclaim task, which invokes synchronize_srcu(). Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> 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, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index c989fe602faf..04066c2cc711 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -7469,7 +7469,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
} else {
free_extent_buffer(root->node);
free_extent_buffer(root->commit_root);
- kfree(root);
+ btrfs_put_fs_root(root);
}
out_end_trans:
btrfs_end_transaction_throttle(trans, tree_root);