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

+3 -3
View File
@@ -214,7 +214,7 @@ struct reiserfs_key *get_lkey(struct reiserfs_path *p_s_chk_path,
return &MAX_KEY;
/* Return delimiting key if position in the parent is not equal to zero. */
if (n_position)
return B_N_PDELIM_KEY(p_s_parent, n_position - 1);
return internal_key(p_s_parent, n_position - 1);
}
/* Return MIN_KEY if we are in the root of the buffer tree. */
if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)->
@@ -252,7 +252,7 @@ struct reiserfs_key *get_rkey(struct reiserfs_path *p_s_chk_path,
return &MIN_KEY;
/* Return delimiting key if position in the parent is not the last one. */
if (n_position != B_NR_ITEMS(p_s_parent))
return B_N_PDELIM_KEY(p_s_parent, n_position);
return internal_key(p_s_parent, n_position);
}
/* Return MAX_KEY if we are in the root of the buffer tree. */
if (PATH_OFFSET_PBUFFER(p_s_chk_path, FIRST_PATH_ELEMENT_OFFSET)->
@@ -379,7 +379,7 @@ int search_by_key(reiserfs_filsys_t *fs, struct reiserfs_key *p_s_key, /* Key to
/* ok, we have acquired next formatted node in the tree */
n_retval =
bin_search(p_s_key, B_N_PITEM_HEAD(p_s_bh, 0),
bin_search(p_s_key, item_head(p_s_bh, 0),
B_NR_ITEMS(p_s_bh),
is_leaf_node(p_s_bh) ? IH_SIZE : KEY_SIZE,
&(p_s_last_element->pe_position));