diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-10-17 06:31:39 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-03 06:14:33 -0500 |
commit | 17c2f9f85c896b48a5d74a9155d99ec5b241a0e6 (patch) | |
tree | 9d3e38e673d1d3af650072388a671ec767d3941a /fs/ubifs/commit.c | |
parent | 5dd7cbc083f3a91fa7454125fe992826701b67bc (diff) |
UBIFS: separate debugging fields out
Introduce a new data structure which contains all debugging
stuff inside. This is cleaner than having debugging stuff
directly in 'c'.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/commit.c')
-rw-r--r-- | fs/ubifs/commit.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/ubifs/commit.c b/fs/ubifs/commit.c index b49884c8c10e..f3a7945527fb 100644 --- a/fs/ubifs/commit.c +++ b/fs/ubifs/commit.c | |||
@@ -470,12 +470,12 @@ int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
470 | { | 470 | { |
471 | struct ubifs_idx_node *idx; | 471 | struct ubifs_idx_node *idx; |
472 | int lnum, offs, len, err = 0; | 472 | int lnum, offs, len, err = 0; |
473 | struct ubifs_debug_info *d = c->dbg; | ||
473 | 474 | ||
474 | c->old_zroot = *zroot; | 475 | d->old_zroot = *zroot; |
475 | 476 | lnum = d->old_zroot.lnum; | |
476 | lnum = c->old_zroot.lnum; | 477 | offs = d->old_zroot.offs; |
477 | offs = c->old_zroot.offs; | 478 | len = d->old_zroot.len; |
478 | len = c->old_zroot.len; | ||
479 | 479 | ||
480 | idx = kmalloc(c->max_idx_node_sz, GFP_NOFS); | 480 | idx = kmalloc(c->max_idx_node_sz, GFP_NOFS); |
481 | if (!idx) | 481 | if (!idx) |
@@ -485,8 +485,8 @@ int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
485 | if (err) | 485 | if (err) |
486 | goto out; | 486 | goto out; |
487 | 487 | ||
488 | c->old_zroot_level = le16_to_cpu(idx->level); | 488 | d->old_zroot_level = le16_to_cpu(idx->level); |
489 | c->old_zroot_sqnum = le64_to_cpu(idx->ch.sqnum); | 489 | d->old_zroot_sqnum = le64_to_cpu(idx->ch.sqnum); |
490 | out: | 490 | out: |
491 | kfree(idx); | 491 | kfree(idx); |
492 | return err; | 492 | return err; |
@@ -509,6 +509,7 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
509 | { | 509 | { |
510 | int lnum, offs, len, err = 0, uninitialized_var(last_level), child_cnt; | 510 | int lnum, offs, len, err = 0, uninitialized_var(last_level), child_cnt; |
511 | int first = 1, iip; | 511 | int first = 1, iip; |
512 | struct ubifs_debug_info *d = c->dbg; | ||
512 | union ubifs_key lower_key, upper_key, l_key, u_key; | 513 | union ubifs_key lower_key, upper_key, l_key, u_key; |
513 | unsigned long long uninitialized_var(last_sqnum); | 514 | unsigned long long uninitialized_var(last_sqnum); |
514 | struct ubifs_idx_node *idx; | 515 | struct ubifs_idx_node *idx; |
@@ -525,9 +526,9 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
525 | UBIFS_IDX_NODE_SZ; | 526 | UBIFS_IDX_NODE_SZ; |
526 | 527 | ||
527 | /* Start at the old zroot */ | 528 | /* Start at the old zroot */ |
528 | lnum = c->old_zroot.lnum; | 529 | lnum = d->old_zroot.lnum; |
529 | offs = c->old_zroot.offs; | 530 | offs = d->old_zroot.offs; |
530 | len = c->old_zroot.len; | 531 | len = d->old_zroot.len; |
531 | iip = 0; | 532 | iip = 0; |
532 | 533 | ||
533 | /* | 534 | /* |
@@ -560,11 +561,11 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot) | |||
560 | if (first) { | 561 | if (first) { |
561 | first = 0; | 562 | first = 0; |
562 | /* Check root level and sqnum */ | 563 | /* Check root level and sqnum */ |
563 | if (le16_to_cpu(idx->level) != c->old_zroot_level) { | 564 | if (le16_to_cpu(idx->level) != d->old_zroot_level) { |
564 | err = 2; | 565 | err = 2; |
565 | goto out_dump; | 566 | goto out_dump; |
566 | } | 567 | } |
567 | if (le64_to_cpu(idx->ch.sqnum) != c->old_zroot_sqnum) { | 568 | if (le64_to_cpu(idx->ch.sqnum) != d->old_zroot_sqnum) { |
568 | err = 3; | 569 | err = 3; |
569 | goto out_dump; | 570 | goto out_dump; |
570 | } | 571 | } |