Lines Matching refs:node
84 static int nilfs_btree_node_get_flags(const struct nilfs_btree_node *node) in nilfs_btree_node_get_flags() argument
86 return node->bn_flags; in nilfs_btree_node_get_flags()
90 nilfs_btree_node_set_flags(struct nilfs_btree_node *node, int flags) in nilfs_btree_node_set_flags() argument
92 node->bn_flags = flags; in nilfs_btree_node_set_flags()
95 static int nilfs_btree_node_root(const struct nilfs_btree_node *node) in nilfs_btree_node_root() argument
97 return nilfs_btree_node_get_flags(node) & NILFS_BTREE_NODE_ROOT; in nilfs_btree_node_root()
100 static int nilfs_btree_node_get_level(const struct nilfs_btree_node *node) in nilfs_btree_node_get_level() argument
102 return node->bn_level; in nilfs_btree_node_get_level()
106 nilfs_btree_node_set_level(struct nilfs_btree_node *node, int level) in nilfs_btree_node_set_level() argument
108 node->bn_level = level; in nilfs_btree_node_set_level()
111 static int nilfs_btree_node_get_nchildren(const struct nilfs_btree_node *node) in nilfs_btree_node_get_nchildren() argument
113 return le16_to_cpu(node->bn_nchildren); in nilfs_btree_node_get_nchildren()
117 nilfs_btree_node_set_nchildren(struct nilfs_btree_node *node, int nchildren) in nilfs_btree_node_set_nchildren() argument
119 node->bn_nchildren = cpu_to_le16(nchildren); in nilfs_btree_node_set_nchildren()
133 nilfs_btree_node_dkeys(const struct nilfs_btree_node *node) in nilfs_btree_node_dkeys() argument
135 return (__le64 *)((char *)(node + 1) + in nilfs_btree_node_dkeys()
136 (nilfs_btree_node_root(node) ? in nilfs_btree_node_dkeys()
141 nilfs_btree_node_dptrs(const struct nilfs_btree_node *node, int ncmax) in nilfs_btree_node_dptrs() argument
143 return (__le64 *)(nilfs_btree_node_dkeys(node) + ncmax); in nilfs_btree_node_dptrs()
147 nilfs_btree_node_get_key(const struct nilfs_btree_node *node, int index) in nilfs_btree_node_get_key() argument
149 return le64_to_cpu(*(nilfs_btree_node_dkeys(node) + index)); in nilfs_btree_node_get_key()
153 nilfs_btree_node_set_key(struct nilfs_btree_node *node, int index, __u64 key) in nilfs_btree_node_set_key() argument
155 *(nilfs_btree_node_dkeys(node) + index) = cpu_to_le64(key); in nilfs_btree_node_set_key()
159 nilfs_btree_node_get_ptr(const struct nilfs_btree_node *node, int index, in nilfs_btree_node_get_ptr() argument
162 return le64_to_cpu(*(nilfs_btree_node_dptrs(node, ncmax) + index)); in nilfs_btree_node_get_ptr()
166 nilfs_btree_node_set_ptr(struct nilfs_btree_node *node, int index, __u64 ptr, in nilfs_btree_node_set_ptr() argument
169 *(nilfs_btree_node_dptrs(node, ncmax) + index) = cpu_to_le64(ptr); in nilfs_btree_node_set_ptr()
172 static void nilfs_btree_node_init(struct nilfs_btree_node *node, int flags, in nilfs_btree_node_init() argument
180 nilfs_btree_node_set_flags(node, flags); in nilfs_btree_node_init()
181 nilfs_btree_node_set_level(node, level); in nilfs_btree_node_init()
182 nilfs_btree_node_set_nchildren(node, nchildren); in nilfs_btree_node_init()
184 dkeys = nilfs_btree_node_dkeys(node); in nilfs_btree_node_init()
185 dptrs = nilfs_btree_node_dptrs(node, ncmax); in nilfs_btree_node_init()
249 static void nilfs_btree_node_insert(struct nilfs_btree_node *node, int index, in nilfs_btree_node_insert() argument
256 dkeys = nilfs_btree_node_dkeys(node); in nilfs_btree_node_insert()
257 dptrs = nilfs_btree_node_dptrs(node, ncmax); in nilfs_btree_node_insert()
258 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_node_insert()
268 nilfs_btree_node_set_nchildren(node, nchildren); in nilfs_btree_node_insert()
272 static void nilfs_btree_node_delete(struct nilfs_btree_node *node, int index, in nilfs_btree_node_delete() argument
281 dkeys = nilfs_btree_node_dkeys(node); in nilfs_btree_node_delete()
282 dptrs = nilfs_btree_node_dptrs(node, ncmax); in nilfs_btree_node_delete()
285 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_node_delete()
298 nilfs_btree_node_set_nchildren(node, nchildren); in nilfs_btree_node_delete()
301 static int nilfs_btree_node_lookup(const struct nilfs_btree_node *node, in nilfs_btree_node_lookup() argument
309 high = nilfs_btree_node_get_nchildren(node) - 1; in nilfs_btree_node_lookup()
314 nkey = nilfs_btree_node_get_key(node, index); in nilfs_btree_node_lookup()
328 if (nilfs_btree_node_get_level(node) > NILFS_BTREE_LEVEL_NODE_MIN) { in nilfs_btree_node_lookup()
348 static int nilfs_btree_node_broken(const struct nilfs_btree_node *node, in nilfs_btree_node_broken() argument
354 level = nilfs_btree_node_get_level(node); in nilfs_btree_node_broken()
355 flags = nilfs_btree_node_get_flags(node); in nilfs_btree_node_broken()
356 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_node_broken()
413 struct nilfs_btree_node *node; in nilfs_btree_get_node() local
416 node = nilfs_btree_get_root(btree); in nilfs_btree_get_node()
419 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_get_node()
422 return node; in nilfs_btree_get_node()
426 nilfs_btree_bad_node(struct nilfs_btree_node *node, int level) in nilfs_btree_bad_node() argument
428 if (unlikely(nilfs_btree_node_get_level(node) != level)) { in nilfs_btree_bad_node()
431 nilfs_btree_node_get_level(node), level); in nilfs_btree_bad_node()
438 struct nilfs_btree_node *node; /* parent node */ member
467 ptr2 = nilfs_btree_node_get_ptr(ra->node, i, ra->ncmax); in __nilfs_btree_get_block()
510 struct nilfs_btree_node *node; in nilfs_btree_do_lookup() local
515 node = nilfs_btree_get_root(btree); in nilfs_btree_do_lookup()
516 level = nilfs_btree_node_get_level(node); in nilfs_btree_do_lookup()
517 if (level < minlevel || nilfs_btree_node_get_nchildren(node) <= 0) in nilfs_btree_do_lookup()
520 found = nilfs_btree_node_lookup(node, key, &index); in nilfs_btree_do_lookup()
521 ptr = nilfs_btree_node_get_ptr(node, index, in nilfs_btree_do_lookup()
531 p.node = nilfs_btree_get_node(btree, path, level + 1, in nilfs_btree_do_lookup()
542 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup()
543 if (nilfs_btree_bad_node(node, level)) in nilfs_btree_do_lookup()
546 found = nilfs_btree_node_lookup(node, key, &index); in nilfs_btree_do_lookup()
550 ptr = nilfs_btree_node_get_ptr(node, index, ncmax); in nilfs_btree_do_lookup()
571 struct nilfs_btree_node *node; in nilfs_btree_do_lookup_last() local
575 node = nilfs_btree_get_root(btree); in nilfs_btree_do_lookup_last()
576 index = nilfs_btree_node_get_nchildren(node) - 1; in nilfs_btree_do_lookup_last()
579 level = nilfs_btree_node_get_level(node); in nilfs_btree_do_lookup_last()
580 ptr = nilfs_btree_node_get_ptr(node, index, in nilfs_btree_do_lookup_last()
590 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_lookup_last()
591 if (nilfs_btree_bad_node(node, level)) in nilfs_btree_do_lookup_last()
593 index = nilfs_btree_node_get_nchildren(node) - 1; in nilfs_btree_do_lookup_last()
594 ptr = nilfs_btree_node_get_ptr(node, index, ncmax); in nilfs_btree_do_lookup_last()
599 *keyp = nilfs_btree_node_get_key(node, index); in nilfs_btree_do_lookup_last()
627 struct nilfs_btree_node *node; in nilfs_btree_lookup_contig() local
655 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_lookup_contig()
658 while (index < nilfs_btree_node_get_nchildren(node)) { in nilfs_btree_lookup_contig()
659 if (nilfs_btree_node_get_key(node, index) != in nilfs_btree_lookup_contig()
662 ptr2 = nilfs_btree_node_get_ptr(node, index, ncmax); in nilfs_btree_lookup_contig()
678 p.node = nilfs_btree_get_node(btree, path, level + 1, &p.ncmax); in nilfs_btree_lookup_contig()
681 if (p.index >= nilfs_btree_node_get_nchildren(p.node) || in nilfs_btree_lookup_contig()
682 nilfs_btree_node_get_key(p.node, p.index) != key + cnt) in nilfs_btree_lookup_contig()
684 ptr2 = nilfs_btree_node_get_ptr(p.node, p.index, p.ncmax); in nilfs_btree_lookup_contig()
694 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_lookup_contig()
733 struct nilfs_btree_node *node; in nilfs_btree_do_insert() local
737 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_insert()
739 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
746 nilfs_btree_node_get_key(node, in nilfs_btree_do_insert()
749 node = nilfs_btree_get_root(btree); in nilfs_btree_do_insert()
750 nilfs_btree_node_insert(node, path[level].bp_index, in nilfs_btree_do_insert()
760 struct nilfs_btree_node *node, *left; in nilfs_btree_carry_left() local
763 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_left()
765 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_left()
777 nilfs_btree_node_move_left(left, node, n, ncblk, ncblk); in nilfs_btree_carry_left()
785 nilfs_btree_node_get_key(node, 0)); in nilfs_btree_carry_left()
806 struct nilfs_btree_node *node, *right; in nilfs_btree_carry_right() local
809 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_carry_right()
811 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_right()
823 nilfs_btree_node_move_right(node, right, n, ncblk, ncblk); in nilfs_btree_carry_right()
839 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_carry_right()
853 struct nilfs_btree_node *node, *right; in nilfs_btree_split() local
858 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_split()
860 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_split()
870 nilfs_btree_node_move_right(node, right, n, ncblk, ncblk); in nilfs_btree_split()
881 path[level].bp_index -= nilfs_btree_node_get_nchildren(node); in nilfs_btree_split()
936 struct nilfs_btree_node *node; in nilfs_btree_find_near() local
945 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
946 return nilfs_btree_node_get_ptr(node, in nilfs_btree_find_near()
954 node = nilfs_btree_get_node(btree, path, level, &ncmax); in nilfs_btree_find_near()
955 return nilfs_btree_node_get_ptr(node, path[level].bp_index, in nilfs_btree_find_near()
988 struct nilfs_btree_node *node, *parent, *sib; in nilfs_btree_prepare_insert() local
1012 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_insert()
1013 if (nilfs_btree_node_get_nchildren(node) < ncblk) { in nilfs_btree_prepare_insert()
1080 node = nilfs_btree_get_root(btree); in nilfs_btree_prepare_insert()
1081 if (nilfs_btree_node_get_nchildren(node) < in nilfs_btree_prepare_insert()
1188 struct nilfs_btree_node *node; in nilfs_btree_do_delete() local
1192 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_do_delete()
1194 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1200 nilfs_btree_node_get_key(node, 0)); in nilfs_btree_do_delete()
1202 node = nilfs_btree_get_root(btree); in nilfs_btree_do_delete()
1203 nilfs_btree_node_delete(node, path[level].bp_index, in nilfs_btree_do_delete()
1213 struct nilfs_btree_node *node, *left; in nilfs_btree_borrow_left() local
1218 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_left()
1220 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_borrow_left()
1226 nilfs_btree_node_move_right(left, node, n, ncblk, ncblk); in nilfs_btree_borrow_left()
1234 nilfs_btree_node_get_key(node, 0)); in nilfs_btree_borrow_left()
1245 struct nilfs_btree_node *node, *right; in nilfs_btree_borrow_right() local
1250 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_borrow_right()
1252 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_borrow_right()
1258 nilfs_btree_node_move_left(node, right, n, ncblk, ncblk); in nilfs_btree_borrow_right()
1278 struct nilfs_btree_node *node, *left; in nilfs_btree_concat_left() local
1283 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_left()
1287 n = nilfs_btree_node_get_nchildren(node); in nilfs_btree_concat_left()
1289 nilfs_btree_node_move_left(left, node, n, ncblk, ncblk); in nilfs_btree_concat_left()
1304 struct nilfs_btree_node *node, *right; in nilfs_btree_concat_right() local
1309 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_concat_right()
1315 nilfs_btree_node_move_left(node, right, n, ncblk, ncblk); in nilfs_btree_concat_right()
1362 struct nilfs_btree_node *node, *parent, *sib; in nilfs_btree_prepare_delete() local
1374 node = nilfs_btree_get_nonroot_node(path, level); in nilfs_btree_prepare_delete()
1376 nilfs_btree_node_get_ptr(node, dindex, ncblk); in nilfs_btree_prepare_delete()
1382 if (nilfs_btree_node_get_nchildren(node) > ncmin) { in nilfs_btree_prepare_delete()
1443 if (nilfs_btree_node_get_nchildren(node) - 1 <= in nilfs_btree_prepare_delete()
1463 node = nilfs_btree_get_root(btree); in nilfs_btree_prepare_delete()
1465 nilfs_btree_node_get_ptr(node, dindex, in nilfs_btree_prepare_delete()
1555 struct nilfs_btree_node *root, *node; in nilfs_btree_check_delete() local
1564 node = root; in nilfs_btree_check_delete()
1575 node = (struct nilfs_btree_node *)bh->b_data; in nilfs_btree_check_delete()
1581 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_check_delete()
1582 maxkey = nilfs_btree_node_get_key(node, nchildren - 1); in nilfs_btree_check_delete()
1584 nilfs_btree_node_get_key(node, nchildren - 2) : 0; in nilfs_btree_check_delete()
1595 struct nilfs_btree_node *node, *root; in nilfs_btree_gather_data() local
1605 node = root; in nilfs_btree_gather_data()
1616 node = (struct nilfs_btree_node *)bh->b_data; in nilfs_btree_gather_data()
1620 node = NULL; in nilfs_btree_gather_data()
1624 nchildren = nilfs_btree_node_get_nchildren(node); in nilfs_btree_gather_data()
1627 dkeys = nilfs_btree_node_dkeys(node); in nilfs_btree_gather_data()
1628 dptrs = nilfs_btree_node_dptrs(node, ncmax); in nilfs_btree_gather_data()
1702 struct nilfs_btree_node *node; in nilfs_btree_commit_convert_and_insert() local
1722 node = (struct nilfs_btree_node *)bh->b_data; in nilfs_btree_commit_convert_and_insert()
1724 nilfs_btree_node_init(node, 0, 1, n, ncblk, keys, ptrs); in nilfs_btree_commit_convert_and_insert()
1725 nilfs_btree_node_insert(node, n, key, dreq->bpr_ptr, ncblk); in nilfs_btree_commit_convert_and_insert()
1734 node = nilfs_btree_get_root(btree); in nilfs_btree_commit_convert_and_insert()
1736 nilfs_btree_node_init(node, NILFS_BTREE_NODE_ROOT, 2, 1, in nilfs_btree_commit_convert_and_insert()
1743 node = nilfs_btree_get_root(btree); in nilfs_btree_commit_convert_and_insert()
1744 nilfs_btree_node_init(node, NILFS_BTREE_NODE_ROOT, 1, n, in nilfs_btree_commit_convert_and_insert()
1747 nilfs_btree_node_insert(node, n, key, dreq->bpr_ptr, in nilfs_btree_commit_convert_and_insert()
1970 struct nilfs_btree_node *node; in nilfs_btree_propagate() local
1981 node = (struct nilfs_btree_node *)bh->b_data; in nilfs_btree_propagate()
1982 key = nilfs_btree_node_get_key(node, 0); in nilfs_btree_propagate()
1983 level = nilfs_btree_node_get_level(node); in nilfs_btree_propagate()
2019 struct nilfs_btree_node *node, *cnode; in nilfs_btree_add_dirty_buffer() local
2024 node = (struct nilfs_btree_node *)bh->b_data; in nilfs_btree_add_dirty_buffer()
2025 key = nilfs_btree_node_get_key(node, 0); in nilfs_btree_add_dirty_buffer()
2026 level = nilfs_btree_node_get_level(node); in nilfs_btree_add_dirty_buffer()
2164 struct nilfs_btree_node *node; in nilfs_btree_assign() local
2173 node = (struct nilfs_btree_node *)(*bh)->b_data; in nilfs_btree_assign()
2174 key = nilfs_btree_node_get_key(node, 0); in nilfs_btree_assign()
2175 level = nilfs_btree_node_get_level(node); in nilfs_btree_assign()
2202 struct nilfs_btree_node *node; in nilfs_btree_assign_gc() local
2212 node = (struct nilfs_btree_node *)(*bh)->b_data; in nilfs_btree_assign_gc()
2213 key = nilfs_btree_node_get_key(node, 0); in nilfs_btree_assign_gc()