Lines Matching refs:ih
26 struct item_head *ih; in leaf_copy_dir_entries() local
31 ih = item_head(source, item_num); in leaf_copy_dir_entries()
33 RFALSE(!is_direntry_le_ih(ih), "vs-10000: item must be directory item"); in leaf_copy_dir_entries()
39 deh = B_I_DEH(source, ih); in leaf_copy_dir_entries()
42 ih_item_len(ih)) - in leaf_copy_dir_entries()
45 source->b_data + ih_location(ih) + in leaf_copy_dir_entries()
63 (last_first == FIRST_TO_LAST && le_ih_k_offset(ih) == DOT_OFFSET) || in leaf_copy_dir_entries()
65 && comp_short_le_keys /*COMP_SHORT_KEYS */ (&ih->ih_key, in leaf_copy_dir_entries()
73 memcpy(&new_ih.ih_key, &ih->ih_key, KEY_SIZE); in leaf_copy_dir_entries()
82 if (from < ih_entry_count(ih)) { in leaf_copy_dir_entries()
141 struct item_head *ih; in leaf_copy_boundary_item() local
153 ih = item_head(src, 0); in leaf_copy_boundary_item()
158 || (!op_is_left_mergeable(&ih->ih_key, src->b_size))) in leaf_copy_boundary_item()
161 RFALSE(!ih_item_len(ih), in leaf_copy_boundary_item()
164 if (is_direntry_le_ih(ih)) { in leaf_copy_boundary_item()
167 bytes_or_entries = ih_entry_count(ih); in leaf_copy_boundary_item()
180 bytes_or_entries = ih_item_len(ih); in leaf_copy_boundary_item()
184 if (bytes_or_entries == ih_item_len(ih) in leaf_copy_boundary_item()
185 && is_indirect_le_ih(ih)) in leaf_copy_boundary_item()
186 if (get_ih_free_space(ih)) in leaf_copy_boundary_item()
191 "entirely (%h)", ih); in leaf_copy_boundary_item()
201 bytes_or_entries, ih_item_body(src, ih), 0); in leaf_copy_boundary_item()
206 ih); in leaf_copy_boundary_item()
207 if (bytes_or_entries == ih_item_len(ih)) in leaf_copy_boundary_item()
208 set_ih_free_space(dih, get_ih_free_space(ih)); in leaf_copy_boundary_item()
221 ih = item_head(src, src_nr_item - 1); in leaf_copy_boundary_item()
227 if (is_direntry_le_ih(ih)) { in leaf_copy_boundary_item()
233 bytes_or_entries = ih_entry_count(ih); in leaf_copy_boundary_item()
237 ih_entry_count(ih) - bytes_or_entries, in leaf_copy_boundary_item()
249 RFALSE(is_indirect_le_ih(ih) && get_ih_free_space(ih), in leaf_copy_boundary_item()
251 ih); in leaf_copy_boundary_item()
255 bytes_or_entries = ih_item_len(ih); in leaf_copy_boundary_item()
258 le_ih_k_offset(ih) + op_bytes_number(ih, src->b_size), in leaf_copy_boundary_item()
259 "vs-10050: items %h and %h do not match", ih, dih); in leaf_copy_boundary_item()
262 set_le_ih_k_offset(dih, le_ih_k_offset(ih)); in leaf_copy_boundary_item()
266 set_le_ih_k_type(dih, le_ih_k_type(ih)); in leaf_copy_boundary_item()
269 RFALSE(ih_item_len(ih) <= bytes_or_entries, in leaf_copy_boundary_item()
271 (unsigned long)ih_item_len(ih), in leaf_copy_boundary_item()
298 ih) + ih_item_len(ih) - bytes_or_entries, in leaf_copy_boundary_item()
320 struct item_head *ih; in leaf_copy_items_entirely() local
348 ih = item_head(dest, dest_before); in leaf_copy_items_entirely()
355 memmove(ih + cpy_num, ih, (nr - dest_before) * IH_SIZE); in leaf_copy_items_entirely()
358 memcpy(ih, item_head(src, first), cpy_num * IH_SIZE); in leaf_copy_items_entirely()
364 j = location = (dest_before == 0) ? dest->b_size : ih_location(ih - 1); in leaf_copy_items_entirely()
366 location -= ih_item_len(ih + i - dest_before); in leaf_copy_items_entirely()
367 put_ih_location(ih + i - dest_before, location); in leaf_copy_items_entirely()
371 last_loc = ih_location(&ih[nr + cpy_num - 1 - dest_before]); in leaf_copy_items_entirely()
372 last_inserted_loc = ih_location(&ih[cpy_num - 1]); in leaf_copy_items_entirely()
419 struct item_head *ih; in leaf_item_bottle() local
429 ih = item_head(src, item_num); in leaf_item_bottle()
430 if (is_direntry_le_ih(ih)) in leaf_item_bottle()
442 memcpy(&n_ih, ih, IH_SIZE); in leaf_item_bottle()
444 if (is_indirect_le_ih(ih)) { in leaf_item_bottle()
445 RFALSE(cpy_bytes == ih_item_len(ih) in leaf_item_bottle()
446 && get_ih_free_space(ih), in leaf_item_bottle()
448 (long unsigned)get_ih_free_space(ih)); in leaf_item_bottle()
452 RFALSE(op_is_left_mergeable(&ih->ih_key, src->b_size), in leaf_item_bottle()
453 "vs-10190: bad mergeability of item %h", ih); in leaf_item_bottle()
454 n_ih.ih_version = ih->ih_version; /* JDM Endian safe, both le */ in leaf_item_bottle()
463 ih = item_head(src, item_num); in leaf_item_bottle()
464 if (is_direntry_le_ih(ih)) in leaf_item_bottle()
467 ih_entry_count(ih) - cpy_bytes, in leaf_item_bottle()
478 memcpy(&n_ih.ih_key, &ih->ih_key, KEY_SIZE); in leaf_item_bottle()
481 n_ih.ih_version = ih->ih_version; in leaf_item_bottle()
483 if (is_direct_le_ih(ih)) { in leaf_item_bottle()
485 le_ih_k_offset(ih) + in leaf_item_bottle()
486 ih_item_len(ih) - cpy_bytes); in leaf_item_bottle()
491 RFALSE(!cpy_bytes && get_ih_free_space(ih), in leaf_item_bottle()
494 le_ih_k_offset(ih) + in leaf_item_bottle()
495 (ih_item_len(ih) - in leaf_item_bottle()
499 set_ih_free_space(&n_ih, get_ih_free_space(ih)); in leaf_item_bottle()
506 n_ih.ih_version = ih->ih_version; in leaf_item_bottle()
510 ih_item_len(ih) - cpy_bytes, 0); in leaf_item_bottle()
868 struct item_head *ih; in leaf_delete_items() local
878 ih = item_head(bh, B_NR_ITEMS(bh) - 1); in leaf_delete_items()
879 if (is_direntry_le_ih(ih)) in leaf_delete_items()
885 len = ih_entry_count(ih); in leaf_delete_items()
888 len = ih_item_len(ih); in leaf_delete_items()
909 struct item_head *ih; in leaf_insert_into_buf() local
927 ih = item_head(bh, before); in leaf_insert_into_buf()
930 last_loc = nr ? ih_location(&ih[nr - before - 1]) : bh->b_size; in leaf_insert_into_buf()
931 unmoved_loc = before ? ih_location(ih - 1) : bh->b_size; in leaf_insert_into_buf()
948 memmove(ih + 1, ih, IH_SIZE * (nr - before)); in leaf_insert_into_buf()
949 memmove(ih, inserted_item_ih, IH_SIZE); in leaf_insert_into_buf()
953 unmoved_loc -= ih_item_len(&ih[i - before]); in leaf_insert_into_buf()
954 put_ih_location(&ih[i - before], unmoved_loc); in leaf_insert_into_buf()
985 struct item_head *ih; in leaf_paste_in_buffer() local
1011 ih = item_head(bh, affected_item_num); in leaf_paste_in_buffer()
1013 last_loc = ih_location(&ih[nr - affected_item_num - 1]); in leaf_paste_in_buffer()
1014 unmoved_loc = affected_item_num ? ih_location(ih - 1) : bh->b_size; in leaf_paste_in_buffer()
1022 put_ih_location(&ih[i - affected_item_num], in leaf_paste_in_buffer()
1023 ih_location(&ih[i - affected_item_num]) - in leaf_paste_in_buffer()
1027 if (!is_direntry_le_ih(ih)) { in leaf_paste_in_buffer()
1030 memmove(bh->b_data + ih_location(ih) + in leaf_paste_in_buffer()
1032 bh->b_data + ih_location(ih), in leaf_paste_in_buffer()
1033 ih_item_len(ih)); in leaf_paste_in_buffer()
1035 memset(bh->b_data + ih_location(ih), 0, in leaf_paste_in_buffer()
1037 memcpy(bh->b_data + ih_location(ih) + in leaf_paste_in_buffer()
1051 put_ih_item_len(ih, ih_item_len(ih) + paste_size); in leaf_paste_in_buffer()
1073 struct item_head *ih, int from, int del_count) in leaf_cut_entries() argument
1086 RFALSE(!is_direntry_le_ih(ih), "10180: item is not directory item"); in leaf_cut_entries()
1087 RFALSE(ih_entry_count(ih) < from + del_count, in leaf_cut_entries()
1089 ih_entry_count(ih), from, del_count); in leaf_cut_entries()
1095 item = bh->b_data + ih_location(ih); in leaf_cut_entries()
1098 deh = B_I_DEH(bh, ih); in leaf_cut_entries()
1105 (from ? deh_location(&deh[from - 1]) : ih_item_len(ih)); in leaf_cut_entries()
1111 for (i = ih_entry_count(ih) - 1; i > from + del_count - 1; i--) in leaf_cut_entries()
1121 put_ih_entry_count(ih, ih_entry_count(ih) - del_count); in leaf_cut_entries()
1131 prev_record, item + ih_item_len(ih) - prev_record); in leaf_cut_entries()
1151 struct item_head *ih; in leaf_cut_from_buffer() local
1159 ih = item_head(bh, cut_item_num); in leaf_cut_from_buffer()
1161 if (is_direntry_le_ih(ih)) { in leaf_cut_from_buffer()
1163 cut_size = leaf_cut_entries(bh, ih, pos_in_item, cut_size); in leaf_cut_from_buffer()
1170 set_le_ih_k_offset(ih, deh_offset(B_I_DEH(bh, ih))); in leaf_cut_from_buffer()
1174 RFALSE(is_statdata_le_ih(ih), "10195: item is stat data"); in leaf_cut_from_buffer()
1175 RFALSE(pos_in_item && pos_in_item + cut_size != ih_item_len(ih), in leaf_cut_from_buffer()
1178 (long unsigned)ih_item_len(ih)); in leaf_cut_from_buffer()
1182 memmove(bh->b_data + ih_location(ih), in leaf_cut_from_buffer()
1183 bh->b_data + ih_location(ih) + cut_size, in leaf_cut_from_buffer()
1184 ih_item_len(ih) - cut_size); in leaf_cut_from_buffer()
1187 if (is_direct_le_ih(ih)) in leaf_cut_from_buffer()
1188 set_le_ih_k_offset(ih, in leaf_cut_from_buffer()
1189 le_ih_k_offset(ih) + in leaf_cut_from_buffer()
1192 set_le_ih_k_offset(ih, in leaf_cut_from_buffer()
1193 le_ih_k_offset(ih) + in leaf_cut_from_buffer()
1196 RFALSE(ih_item_len(ih) == cut_size in leaf_cut_from_buffer()
1197 && get_ih_free_space(ih), in leaf_cut_from_buffer()
1198 "10205: invalid ih_free_space (%h)", ih); in leaf_cut_from_buffer()
1204 last_loc = ih_location(&ih[nr - cut_item_num - 1]); in leaf_cut_from_buffer()
1207 unmoved_loc = cut_item_num ? ih_location(ih - 1) : bh->b_size; in leaf_cut_from_buffer()
1214 put_ih_item_len(ih, ih_item_len(ih) - cut_size); in leaf_cut_from_buffer()
1216 if (is_indirect_le_ih(ih)) { in leaf_cut_from_buffer()
1218 set_ih_free_space(ih, 0); in leaf_cut_from_buffer()
1223 put_ih_location(&ih[i - cut_item_num], in leaf_cut_from_buffer()
1224 ih_location(&ih[i - cut_item_num]) + cut_size); in leaf_cut_from_buffer()
1248 struct item_head *ih; in leaf_delete_items_entirely() local
1271 ih = item_head(bh, first); in leaf_delete_items_entirely()
1274 j = (first == 0) ? bh->b_size : ih_location(ih - 1); in leaf_delete_items_entirely()
1277 last_loc = ih_location(&ih[nr - 1 - first]); in leaf_delete_items_entirely()
1278 last_removed_loc = ih_location(&ih[del_num - 1]); in leaf_delete_items_entirely()
1284 memmove(ih, ih + del_num, (nr - first - del_num) * IH_SIZE); in leaf_delete_items_entirely()
1288 put_ih_location(&ih[i - first], in leaf_delete_items_entirely()
1289 ih_location(&ih[i - first]) + (j - in leaf_delete_items_entirely()
1321 struct item_head *ih; in leaf_paste_entries() local
1331 ih = item_head(bh, item_num); in leaf_paste_entries()
1337 RFALSE(!is_direntry_le_ih(ih), "10225: item is not directory item"); in leaf_paste_entries()
1338 RFALSE(ih_entry_count(ih) < before, in leaf_paste_entries()
1340 ih_entry_count(ih), before); in leaf_paste_entries()
1343 item = bh->b_data + ih_location(ih); in leaf_paste_entries()
1346 deh = B_I_DEH(bh, ih); in leaf_paste_entries()
1352 : (ih_item_len(ih) - paste_size)); in leaf_paste_entries()
1355 for (i = ih_entry_count(ih) - 1; i >= before; i--) in leaf_paste_entries()
1365 put_ih_entry_count(ih, ih_entry_count(ih) + new_entry_count); in leaf_paste_entries()
1369 item + (ih_item_len(ih) - paste_size) - insert_point); in leaf_paste_entries()
1396 set_le_ih_k_offset(ih, deh_offset(new_dehs)); in leaf_paste_entries()
1402 deh = B_I_DEH(bh, ih); in leaf_paste_entries()
1403 for (i = 0; i < ih_entry_count(ih); i++) { in leaf_paste_entries()
1406 ih_entry_count(ih) - in leaf_paste_entries()
1415 ih, deh + i - 1, i, deh + i); in leaf_paste_entries()
1421 ih, i, deh + i, deh + i + 1); in leaf_paste_entries()