]> Pileus Git - ~andy/linux/blobdiff - fs/btrfs/tree-defrag.c
Btrfs: selinux support
[~andy/linux] / fs / btrfs / tree-defrag.c
index 6f57d0889b1ed8e63f1f39178f005d4c65b8d0a3..3e8358c36165ece2969b28348c2286b1b609dcbf 100644 (file)
 #include "transaction.h"
 #include "locking.h"
 
-/* defrag all the leaves in a given btree.  If cache_only == 1, don't read things
- * from disk, otherwise read all the leaves and try to get key order to
+/* defrag all the leaves in a given btree.  If cache_only == 1, don't read
+ * things from disk, otherwise read all the leaves and try to get key order to
  * better reflect disk order
  */
+
 int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
                        struct btrfs_root *root, int cache_only)
 {
@@ -65,9 +66,9 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
        level = btrfs_header_level(root->node);
        orig_level = level;
 
-       if (level == 0) {
+       if (level == 0)
                goto out;
-       }
+
        if (root->defrag_progress.objectid == 0) {
                struct extent_buffer *root_node;
                u32 nritems;
@@ -125,9 +126,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
        if (is_extent)
                btrfs_extent_post_op(trans, root);
 out:
-       if (is_extent)
-               mutex_unlock(&root->fs_info->alloc_mutex);
-
        if (path)
                btrfs_free_path(path);
        if (ret == -EAGAIN) {