• Home
  • Raw
  • Download

Lines Matching refs:index

136 nilfs_btree_node_get_key(const struct nilfs_btree_node *node, int index)  in nilfs_btree_node_get_key()  argument
138 return le64_to_cpu(*(nilfs_btree_node_dkeys(node) + index)); in nilfs_btree_node_get_key()
142 nilfs_btree_node_set_key(struct nilfs_btree_node *node, int index, __u64 key) in nilfs_btree_node_set_key() argument
144 *(nilfs_btree_node_dkeys(node) + index) = cpu_to_le64(key); in nilfs_btree_node_set_key()
148 nilfs_btree_node_get_ptr(const struct nilfs_btree_node *node, int index, in nilfs_btree_node_get_ptr() argument
151 return le64_to_cpu(*(nilfs_btree_node_dptrs(node, ncmax) + index)); in nilfs_btree_node_get_ptr()
155 nilfs_btree_node_set_ptr(struct nilfs_btree_node *node, int index, __u64 ptr, in nilfs_btree_node_set_ptr() argument
158 *(nilfs_btree_node_dptrs(node, ncmax) + index) = cpu_to_le64(ptr); in nilfs_btree_node_set_ptr()
238 static void nilfs_btree_node_insert(struct nilfs_btree_node *node, int index, in nilfs_btree_node_insert() argument
248 if (index < nchildren) { in nilfs_btree_node_insert()
249 memmove(dkeys + index + 1, dkeys + index, in nilfs_btree_node_insert()
250 (nchildren - index) * sizeof(*dkeys)); in nilfs_btree_node_insert()
251 memmove(dptrs + index + 1, dptrs + index, in nilfs_btree_node_insert()
252 (nchildren - index) * sizeof(*dptrs)); in nilfs_btree_node_insert()
254 dkeys[index] = cpu_to_le64(key); in nilfs_btree_node_insert()
255 dptrs[index] = cpu_to_le64(ptr); in nilfs_btree_node_insert()
261 static void nilfs_btree_node_delete(struct nilfs_btree_node *node, int index, in nilfs_btree_node_delete() argument
272 key = le64_to_cpu(dkeys[index]); in nilfs_btree_node_delete()
273 ptr = le64_to_cpu(dptrs[index]); in nilfs_btree_node_delete()
280 if (index < nchildren - 1) { in nilfs_btree_node_delete()
281 memmove(dkeys + index, dkeys + index + 1, in nilfs_btree_node_delete()
282 (nchildren - index - 1) * sizeof(*dkeys)); in nilfs_btree_node_delete()
283 memmove(dptrs + index, dptrs + index + 1, in nilfs_btree_node_delete()
284 (nchildren - index - 1) * sizeof(*dptrs)); in nilfs_btree_node_delete()
294 int index, low, high, s; in nilfs_btree_node_lookup() local
299 index = 0; in nilfs_btree_node_lookup()
302 index = (low + high) / 2; in nilfs_btree_node_lookup()
303 nkey = nilfs_btree_node_get_key(node, index); in nilfs_btree_node_lookup()
308 low = index + 1; in nilfs_btree_node_lookup()
311 high = index - 1; in nilfs_btree_node_lookup()
318 if (s > 0 && index > 0) in nilfs_btree_node_lookup()
319 index--; in nilfs_btree_node_lookup()
321 index++; in nilfs_btree_node_lookup()
324 *indexp = index; in nilfs_btree_node_lookup()
465 int index; /* current index on the parent node */ member
491 for (n = ra->max_ra_blocks, i = ra->index + 1; in __nilfs_btree_get_block()
543 int level, index, found, ncmax, ret; in nilfs_btree_do_lookup() local
550 found = nilfs_btree_node_lookup(node, key, &index); in nilfs_btree_do_lookup()
551 ptr = nilfs_btree_node_get_ptr(node, index, in nilfs_btree_do_lookup()
554 path[level].bp_index = index; in nilfs_btree_do_lookup()
563 p.index = index; in nilfs_btree_do_lookup()
576 found = nilfs_btree_node_lookup(node, key, &index); in nilfs_btree_do_lookup()
578 index = 0; in nilfs_btree_do_lookup()
579 if (index < ncmax) { in nilfs_btree_do_lookup()
580 ptr = nilfs_btree_node_get_ptr(node, index, ncmax); in nilfs_btree_do_lookup()
586 path[level].bp_index = index; in nilfs_btree_do_lookup()
603 int index, level, ncmax, ret; in nilfs_btree_do_lookup_last() local
606 index = nilfs_btree_node_get_nchildren(node) - 1; in nilfs_btree_do_lookup_last()
607 if (index < 0) in nilfs_btree_do_lookup_last()
610 ptr = nilfs_btree_node_get_ptr(node, index, in nilfs_btree_do_lookup_last()
613 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
623 index = nilfs_btree_node_get_nchildren(node) - 1; in nilfs_btree_do_lookup_last()
624 ptr = nilfs_btree_node_get_ptr(node, index, ncmax); in nilfs_btree_do_lookup_last()
625 path[level].bp_index = index; in nilfs_btree_do_lookup_last()
629 *keyp = nilfs_btree_node_get_key(node, index); in nilfs_btree_do_lookup_last()
652 int index, next_adj, level; in nilfs_btree_get_next_key() local
662 index = path[level].bp_index + next_adj; in nilfs_btree_get_next_key()
663 if (index < nilfs_btree_node_get_nchildren(node)) { in nilfs_btree_get_next_key()
665 *nextkey = nilfs_btree_node_get_key(node, index); in nilfs_btree_get_next_key()
701 int ret, cnt, index, maxlevel, ncmax; in nilfs_btree_lookup_contig() local
725 index = path[level].bp_index + 1; in nilfs_btree_lookup_contig()
727 while (index < nilfs_btree_node_get_nchildren(node)) { in nilfs_btree_lookup_contig()
728 if (nilfs_btree_node_get_key(node, index) != in nilfs_btree_lookup_contig()
731 ptr2 = nilfs_btree_node_get_ptr(node, index, ncmax); in nilfs_btree_lookup_contig()
740 index++; in nilfs_btree_lookup_contig()
748 p.index = path[level + 1].bp_index + 1; in nilfs_btree_lookup_contig()
750 if (p.index >= nilfs_btree_node_get_nchildren(p.node) || in nilfs_btree_lookup_contig()
751 nilfs_btree_node_get_key(p.node, p.index) != key + cnt) in nilfs_btree_lookup_contig()
753 ptr2 = nilfs_btree_node_get_ptr(p.node, p.index, p.ncmax); in nilfs_btree_lookup_contig()
754 path[level + 1].bp_index = p.index; in nilfs_btree_lookup_contig()
765 index = 0; in nilfs_btree_lookup_contig()
766 path[level].bp_index = index; in nilfs_btree_lookup_contig()
2142 pgoff_t index = 0; in nilfs_btree_lookup_dirty_buffers() local
2152 while (pagevec_lookup_tag(&pvec, btcache, &index, in nilfs_btree_lookup_dirty_buffers()