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