]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 8 Mar 2010 22:07:53 +0000 (14:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 8 Mar 2010 22:07:53 +0000 (14:07 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
  Btrfs: kfree correct pointer during mount option parsing
  Btrfs: use RB_ROOT to intialize rb_trees instead of setting rb_node to NULL

fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/extent_map.c
fs/btrfs/free-space-cache.c
fs/btrfs/ordered-data.h
fs/btrfs/ref-cache.h
fs/btrfs/relocation.c
fs/btrfs/super.c
fs/btrfs/transaction.c

index 2b59201b955ca533bcb10a251df07ff2d7c549d2..0427183e3e05c0198617427fbc311c9b7f397947 100644 (file)
@@ -901,7 +901,7 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
        root->highest_objectid = 0;
        root->name = NULL;
        root->in_sysfs = 0;
-       root->inode_tree.rb_node = NULL;
+       root->inode_tree = RB_ROOT;
 
        INIT_LIST_HEAD(&root->dirty_list);
        INIT_LIST_HEAD(&root->orphan_list);
@@ -1673,7 +1673,7 @@ struct btrfs_root *open_ctree(struct super_block *sb,
        insert_inode_hash(fs_info->btree_inode);
 
        spin_lock_init(&fs_info->block_group_cache_lock);
-       fs_info->block_group_cache_tree.rb_node = NULL;
+       fs_info->block_group_cache_tree = RB_ROOT;
 
        extent_io_tree_init(&fs_info->freed_extents[0],
                             fs_info->btree_inode->i_mapping, GFP_NOFS);
index b177ed3196126d9fe8e5d0f1507075a421e535b9..7073cbb1b2d4cfc169dfea2ca435d353f282250f 100644 (file)
@@ -104,8 +104,8 @@ void extent_io_exit(void)
 void extent_io_tree_init(struct extent_io_tree *tree,
                          struct address_space *mapping, gfp_t mask)
 {
-       tree->state.rb_node = NULL;
-       tree->buffer.rb_node = NULL;
+       tree->state = RB_ROOT;
+       tree->buffer = RB_ROOT;
        tree->ops = NULL;
        tree->dirty_bytes = 0;
        spin_lock_init(&tree->lock);
index 428fcac45f90ec105226d66de2efe3c4ee43d421..28d87ba60ce8170d0c10d14225dc5ce37eb24beb 100644 (file)
@@ -35,7 +35,7 @@ void extent_map_exit(void)
  */
 void extent_map_tree_init(struct extent_map_tree *tree, gfp_t mask)
 {
-       tree->map.rb_node = NULL;
+       tree->map = RB_ROOT;
        rwlock_init(&tree->lock);
 }
 
index cb2849f03251d081c6a6eca73f9372f0798517ac..dd831ed31eead2c4bda12eaf37a4c331458a9646 100644 (file)
@@ -870,7 +870,7 @@ __btrfs_return_cluster_to_free_space(
                tree_insert_offset(&block_group->free_space_offset,
                                   entry->offset, &entry->offset_index, 0);
        }
-       cluster->root.rb_node = NULL;
+       cluster->root = RB_ROOT;
 
 out:
        spin_unlock(&cluster->lock);
@@ -1355,7 +1355,7 @@ void btrfs_init_free_cluster(struct btrfs_free_cluster *cluster)
 {
        spin_lock_init(&cluster->lock);
        spin_lock_init(&cluster->refill_lock);
-       cluster->root.rb_node = NULL;
+       cluster->root = RB_ROOT;
        cluster->max_size = 0;
        cluster->points_to_bitmap = false;
        INIT_LIST_HEAD(&cluster->block_group_list);
index 1fe1282ef47c998aa9cde1c0c43e4f088e7e767c..9116c6d0c5a92154897cd01b60b3206712dc54da 100644 (file)
@@ -129,7 +129,7 @@ static inline void
 btrfs_ordered_inode_tree_init(struct btrfs_ordered_inode_tree *t)
 {
        mutex_init(&t->mutex);
-       t->tree.rb_node = NULL;
+       t->tree = RB_ROOT;
        t->last = NULL;
 }
 
index bc283ad2db7364b112824ab08f44e58e37fc18cf..e2a55cb2072bda576d6f30b6079b30b2e497d8e7 100644 (file)
@@ -52,7 +52,7 @@ static inline size_t btrfs_leaf_ref_size(int nr_extents)
 
 static inline void btrfs_leaf_ref_tree_init(struct btrfs_leaf_ref_tree *tree)
 {
-       tree->root.rb_node = NULL;
+       tree->root = RB_ROOT;
        INIT_LIST_HEAD(&tree->list);
        spin_lock_init(&tree->lock);
 }
index ab7ab53187452aa7794bfcdfb5596385d3cc77b2..0109e5606bade9a3293ef57e401745508e36c8ab 100644 (file)
@@ -170,14 +170,14 @@ struct async_merge {
 
 static void mapping_tree_init(struct mapping_tree *tree)
 {
-       tree->rb_root.rb_node = NULL;
+       tree->rb_root = RB_ROOT;
        spin_lock_init(&tree->lock);
 }
 
 static void backref_cache_init(struct backref_cache *cache)
 {
        int i;
-       cache->rb_root.rb_node = NULL;
+       cache->rb_root = RB_ROOT;
        for (i = 0; i < BTRFS_MAX_LEVEL; i++)
                INIT_LIST_HEAD(&cache->pending[i]);
        spin_lock_init(&cache->lock);
index 8a1ea6e64575a34c507c29cd8c84ec4944885583..f8b4521de90750c32cd2347baea5e25355748066 100644 (file)
@@ -128,7 +128,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
 {
        struct btrfs_fs_info *info = root->fs_info;
        substring_t args[MAX_OPT_ARGS];
-       char *p, *num;
+       char *p, *num, *orig;
        int intarg;
        int ret = 0;
 
@@ -143,6 +143,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
        if (!options)
                return -ENOMEM;
 
+       orig = options;
 
        while ((p = strsep(&options, ",")) != NULL) {
                int token;
@@ -280,7 +281,7 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
                }
        }
 out:
-       kfree(options);
+       kfree(orig);
        return ret;
 }
 
index b2acc79f1b342e651a4c31da168c2952efa57ff2..2a36e236a4924c978d7b74c416e062f7d92dc921 100644 (file)
@@ -69,7 +69,7 @@ static noinline int join_transaction(struct btrfs_root *root)
                cur_trans->commit_done = 0;
                cur_trans->start_time = get_seconds();
 
-               cur_trans->delayed_refs.root.rb_node = NULL;
+               cur_trans->delayed_refs.root = RB_ROOT;
                cur_trans->delayed_refs.num_entries = 0;
                cur_trans->delayed_refs.num_heads_ready = 0;
                cur_trans->delayed_refs.num_heads = 0;