ext4: fix up rb_root initializations to use RB_ROOT
authorVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Fri, 5 Mar 2010 03:25:21 +0000 (22:25 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 5 Mar 2010 03:25:21 +0000 (22:25 -0500)
ext4 uses rb_node = NULL; to zero rb_root at few places.  Using
RB_ROOT as the initializer is more portable in case the underlying
implementation of rbtrees changes in the future.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Eric Paris <eparis@redhat.com>
fs/ext4/block_validity.c
fs/ext4/dir.c
fs/ext4/mballoc.c

index a60ab9aad57d4f5807adb72b702042056132e08a..983f0e1274939b4506c91ea23c3c7d38ae624a88 100644 (file)
@@ -205,14 +205,14 @@ void ext4_release_system_zone(struct super_block *sb)
                entry = rb_entry(n, struct ext4_system_zone, node);
                kmem_cache_free(ext4_system_zone_cachep, entry);
                if (!parent)
-                       EXT4_SB(sb)->system_blks.rb_node = NULL;
+                       EXT4_SB(sb)->system_blks = RB_ROOT;
                else if (parent->rb_left == n)
                        parent->rb_left = NULL;
                else if (parent->rb_right == n)
                        parent->rb_right = NULL;
                n = parent;
        }
-       EXT4_SB(sb)->system_blks.rb_node = NULL;
+       EXT4_SB(sb)->system_blks = RB_ROOT;
 }
 
 /*
index 29857ddd9e2602e6cdaa59ba7976422f54815c8e..86cb6d86a04806d260d0078efff6c45d4eb9d633 100644 (file)
@@ -305,7 +305,7 @@ static void free_rb_tree_fname(struct rb_root *root)
                        kfree(old);
                }
                if (!parent)
-                       root->rb_node = NULL;
+                       *root = RB_ROOT;
                else if (parent->rb_left == n)
                        parent->rb_left = NULL;
                else if (parent->rb_right == n)
index 37d2438e0cb4d716358f08fd62ca5b0403b74f4c..abb11e328b6504b62fe1e000c25cd6fa0f20213e 100644 (file)
@@ -2253,7 +2253,7 @@ int ext4_mb_add_groupinfo(struct super_block *sb, ext4_group_t group,
 
        INIT_LIST_HEAD(&meta_group_info[i]->bb_prealloc_list);
        init_rwsem(&meta_group_info[i]->alloc_sem);
-       meta_group_info[i]->bb_free_root.rb_node = NULL;
+       meta_group_info[i]->bb_free_root = RB_ROOT;
 
 #ifdef DOUBLE_CHECK
        {