arm: tegra: enterprise: Add drivers for flashless XMM modem
[linux-2.6.git] / fs / reiserfs / do_balan.c
index 4beb964..60c0804 100644 (file)
 #include <linux/buffer_head.h>
 #include <linux/kernel.h>
 
-#ifdef CONFIG_REISERFS_CHECK
-
-struct tree_balance *cur_tb = NULL;    /* detects whether more than one
-                                          copy of tb exists as a means
-                                          of checking whether schedule
-                                          is interrupting do_balance */
-#endif
-
 static inline void buffer_info_init_left(struct tree_balance *tb,
                                          struct buffer_info *bi)
 {
@@ -1270,9 +1262,8 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih,    /* item h
 
                                        RFALSE(ih, "PAP-12210: ih must be 0");
 
-                                       if (is_direntry_le_ih
-                                           (aux_ih =
-                                            B_N_PITEM_HEAD(tbS0, item_pos))) {
+                                       aux_ih = B_N_PITEM_HEAD(tbS0, item_pos);
+                                       if (is_direntry_le_ih(aux_ih)) {
                                                /* we append to directory item */
 
                                                int entry_count;
@@ -1841,11 +1832,12 @@ static int check_before_balancing(struct tree_balance *tb)
 {
        int retval = 0;
 
-       if (cur_tb) {
+       if (REISERFS_SB(tb->tb_sb)->cur_tb) {
                reiserfs_panic(tb->tb_sb, "vs-12335", "suspect that schedule "
                               "occurred based on cur_tb not being null at "
                               "this point in code. do_balance cannot properly "
-                              "handle schedule occurring while it runs.");
+                              "handle concurrent tree accesses on a same "
+                              "mount point.");
        }
 
        /* double check that buffers that we will modify are unlocked. (fix_nodes should already have
@@ -1987,7 +1979,7 @@ static inline void do_balance_starts(struct tree_balance *tb)
             "check");*/
        RFALSE(check_before_balancing(tb), "PAP-12340: locked buffers in TB");
 #ifdef CONFIG_REISERFS_CHECK
-       cur_tb = tb;
+       REISERFS_SB(tb->tb_sb)->cur_tb = tb;
 #endif
 }
 
@@ -1997,7 +1989,7 @@ static inline void do_balance_completed(struct tree_balance *tb)
 #ifdef CONFIG_REISERFS_CHECK
        check_leaf_level(tb);
        check_internal_levels(tb);
-       cur_tb = NULL;
+       REISERFS_SB(tb->tb_sb)->cur_tb = NULL;
 #endif
 
        /* reiserfs_free_block is no longer schedule safe.  So, we need to