Lines Matching refs:index

27  * run_lookup - Lookup the index of a MCB entry that is first <= vcn.
30 * @index parameter to index of entry been found.
31 * Case of entry missing from list 'index' will be set to
34 static bool run_lookup(const struct runs_tree *run, CLST vcn, size_t *index)
40 *index = 0;
50 *index = 0;
55 *index = 0;
61 *index = run->count;
66 *index = max_idx;
81 *index = mid_idx;
86 *index = max_idx + 1;
93 static void run_consolidate(struct runs_tree *run, size_t index)
96 struct ntfs_run *r = run->runs + index;
98 while (index + 1 < run->count) {
114 * If range at index overlaps with next one
134 index += 1;
154 i = run->count - (index + 1);
193 CLST *len, size_t *index)
219 if (index)
220 *index = idx;
230 size_t index;
233 if (run_lookup(run, vcn, &index)) {
234 r = run->runs + index;
245 if (!index)
249 memmove(r, r + index, sizeof(*r) * (run->count - index));
251 run->count -= index;
265 size_t index;
273 if (run_lookup(run, vcn, &index)) {
274 struct ntfs_run *r = run->runs + index;
279 index += 1;
283 * At this point 'index' is set to position that
284 * should be thrown away (including index itself)
287 run->count = index;
290 if (!index) {
319 size_t used, index;
331 inrange = run_lookup(run, vcn, &index);
340 if (!inrange && index > 0) {
341 struct ntfs_run *t = run->runs + index - 1;
347 index -= 1;
352 * At this point 'index' either points to the range
361 * Insert at position 'index'
394 r = new_ptr + index;
396 index * sizeof(struct ntfs_run));
397 memcpy(r + 1, run->runs + index,
398 sizeof(struct ntfs_run) * (run->count - index));
405 size_t i = run->count - index;
407 r = run->runs + index;
419 r = run->runs + index;
446 index += 1;
466 * that 'index' points to.
468 if (inrange && index > 0)
469 index -= 1;
470 run_consolidate(run, index);
471 run_consolidate(run, index + 1);
491 size_t index, eat;
495 if (WARN_ON(!run_lookup(run, vcn, &index)))
499 r = run->runs + index;
557 size_t index;
560 if (WARN_ON(!run_lookup(run, vcn, &index)))
564 r = run->runs + index;
572 r = run->runs + index;
593 * run_get_entry - Return index-th mapped region.
595 bool run_get_entry(const struct runs_tree *run, size_t index, CLST *vcn,
600 if (index >= run->count)
603 r = run->runs + index;
1056 size_t index;
1073 for (ok = run_lookup_entry(run, vcn, &lcn, &len, &index);
1075 ok = run_get_entry(run, ++index, &vcn, &lcn, &len)) {