Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173175
b: refs/heads/master
c: 08f14fc
h: refs/heads/master
i:
  173173: f3af5a9
  173171: 45c4da2
  173167: 9377baa
v: v3
  • Loading branch information
Frederic Weisbecker committed Sep 14, 2009
1 parent c6760e0 commit 9bafd82
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c72e05756b900b3be24cd73a16de52bab80984c0
refs/heads/master: 08f14fc8963e585e65b71212ce8050607b9b6c36
17 changes: 5 additions & 12 deletions trunk/fs/reiserfs/do_balan.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
#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)
{
Expand Down Expand Up @@ -1840,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
Expand Down Expand Up @@ -1986,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
}

Expand All @@ -1996,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
Expand Down
5 changes: 1 addition & 4 deletions trunk/fs/reiserfs/fix_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,6 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h,
return needed_nodes;
}

#ifdef CONFIG_REISERFS_CHECK
extern struct tree_balance *cur_tb;
#endif

/* Set parameters for balancing.
* Performs write of results of analysis of balancing into structure tb,
Expand Down Expand Up @@ -2368,7 +2365,7 @@ int fix_nodes(int op_mode, struct tree_balance *tb,
return REPEAT_SEARCH;
}
#ifdef CONFIG_REISERFS_CHECK
if (cur_tb) {
if (REISERFS_SB(tb->tb_sb)->cur_tb) {
print_cur_tb("fix_nodes");
reiserfs_panic(tb->tb_sb, "PAP-8305",
"there is pending do_balance");
Expand Down
4 changes: 0 additions & 4 deletions trunk/fs/reiserfs/prints.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,6 @@ void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...)
. */

#ifdef CONFIG_REISERFS_CHECK
extern struct tree_balance *cur_tb;
#endif

void __reiserfs_panic(struct super_block *sb, const char *id,
const char *function, const char *fmt, ...)
{
Expand Down
5 changes: 1 addition & 4 deletions trunk/fs/reiserfs/stree.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ static inline int bin_search(const void *key, /* Key to search for. */
return ITEM_NOT_FOUND;
}

#ifdef CONFIG_REISERFS_CHECK
extern struct tree_balance *cur_tb;
#endif

/* Minimal possible key. It is never in the tree. */
const struct reiserfs_key MIN_KEY = { 0, 0, {{0, 0},} };
Expand Down Expand Up @@ -711,7 +708,7 @@ int search_by_key(struct super_block *sb, const struct cpu_key *key, /* Key to s
!key_in_buffer(search_path, key, sb),
"PAP-5130: key is not in the buffer");
#ifdef CONFIG_REISERFS_CHECK
if (cur_tb) {
if (REISERFS_SB(sb)->cur_tb) {
print_cur_tb("5140");
reiserfs_panic(sb, "PAP-5140",
"schedule occurred in do_balance!");
Expand Down
11 changes: 11 additions & 0 deletions trunk/include/linux/reiserfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,17 @@ struct reiserfs_sb_info {
char *s_qf_names[MAXQUOTAS];
int s_jquota_fmt;
#endif
#ifdef CONFIG_REISERFS_CHECK

struct tree_balance *cur_tb; /*
* Detects whether more than one
* copy of tb exists per superblock
* as a means of checking whether
* do_balance is executing concurrently
* against another tree reader/writer
* on a same mount point.
*/
#endif
};

/* Definitions of reiserfs on-disk properties: */
Expand Down

0 comments on commit 9bafd82

Please sign in to comment.