Skip to content

Commit 4cf5f7a

Browse files
jeffmahoneyjankara
authored andcommitted
reiserfs: cleanup, rename key and item 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. I've also removed a few unused macros. Checkpatch will complain about the 80 character limit for do_balan.c. I've addressed that in a later patchset to split up balance_leaf(). Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 797d901 commit 4cf5f7a

14 files changed

Lines changed: 284 additions & 239 deletions

File tree

‎fs/reiserfs/bitmap.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,9 @@ static int get_left_neighbor(reiserfs_blocknr_hint_t * hint)
819819
path = hint->path;
820820
bh = get_last_bh(path);
821821
RFALSE(!bh, "green-4002: Illegal path specified to get_left_neighbor");
822-
ih = get_ih(path);
822+
ih = tp_item_head(path);
823823
pos_in_item = path->pos_in_item;
824-
item = get_item(path);
824+
item = tp_item_body(path);
825825

826826
hint->search_start = bh->b_blocknr;
827827

‎fs/reiserfs/dir.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ int reiserfs_readdir_inode(struct inode *inode, struct dir_context *ctx)
110110
item_num, B_NR_ITEMS(bh));
111111

112112
/* and entry must be not more than number of entries in the item */
113-
RFALSE(I_ENTRY_COUNT(ih) < entry_num,
113+
RFALSE(ih_entry_count(ih) < entry_num,
114114
"vs-9010: entry number is too big %d (%d)",
115-
entry_num, I_ENTRY_COUNT(ih));
115+
entry_num, ih_entry_count(ih));
116116

117117
if (search_res == POSITION_FOUND
118-
|| entry_num < I_ENTRY_COUNT(ih)) {
118+
|| entry_num < ih_entry_count(ih)) {
119119
/* go through all entries in the directory item beginning from the entry, that has been found */
120120
struct reiserfs_de_head *deh =
121121
B_I_DEH(bh, ih) + entry_num;
122122

123-
for (; entry_num < I_ENTRY_COUNT(ih);
123+
for (; entry_num < ih_entry_count(ih);
124124
entry_num++, deh++) {
125125
int d_reclen;
126126
char *d_name;

‎fs/reiserfs/do_balan.c‎

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int balance_leaf_when_delete(struct tree_balance *tb, int flag)
114114
RFALSE(!tb->blknum[0] && !PATH_H_PPARENT(tb->tb_path, 0),
115115
"PAP-12010: tree can not be empty");
116116

117-
ih = B_N_PITEM_HEAD(tbS0, item_pos);
117+
ih = item_head(tbS0, item_pos);
118118
buffer_info_init_tbS0(tb, &bi);
119119

120120
/* Delete or truncate the item */
@@ -312,7 +312,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
312312
/* for indirect item pos_in_item is measured in unformatted node
313313
pointers. Recalculate to bytes */
314314
if (flag != M_INSERT
315-
&& is_indirect_le_ih(B_N_PITEM_HEAD(tbS0, item_pos)))
315+
&& is_indirect_le_ih(item_head(tbS0, item_pos)))
316316
pos_in_item *= UNFM_P_SIZE;
317317

318318
if (tb->lnum[0] > 0) {
@@ -378,7 +378,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
378378

379379
if (item_pos == tb->lnum[0] - 1 && tb->lbytes != -1) {
380380
/* we must shift the part of the appended item */
381-
if (is_direntry_le_ih(B_N_PITEM_HEAD(tbS0, item_pos))) {
381+
if (is_direntry_le_ih(item_head(tbS0, item_pos))) {
382382

383383
RFALSE(zeros_num,
384384
"PAP-12090: invalid parameter in case of a directory");
@@ -391,8 +391,8 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
391391
/* Shift lnum[0] - 1 items in whole. Shift lbytes - 1 entries from given directory item */
392392
ret_val = leaf_shift_left(tb, tb->lnum[0], tb->lbytes-1);
393393
if (ret_val && !item_pos) {
394-
pasted = B_N_PITEM_HEAD(tb->L[0], B_NR_ITEMS(tb->L[0]) - 1);
395-
l_pos_in_item += I_ENTRY_COUNT(pasted) - (tb->lbytes -1);
394+
pasted = item_head(tb->L[0], B_NR_ITEMS(tb->L[0]) - 1);
395+
l_pos_in_item += ih_entry_count(pasted) - (tb->lbytes -1);
396396
}
397397

398398
/* Append given directory entry to directory item */
@@ -418,9 +418,9 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
418418
} else {
419419
/* regular object */
420420
RFALSE(tb->lbytes <= 0, "PAP-12095: there is nothing to shift to L[0]. lbytes=%d", tb->lbytes);
421-
RFALSE(pos_in_item != ih_item_len(B_N_PITEM_HEAD(tbS0, item_pos)),
421+
RFALSE(pos_in_item != ih_item_len(item_head(tbS0, item_pos)),
422422
"PAP-12100: incorrect position to paste: item_len=%d, pos_in_item=%d",
423-
ih_item_len(B_N_PITEM_HEAD(tbS0, item_pos)),pos_in_item);
423+
ih_item_len(item_head(tbS0, item_pos)),pos_in_item);
424424

425425
if (tb->lbytes >= pos_in_item) {
426426
/* appended item will be in L[0] in whole */
@@ -436,34 +436,34 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
436436
"PAP-12105: there is nothing to paste into L[0]. insert_size=%d",
437437
tb->insert_size[0]);
438438
ret_val = leaf_shift_left(tb, tb->lnum[0], ih_item_len
439-
(B_N_PITEM_HEAD(tbS0, item_pos)));
439+
(item_head(tbS0, item_pos)));
440440
/* Append to body of item in L[0] */
441441
buffer_info_init_left(tb, &bi);
442442
leaf_paste_in_buffer
443443
(&bi, n + item_pos - ret_val, ih_item_len
444-
(B_N_PITEM_HEAD(tb->L[0], n + item_pos - ret_val)),
444+
(item_head(tb->L[0], n + item_pos - ret_val)),
445445
l_n, body,
446446
zeros_num > l_n ? l_n : zeros_num);
447447
/* 0-th item in S0 can be only of DIRECT type when l_n != 0 */
448448
{
449449
int version;
450450
int temp_l = l_n;
451451

452-
RFALSE(ih_item_len(B_N_PITEM_HEAD(tbS0, 0)),
452+
RFALSE(ih_item_len(item_head(tbS0, 0)),
453453
"PAP-12106: item length must be 0");
454-
RFALSE(comp_short_le_keys(B_N_PKEY(tbS0, 0), B_N_PKEY
454+
RFALSE(comp_short_le_keys(leaf_key(tbS0, 0), leaf_key
455455
(tb->L[0], n + item_pos - ret_val)),
456456
"PAP-12107: items must be of the same file");
457-
if (is_indirect_le_ih(B_N_PITEM_HEAD(tb->L[0], n + item_pos - ret_val))) {
457+
if (is_indirect_le_ih(item_head(tb->L[0], n + item_pos - ret_val))) {
458458
temp_l = l_n << (tb->tb_sb-> s_blocksize_bits - UNFM_P_SHIFT);
459459
}
460460
/* update key of first item in S0 */
461-
version = ih_version(B_N_PITEM_HEAD(tbS0, 0));
462-
set_le_key_k_offset(version, B_N_PKEY(tbS0, 0),
463-
le_key_k_offset(version,B_N_PKEY(tbS0, 0)) + temp_l);
461+
version = ih_version(item_head(tbS0, 0));
462+
set_le_key_k_offset(version, leaf_key(tbS0, 0),
463+
le_key_k_offset(version,leaf_key(tbS0, 0)) + temp_l);
464464
/* update left delimiting key */
465-
set_le_key_k_offset(version, B_N_PDELIM_KEY(tb->CFL[0], tb->lkey[0]),
466-
le_key_k_offset(version, B_N_PDELIM_KEY(tb->CFL[0], tb->lkey[0])) + temp_l);
465+
set_le_key_k_offset(version, internal_key(tb->CFL[0], tb->lkey[0]),
466+
le_key_k_offset(version, internal_key(tb->CFL[0], tb->lkey[0])) + temp_l);
467467
}
468468

469469
/* Calculate new body, position in item and insert_size[0] */
@@ -474,9 +474,9 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
474474
zeros_num -= l_n;
475475
pos_in_item = 0;
476476

477-
RFALSE(comp_short_le_keys(B_N_PKEY(tbS0, 0), B_N_PKEY(tb->L[0], B_NR_ITEMS(tb->L[0]) - 1))
478-
|| !op_is_left_mergeable(B_N_PKEY(tbS0, 0), tbS0->b_size)
479-
|| !op_is_left_mergeable(B_N_PDELIM_KEY(tb->CFL[0], tb->lkey[0]), tbS0->b_size),
477+
RFALSE(comp_short_le_keys(leaf_key(tbS0, 0), leaf_key(tb->L[0], B_NR_ITEMS(tb->L[0]) - 1))
478+
|| !op_is_left_mergeable(leaf_key(tbS0, 0), tbS0->b_size)
479+
|| !op_is_left_mergeable(internal_key(tb->CFL[0], tb->lkey[0]), tbS0->b_size),
480480
"PAP-12120: item must be merge-able with left neighboring item");
481481
} else { /* only part of the appended item will be in L[0] */
482482

@@ -493,9 +493,9 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
493493

494494
struct item_head *pasted;
495495

496-
if (!item_pos && op_is_left_mergeable(B_N_PKEY(tbS0, 0), tbS0->b_size)) { /* if we paste into first item of S[0] and it is left mergable */
496+
if (!item_pos && op_is_left_mergeable(leaf_key(tbS0, 0), tbS0->b_size)) { /* if we paste into first item of S[0] and it is left mergable */
497497
/* then increment pos_in_item by the size of the last item in L[0] */
498-
pasted = B_N_PITEM_HEAD(tb->L[0], n - 1);
498+
pasted = item_head(tb->L[0], n - 1);
499499
if (is_direntry_le_ih(pasted))
500500
pos_in_item += ih_entry_count(pasted);
501501
else
@@ -512,7 +512,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
512512
body, zeros_num);
513513

514514
/* if appended item is directory, paste entry */
515-
pasted = B_N_PITEM_HEAD(tb->L[0], n + item_pos - ret_val);
515+
pasted = item_head(tb->L[0], n + item_pos - ret_val);
516516
if (is_direntry_le_ih(pasted))
517517
leaf_paste_entries(&bi, n + item_pos - ret_val,
518518
pos_in_item, 1,
@@ -617,12 +617,12 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
617617

618618
if (n - tb->rnum[0] <= item_pos) { /* pasted item or part of it falls to R[0] */
619619
if (item_pos == n - tb->rnum[0] && tb->rbytes != -1) { /* we must shift the part of the appended item */
620-
if (is_direntry_le_ih(B_N_PITEM_HEAD(tbS0, item_pos))) { /* we append to directory item */
620+
if (is_direntry_le_ih(item_head(tbS0, item_pos))) { /* we append to directory item */
621621
int entry_count;
622622

623623
RFALSE(zeros_num,
624624
"PAP-12145: invalid parameter in case of a directory");
625-
entry_count = I_ENTRY_COUNT(B_N_PITEM_HEAD
625+
entry_count = ih_entry_count(item_head
626626
(tbS0, item_pos));
627627
if (entry_count - tb->rbytes <
628628
pos_in_item)
@@ -665,10 +665,10 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
665665
n_shift = 0;
666666

667667
RFALSE(pos_in_item != ih_item_len
668-
(B_N_PITEM_HEAD(tbS0, item_pos)),
668+
(item_head(tbS0, item_pos)),
669669
"PAP-12155: invalid position to paste. ih_item_len=%d, pos_in_item=%d",
670670
pos_in_item, ih_item_len
671-
(B_N_PITEM_HEAD(tbS0, item_pos)));
671+
(item_head(tbS0, item_pos)));
672672

673673
leaf_shift_right(tb, tb->rnum[0], n_shift);
674674
/* Calculate number of bytes which must remain in body after appending to R[0] */
@@ -679,17 +679,17 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
679679
int version;
680680
unsigned long temp_rem = n_rem;
681681

682-
version = ih_version(B_N_PITEM_HEAD(tb->R[0], 0));
683-
if (is_indirect_le_key(version, B_N_PKEY(tb->R[0], 0))) {
682+
version = ih_version(item_head(tb->R[0], 0));
683+
if (is_indirect_le_key(version, leaf_key(tb->R[0], 0))) {
684684
temp_rem = n_rem << (tb->tb_sb->s_blocksize_bits - UNFM_P_SHIFT);
685685
}
686-
set_le_key_k_offset(version, B_N_PKEY(tb->R[0], 0),
687-
le_key_k_offset(version, B_N_PKEY(tb->R[0], 0)) + temp_rem);
688-
set_le_key_k_offset(version, B_N_PDELIM_KEY(tb->CFR[0], tb->rkey[0]),
689-
le_key_k_offset(version, B_N_PDELIM_KEY(tb->CFR[0], tb->rkey[0])) + temp_rem);
686+
set_le_key_k_offset(version, leaf_key(tb->R[0], 0),
687+
le_key_k_offset(version, leaf_key(tb->R[0], 0)) + temp_rem);
688+
set_le_key_k_offset(version, internal_key(tb->CFR[0], tb->rkey[0]),
689+
le_key_k_offset(version, internal_key(tb->CFR[0], tb->rkey[0])) + temp_rem);
690690
}
691-
/* k_offset (B_N_PKEY(tb->R[0],0)) += n_rem;
692-
k_offset (B_N_PDELIM_KEY(tb->CFR[0],tb->rkey[0])) += n_rem;*/
691+
/* k_offset (leaf_key(tb->R[0],0)) += n_rem;
692+
k_offset (internal_key(tb->CFR[0],tb->rkey[0])) += n_rem;*/
693693
do_balance_mark_internal_dirty(tb, tb->CFR[0], 0);
694694

695695
/* Append part of body into R[0] */
@@ -707,12 +707,12 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
707707
tb->insert_size[0] - n_rem,
708708
r_body, r_zeros_number);
709709

710-
if (is_indirect_le_ih(B_N_PITEM_HEAD(tb->R[0], 0))) {
710+
if (is_indirect_le_ih(item_head(tb->R[0], 0))) {
711711
#if 0
712712
RFALSE(n_rem,
713713
"PAP-12160: paste more than one unformatted node pointer");
714714
#endif
715-
set_ih_free_space(B_N_PITEM_HEAD(tb->R[0], 0), 0);
715+
set_ih_free_space(item_head(tb->R[0], 0), 0);
716716
}
717717
tb->insert_size[0] = n_rem;
718718
if (!n_rem)
@@ -731,7 +731,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
731731
}
732732

733733
/* paste new entry, if item is directory item */
734-
pasted = B_N_PITEM_HEAD(tb->R[0], item_pos - n + tb->rnum[0]);
734+
pasted = item_head(tb->R[0], item_pos - n + tb->rnum[0]);
735735
if (is_direntry_le_ih(pasted) && pos_in_item >= 0) {
736736
leaf_paste_entries(&bi, item_pos - n + tb->rnum[0],
737737
pos_in_item, 1,
@@ -784,8 +784,8 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
784784
if (!tb->CFR[0])
785785
reiserfs_panic(tb->tb_sb, "vs-12195",
786786
"CFR not initialized");
787-
copy_key(B_N_PDELIM_KEY(tb->CFL[0], tb->lkey[0]),
788-
B_N_PDELIM_KEY(tb->CFR[0], tb->rkey[0]));
787+
copy_key(internal_key(tb->CFL[0], tb->lkey[0]),
788+
internal_key(tb->CFR[0], tb->rkey[0]));
789789
do_balance_mark_internal_dirty(tb, tb->CFL[0], 0);
790790
}
791791

@@ -886,7 +886,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
886886

887887
RFALSE(ih, "PAP-12210: ih must be 0");
888888

889-
aux_ih = B_N_PITEM_HEAD(tbS0, item_pos);
889+
aux_ih = item_head(tbS0, item_pos);
890890
if (is_direntry_le_ih(aux_ih)) {
891891
/* we append to directory item */
892892

@@ -922,7 +922,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
922922
int n_shift, n_rem, r_zeros_number;
923923
const char *r_body;
924924

925-
RFALSE(pos_in_item != ih_item_len(B_N_PITEM_HEAD(tbS0, item_pos)) || tb->insert_size[0] <= 0,
925+
RFALSE(pos_in_item != ih_item_len(item_head(tbS0, item_pos)) || tb->insert_size[0] <= 0,
926926
"PAP-12225: item too short or insert_size <= 0");
927927

928928
/* Calculate number of bytes which must be shifted from appended item */
@@ -952,7 +952,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
952952
{
953953
struct item_head *tmp;
954954

955-
tmp = B_N_PITEM_HEAD(S_new[i], 0);
955+
tmp = item_head(S_new[i], 0);
956956
if (is_indirect_le_ih
957957
(tmp)) {
958958
set_ih_free_space(tmp, 0);
@@ -973,7 +973,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
973973
struct item_head *pasted;
974974

975975
#ifdef CONFIG_REISERFS_CHECK
976-
struct item_head *ih_check = B_N_PITEM_HEAD(tbS0, item_pos);
976+
struct item_head *ih_check = item_head(tbS0, item_pos);
977977

978978
if (!is_direntry_le_ih(ih_check)
979979
&& (pos_in_item != ih_item_len(ih_check)
@@ -1002,7 +1002,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
10021002
tb->insert_size[0],
10031003
body, zeros_num);
10041004

1005-
pasted = B_N_PITEM_HEAD(S_new[i], item_pos - n + snum[i]);
1005+
pasted = item_head(S_new[i], item_pos - n + snum[i]);
10061006
if (is_direntry_le_ih(pasted)) {
10071007
leaf_paste_entries(&bi,
10081008
item_pos - n + snum[i],
@@ -1032,7 +1032,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
10321032
(flag == M_DELETE) ? "DELETE" : ((flag == M_CUT) ? "CUT" : "UNKNOWN"), flag);
10331033
}
10341034

1035-
memcpy(insert_key + i, B_N_PKEY(S_new[i], 0), KEY_SIZE);
1035+
memcpy(insert_key + i, leaf_key(S_new[i], 0), KEY_SIZE);
10361036
insert_ptr[i] = S_new[i];
10371037

10381038
RFALSE(!buffer_journaled(S_new[i])
@@ -1061,7 +1061,7 @@ static int balance_leaf(struct tree_balance *tb, struct item_head *ih, /* item h
10611061
case M_PASTE:{ /* append item in S[0] */
10621062
struct item_head *pasted;
10631063

1064-
pasted = B_N_PITEM_HEAD(tbS0, item_pos);
1064+
pasted = item_head(tbS0, item_pos);
10651065
/* when directory, may be new entry already pasted */
10661066
if (is_direntry_le_ih(pasted)) {
10671067
if (pos_in_item >= 0 && pos_in_item <= ih_entry_count(pasted)) {
@@ -1246,10 +1246,10 @@ void replace_key(struct tree_balance *tb, struct buffer_head *dest, int n_dest,
12461246

12471247
if (B_IS_ITEMS_LEVEL(src))
12481248
/* source buffer contains leaf node */
1249-
memcpy(B_N_PDELIM_KEY(dest, n_dest), B_N_PITEM_HEAD(src, n_src),
1249+
memcpy(internal_key(dest, n_dest), item_head(src, n_src),
12501250
KEY_SIZE);
12511251
else
1252-
memcpy(B_N_PDELIM_KEY(dest, n_dest), B_N_PDELIM_KEY(src, n_src),
1252+
memcpy(internal_key(dest, n_dest), internal_key(src, n_src),
12531253
KEY_SIZE);
12541254

12551255
do_balance_mark_internal_dirty(tb, dest, 0);

‎fs/reiserfs/fix_node.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
105105
vn->vn_free_ptr += vn->vn_nr_item * sizeof(struct virtual_item);
106106

107107
/* first item in the node */
108-
ih = B_N_PITEM_HEAD(Sh, 0);
108+
ih = item_head(Sh, 0);
109109

110110
/* define the mergeability for 0-th item (if it is not being deleted) */
111111
if (op_is_left_mergeable(&(ih->ih_key), Sh->b_size)
@@ -128,7 +128,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
128128

129129
vi->vi_item_len += ih_item_len(ih + j) + IH_SIZE;
130130
vi->vi_ih = ih + j;
131-
vi->vi_item = B_I_PITEM(Sh, ih + j);
131+
vi->vi_item = ih_item_body(Sh, ih + j);
132132
vi->vi_uarea = vn->vn_free_ptr;
133133

134134
// FIXME: there is no check, that item operation did not
@@ -168,7 +168,7 @@ static void create_virtual_node(struct tree_balance *tb, int h)
168168
if (tb->CFR[0]) {
169169
struct reiserfs_key *key;
170170

171-
key = B_N_PDELIM_KEY(tb->CFR[0], tb->rkey[0]);
171+
key = internal_key(tb->CFR[0], tb->rkey[0]);
172172
if (op_is_left_mergeable(key, Sh->b_size)
173173
&& (vn->vn_mode != M_DELETE
174174
|| vn->vn_affected_item_num != B_NR_ITEMS(Sh) - 1))
@@ -182,8 +182,8 @@ static void create_virtual_node(struct tree_balance *tb, int h)
182182
/* we delete last item and it could be merged with right neighbor's first item */
183183
if (!
184184
(B_NR_ITEMS(Sh) == 1
185-
&& is_direntry_le_ih(B_N_PITEM_HEAD(Sh, 0))
186-
&& I_ENTRY_COUNT(B_N_PITEM_HEAD(Sh, 0)) == 1)) {
185+
&& is_direntry_le_ih(item_head(Sh, 0))
186+
&& ih_entry_count(item_head(Sh, 0)) == 1)) {
187187
/* node contains more than 1 item, or item is not directory item, or this item contains more than 1 entry */
188188
print_block(Sh, 0, -1, -1);
189189
reiserfs_panic(tb->tb_sb, "vs-8045",
@@ -675,10 +675,10 @@ static int are_leaves_removable(struct tree_balance *tb, int lfree, int rfree)
675675
"vs-8125: item number must be 1: it is %d",
676676
B_NR_ITEMS(S0));
677677

678-
ih = B_N_PITEM_HEAD(S0, 0);
678+
ih = item_head(S0, 0);
679679
if (tb->CFR[0]
680680
&& !comp_short_le_keys(&(ih->ih_key),
681-
B_N_PDELIM_KEY(tb->CFR[0],
681+
internal_key(tb->CFR[0],
682682
tb->rkey[0])))
683683
if (is_direntry_le_ih(ih)) {
684684
/* Directory must be in correct state here: that is
@@ -1036,7 +1036,7 @@ static int get_far_parent(struct tree_balance *tb,
10361036

10371037
/* Form key to get parent of the left/right neighbor. */
10381038
le_key2cpu_key(&s_lr_father_key,
1039-
B_N_PDELIM_KEY(*pcom_father,
1039+
internal_key(*pcom_father,
10401040
(c_lr_par ==
10411041
LEFT_PARENTS) ? (tb->lkey[h - 1] =
10421042
position -
@@ -1175,9 +1175,9 @@ static inline int can_node_be_removed(int mode, int lfree, int sfree, int rfree,
11751175
struct item_head *ih;
11761176
struct reiserfs_key *r_key = NULL;
11771177

1178-
ih = B_N_PITEM_HEAD(Sh, 0);
1178+
ih = item_head(Sh, 0);
11791179
if (tb->CFR[h])
1180-
r_key = B_N_PDELIM_KEY(tb->CFR[h], tb->rkey[h]);
1180+
r_key = internal_key(tb->CFR[h], tb->rkey[h]);
11811181

11821182
if (lfree + rfree + sfree < MAX_CHILD_SIZE(Sh) + levbytes
11831183
/* shifting may merge items which might save space */

0 commit comments

Comments
 (0)