diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:16:39 -0400 |
commit | ad31a4fc0386e8590c51ca4b8f1ae1d8b8b2ac5e (patch) | |
tree | 636010f3ba98e15245f04ade1a74a730e40abf57 /fs/reiserfs/stree.c | |
parent | a9dd364358fbdc68faee5d20c2d648c320dc3cf0 (diff) |
reiserfs: rename p_s_bh to bh
This patch is a simple s/p_s_bh/bh/g to the reiserfs code. This is the
second in a series of patches to rip out some of the awful variable
naming in reiserfs.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/stree.c')
-rw-r--r-- | fs/reiserfs/stree.c | 63 |
1 files changed, 31 insertions, 32 deletions
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 00fd879c4a2a..eb6856f6d323 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
@@ -56,13 +56,13 @@ | |||
56 | #include <linux/quotaops.h> | 56 | #include <linux/quotaops.h> |
57 | 57 | ||
58 | /* Does the buffer contain a disk block which is in the tree. */ | 58 | /* Does the buffer contain a disk block which is in the tree. */ |
59 | inline int B_IS_IN_TREE(const struct buffer_head *p_s_bh) | 59 | inline int B_IS_IN_TREE(const struct buffer_head *bh) |
60 | { | 60 | { |
61 | 61 | ||
62 | RFALSE(B_LEVEL(p_s_bh) > MAX_HEIGHT, | 62 | RFALSE(B_LEVEL(bh) > MAX_HEIGHT, |
63 | "PAP-1010: block (%b) has too big level (%z)", p_s_bh, p_s_bh); | 63 | "PAP-1010: block (%b) has too big level (%z)", bh, bh); |
64 | 64 | ||
65 | return (B_LEVEL(p_s_bh) != FREE_LEVEL); | 65 | return (B_LEVEL(bh) != FREE_LEVEL); |
66 | } | 66 | } |
67 | 67 | ||
68 | // | 68 | // |
@@ -579,7 +579,7 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
579 | { | 579 | { |
580 | b_blocknr_t n_block_number; | 580 | b_blocknr_t n_block_number; |
581 | int expected_level; | 581 | int expected_level; |
582 | struct buffer_head *p_s_bh; | 582 | struct buffer_head *bh; |
583 | struct path_element *p_s_last_element; | 583 | struct path_element *p_s_last_element; |
584 | int n_node_level, n_retval; | 584 | int n_node_level, n_retval; |
585 | int right_neighbor_of_leaf_node; | 585 | int right_neighbor_of_leaf_node; |
@@ -626,15 +626,14 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
626 | 626 | ||
627 | /* Read the next tree node, and set the last element in the path to | 627 | /* Read the next tree node, and set the last element in the path to |
628 | have a pointer to it. */ | 628 | have a pointer to it. */ |
629 | if ((p_s_bh = p_s_last_element->pe_buffer = | 629 | if ((bh = p_s_last_element->pe_buffer = |
630 | sb_getblk(sb, n_block_number))) { | 630 | sb_getblk(sb, n_block_number))) { |
631 | if (!buffer_uptodate(p_s_bh) && reada_count > 1) { | 631 | if (!buffer_uptodate(bh) && reada_count > 1) |
632 | search_by_key_reada(sb, reada_bh, | 632 | search_by_key_reada(sb, reada_bh, |
633 | reada_blocks, reada_count); | 633 | reada_blocks, reada_count); |
634 | } | 634 | ll_rw_block(READ, 1, &bh); |
635 | ll_rw_block(READ, 1, &p_s_bh); | 635 | wait_on_buffer(bh); |
636 | wait_on_buffer(p_s_bh); | 636 | if (!buffer_uptodate(bh)) |
637 | if (!buffer_uptodate(p_s_bh)) | ||
638 | goto io_error; | 637 | goto io_error; |
639 | } else { | 638 | } else { |
640 | io_error: | 639 | io_error: |
@@ -651,8 +650,8 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
651 | to search is still in the tree rooted from the current buffer. If | 650 | to search is still in the tree rooted from the current buffer. If |
652 | not then repeat search from the root. */ | 651 | not then repeat search from the root. */ |
653 | if (fs_changed(fs_gen, sb) && | 652 | if (fs_changed(fs_gen, sb) && |
654 | (!B_IS_IN_TREE(p_s_bh) || | 653 | (!B_IS_IN_TREE(bh) || |
655 | B_LEVEL(p_s_bh) != expected_level || | 654 | B_LEVEL(bh) != expected_level || |
656 | !key_in_buffer(p_s_search_path, p_s_key, sb))) { | 655 | !key_in_buffer(p_s_search_path, p_s_key, sb))) { |
657 | PROC_INFO_INC(sb, search_by_key_fs_changed); | 656 | PROC_INFO_INC(sb, search_by_key_fs_changed); |
658 | PROC_INFO_INC(sb, search_by_key_restarted); | 657 | PROC_INFO_INC(sb, search_by_key_restarted); |
@@ -686,25 +685,25 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
686 | 685 | ||
687 | // make sure, that the node contents look like a node of | 686 | // make sure, that the node contents look like a node of |
688 | // certain level | 687 | // certain level |
689 | if (!is_tree_node(p_s_bh, expected_level)) { | 688 | if (!is_tree_node(bh, expected_level)) { |
690 | reiserfs_error(sb, "vs-5150", | 689 | reiserfs_error(sb, "vs-5150", |
691 | "invalid format found in block %ld. " | 690 | "invalid format found in block %ld. " |
692 | "Fsck?", p_s_bh->b_blocknr); | 691 | "Fsck?", bh->b_blocknr); |
693 | pathrelse(p_s_search_path); | 692 | pathrelse(p_s_search_path); |
694 | return IO_ERROR; | 693 | return IO_ERROR; |
695 | } | 694 | } |
696 | 695 | ||
697 | /* ok, we have acquired next formatted node in the tree */ | 696 | /* ok, we have acquired next formatted node in the tree */ |
698 | n_node_level = B_LEVEL(p_s_bh); | 697 | n_node_level = B_LEVEL(bh); |
699 | 698 | ||
700 | PROC_INFO_BH_STAT(sb, p_s_bh, n_node_level - 1); | 699 | PROC_INFO_BH_STAT(sb, bh, n_node_level - 1); |
701 | 700 | ||
702 | RFALSE(n_node_level < n_stop_level, | 701 | RFALSE(n_node_level < n_stop_level, |
703 | "vs-5152: tree level (%d) is less than stop level (%d)", | 702 | "vs-5152: tree level (%d) is less than stop level (%d)", |
704 | n_node_level, n_stop_level); | 703 | n_node_level, n_stop_level); |
705 | 704 | ||
706 | n_retval = bin_search(p_s_key, B_N_PITEM_HEAD(p_s_bh, 0), | 705 | n_retval = bin_search(p_s_key, B_N_PITEM_HEAD(bh, 0), |
707 | B_NR_ITEMS(p_s_bh), | 706 | B_NR_ITEMS(bh), |
708 | (n_node_level == | 707 | (n_node_level == |
709 | DISK_LEAF_NODE_LEVEL) ? IH_SIZE : | 708 | DISK_LEAF_NODE_LEVEL) ? IH_SIZE : |
710 | KEY_SIZE, | 709 | KEY_SIZE, |
@@ -726,13 +725,13 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
726 | an internal node. Now we calculate child block number by | 725 | an internal node. Now we calculate child block number by |
727 | position in the node. */ | 726 | position in the node. */ |
728 | n_block_number = | 727 | n_block_number = |
729 | B_N_CHILD_NUM(p_s_bh, p_s_last_element->pe_position); | 728 | B_N_CHILD_NUM(bh, p_s_last_element->pe_position); |
730 | 729 | ||
731 | /* if we are going to read leaf nodes, try for read ahead as well */ | 730 | /* if we are going to read leaf nodes, try for read ahead as well */ |
732 | if ((p_s_search_path->reada & PATH_READA) && | 731 | if ((p_s_search_path->reada & PATH_READA) && |
733 | n_node_level == DISK_LEAF_NODE_LEVEL + 1) { | 732 | n_node_level == DISK_LEAF_NODE_LEVEL + 1) { |
734 | int pos = p_s_last_element->pe_position; | 733 | int pos = p_s_last_element->pe_position; |
735 | int limit = B_NR_ITEMS(p_s_bh); | 734 | int limit = B_NR_ITEMS(bh); |
736 | struct reiserfs_key *le_key; | 735 | struct reiserfs_key *le_key; |
737 | 736 | ||
738 | if (p_s_search_path->reada & PATH_READA_BACK) | 737 | if (p_s_search_path->reada & PATH_READA_BACK) |
@@ -741,7 +740,7 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
741 | if (pos == limit) | 740 | if (pos == limit) |
742 | break; | 741 | break; |
743 | reada_blocks[reada_count++] = | 742 | reada_blocks[reada_count++] = |
744 | B_N_CHILD_NUM(p_s_bh, pos); | 743 | B_N_CHILD_NUM(bh, pos); |
745 | if (p_s_search_path->reada & PATH_READA_BACK) | 744 | if (p_s_search_path->reada & PATH_READA_BACK) |
746 | pos--; | 745 | pos--; |
747 | else | 746 | else |
@@ -750,7 +749,7 @@ int search_by_key(struct super_block *sb, const struct cpu_key *p_s_key, /* Key | |||
750 | /* | 749 | /* |
751 | * check to make sure we're in the same object | 750 | * check to make sure we're in the same object |
752 | */ | 751 | */ |
753 | le_key = B_N_PDELIM_KEY(p_s_bh, pos); | 752 | le_key = B_N_PDELIM_KEY(bh, pos); |
754 | if (le32_to_cpu(le_key->k_objectid) != | 753 | if (le32_to_cpu(le_key->k_objectid) != |
755 | p_s_key->on_disk_key.k_objectid) { | 754 | p_s_key->on_disk_key.k_objectid) { |
756 | break; | 755 | break; |
@@ -851,15 +850,15 @@ int search_for_position_by_key(struct super_block *sb, /* Pointer to the super b | |||
851 | /* Compare given item and item pointed to by the path. */ | 850 | /* Compare given item and item pointed to by the path. */ |
852 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path) | 851 | int comp_items(const struct item_head *stored_ih, const struct treepath *p_s_path) |
853 | { | 852 | { |
854 | struct buffer_head *p_s_bh; | 853 | struct buffer_head *bh = PATH_PLAST_BUFFER(p_s_path); |
855 | struct item_head *ih; | 854 | struct item_head *ih; |
856 | 855 | ||
857 | /* Last buffer at the path is not in the tree. */ | 856 | /* Last buffer at the path is not in the tree. */ |
858 | if (!B_IS_IN_TREE(p_s_bh = PATH_PLAST_BUFFER(p_s_path))) | 857 | if (!B_IS_IN_TREE(bh)) |
859 | return 1; | 858 | return 1; |
860 | 859 | ||
861 | /* Last path position is invalid. */ | 860 | /* Last path position is invalid. */ |
862 | if (PATH_LAST_POSITION(p_s_path) >= B_NR_ITEMS(p_s_bh)) | 861 | if (PATH_LAST_POSITION(p_s_path) >= B_NR_ITEMS(bh)) |
863 | return 1; | 862 | return 1; |
864 | 863 | ||
865 | /* we need only to know, whether it is the same item */ | 864 | /* we need only to know, whether it is the same item */ |
@@ -959,7 +958,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st | |||
959 | { | 958 | { |
960 | struct super_block *sb = inode->i_sb; | 959 | struct super_block *sb = inode->i_sb; |
961 | struct item_head *p_le_ih = PATH_PITEM_HEAD(p_s_path); | 960 | struct item_head *p_le_ih = PATH_PITEM_HEAD(p_s_path); |
962 | struct buffer_head *p_s_bh = PATH_PLAST_BUFFER(p_s_path); | 961 | struct buffer_head *bh = PATH_PLAST_BUFFER(p_s_path); |
963 | 962 | ||
964 | BUG_ON(!th->t_trans_id); | 963 | BUG_ON(!th->t_trans_id); |
965 | 964 | ||
@@ -1003,7 +1002,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st | |||
1003 | do { | 1002 | do { |
1004 | need_re_search = 0; | 1003 | need_re_search = 0; |
1005 | *p_n_cut_size = 0; | 1004 | *p_n_cut_size = 0; |
1006 | p_s_bh = PATH_PLAST_BUFFER(p_s_path); | 1005 | bh = PATH_PLAST_BUFFER(p_s_path); |
1007 | copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); | 1006 | copy_item_head(&s_ih, PATH_PITEM_HEAD(p_s_path)); |
1008 | pos = I_UNFM_NUM(&s_ih); | 1007 | pos = I_UNFM_NUM(&s_ih); |
1009 | 1008 | ||
@@ -1019,13 +1018,13 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st | |||
1019 | break; | 1018 | break; |
1020 | } | 1019 | } |
1021 | 1020 | ||
1022 | unfm = (__le32 *)B_I_PITEM(p_s_bh, &s_ih) + pos - 1; | 1021 | unfm = (__le32 *)B_I_PITEM(bh, &s_ih) + pos - 1; |
1023 | block = get_block_num(unfm, 0); | 1022 | block = get_block_num(unfm, 0); |
1024 | 1023 | ||
1025 | if (block != 0) { | 1024 | if (block != 0) { |
1026 | reiserfs_prepare_for_journal(sb, p_s_bh, 1); | 1025 | reiserfs_prepare_for_journal(sb, bh, 1); |
1027 | put_block_num(unfm, 0, 0); | 1026 | put_block_num(unfm, 0, 0); |
1028 | journal_mark_dirty (th, sb, p_s_bh); | 1027 | journal_mark_dirty(th, sb, bh); |
1029 | reiserfs_free_block(th, inode, block, 1); | 1028 | reiserfs_free_block(th, inode, block, 1); |
1030 | } | 1029 | } |
1031 | 1030 | ||
@@ -1049,7 +1048,7 @@ static char prepare_for_delete_or_cut(struct reiserfs_transaction_handle *th, st | |||
1049 | /* a trick. If the buffer has been logged, this will do nothing. If | 1048 | /* a trick. If the buffer has been logged, this will do nothing. If |
1050 | ** we've broken the loop without logging it, it will restore the | 1049 | ** we've broken the loop without logging it, it will restore the |
1051 | ** buffer */ | 1050 | ** buffer */ |
1052 | reiserfs_restore_prepared_buffer(sb, p_s_bh); | 1051 | reiserfs_restore_prepared_buffer(sb, bh); |
1053 | } while (need_re_search && | 1052 | } while (need_re_search && |
1054 | search_for_position_by_key(sb, p_s_item_key, p_s_path) == POSITION_FOUND); | 1053 | search_for_position_by_key(sb, p_s_item_key, p_s_path) == POSITION_FOUND); |
1055 | pos_in_item(p_s_path) = pos * UNFM_P_SIZE; | 1054 | pos_in_item(p_s_path) = pos * UNFM_P_SIZE; |