cleanup: rename key and item_head accessors to more friendly names

This patch does a quick search and replace:
B_N_PITEM_HEAD() -> item_head()
B_N_PDELIM_KEY() -> internal_key()
B_N_PKEY() -> leaf_key()
B_N_PITEM() -> item_body()

And the item_head version:
B_I_PITEM() -> ih_item_body()
I_ENTRY_COUNT() -> ih_entry_count()

And the treepath variants:
get_ih() -> tp_item_head()
PATH_PITEM_HEAD() -> tp_item_head()
get_item() -> tp_item_body()

... which makes the code much easier on the eyes.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2013-08-26 17:15:33 -04:00
1 parent 290bb8c378
commit c1ff1d5d2d
28 files changed
+354 -355

No files matched your search

+8 -8
View File
@@ -79,7 +79,7 @@ void do_recover(reiserfs_filsys_t fs)
printf("working with block %lu..\n", block);
ih = B_N_PITEM_HEAD(bh, 0);
ih = item_head(bh, 0);
for (i = 0; i < node_item_number(bh); i++, ih++) {
__u32 *indirect;
struct buffer_head *tmp_bh;
@@ -89,7 +89,7 @@ void do_recover(reiserfs_filsys_t fs)
|| key.k_objectid != ih->ih_key.k_objectid)
continue;
indirect = (__u32 *) B_I_PITEM(bh, ih);
indirect = (__u32 *) ih_item_body(bh, ih);
for (j = 0; j < I_UNFM_NUM(ih); j++) {
block = le32_to_cpu(indirect[j]);
if (!block)
@@ -308,7 +308,7 @@ static void recover_items(FILE * fp, reiserfs_filsys_t *fs, FILE * target_file)
if (i == map_size / sizeof(struct saved_item)) {
if (start != -1) {
reiserfs_print_item(stdout, bh,
B_N_PITEM_HEAD(bh,
item_head(bh,
(cur -
1)->
si_item_num));
@@ -341,7 +341,7 @@ static void recover_items(FILE * fp, reiserfs_filsys_t *fs, FILE * target_file)
printf("Problem item %d:\n", i - start - 1);
reiserfs_print_item(stdout, bh,
B_N_PITEM_HEAD(bh,
item_head(bh,
(cur -
1)->
si_item_num));
@@ -349,7 +349,7 @@ static void recover_items(FILE * fp, reiserfs_filsys_t *fs, FILE * target_file)
/* problem interval finished */
printf("Problem item %d:\n", i - start - 1);
reiserfs_print_item(stdout, bh,
B_N_PITEM_HEAD(bh,
item_head(bh,
(cur -
1)->
si_item_num));
@@ -377,15 +377,15 @@ static void recover_items(FILE * fp, reiserfs_filsys_t *fs, FILE * target_file)
fseek(target_file,
get_offset(&(map + result)->si_ih.ih_key) - 1, SEEK_SET);
ih = B_N_PITEM_HEAD(bh, (map + result)->si_item_num);
ih = item_head(bh, (map + result)->si_item_num);
if (is_direct_ih(ih)) {
fwrite(B_I_PITEM(bh, ih),
fwrite(ih_item_body(bh, ih),
(map + result)->si_ih.ih2_item_len, 1,
target_file);
} else if (is_indirect_ih(ih)) {
for (j = 0; j < I_UNFM_NUM(ih); j++) {
unfm_ptr =
d32_get((__u32 *) B_I_PITEM(bh, ih), j);
d32_get((__u32 *) ih_item_body(bh, ih), j);
if (!unfm_ptr) {
fseek(target_file, fs->fs_blocksize,
SEEK_CUR);