Lines Matching full:leaf
98 * There are two types of blocks in the btree: leaf and inner (non-leaf) blocks.
100 * The leaf blocks are made up by %KEYS_PER_NODE extent records, which each
103 * leaf blocks (if there are any).
105 * The inner (non-leaf) blocks first contain KEYS_PER_NODE lookup keys, followed
109 * Leaf: | rec 1 | rec 2 | rec 3 | rec 4 | rec N | prev-ptr | next-ptr |
142 return &cur->leaf->recs[cur->pos]; in cur_rec()
148 if (!cur->leaf) in xfs_iext_valid()
202 cur->leaf = xfs_iext_find_first_leaf(ifp); in xfs_iext_first()
212 cur->leaf = xfs_iext_find_last_leaf(ifp); in xfs_iext_last()
213 if (!cur->leaf) { in xfs_iext_last()
219 if (xfs_iext_rec_is_empty(&cur->leaf->recs[i])) in xfs_iext_last()
230 if (!cur->leaf) { in xfs_iext_next()
241 cur->leaf->next) { in xfs_iext_next()
242 cur->leaf = cur->leaf->next; in xfs_iext_next()
252 if (!cur->leaf) { in xfs_iext_prev()
268 if (ifp->if_height > 1 && cur->leaf->prev) { in xfs_iext_prev()
269 cur->leaf = cur->leaf->prev; in xfs_iext_prev()
376 struct xfs_iext_leaf *leaf, in xfs_iext_leaf_nr_entries() argument
382 if (xfs_iext_rec_is_empty(&leaf->recs[i])) in xfs_iext_leaf_nr_entries()
391 struct xfs_iext_leaf *leaf, in xfs_iext_leaf_key() argument
394 return leaf->recs[n].lo & XFS_IEXT_STARTOFF_MASK; in xfs_iext_leaf_key()
551 struct xfs_iext_leaf *leaf = cur->leaf; in xfs_iext_split_leaf() local
559 cur->leaf = new; in xfs_iext_split_leaf()
566 new->recs[i] = leaf->recs[nr_keep + i]; in xfs_iext_split_leaf()
567 xfs_iext_rec_clear(&leaf->recs[nr_keep + i]); in xfs_iext_split_leaf()
571 cur->leaf = new; in xfs_iext_split_leaf()
578 if (leaf->next) in xfs_iext_split_leaf()
579 leaf->next->prev = new; in xfs_iext_split_leaf()
580 new->next = leaf->next; in xfs_iext_split_leaf()
581 new->prev = leaf; in xfs_iext_split_leaf()
582 leaf->next = new; in xfs_iext_split_leaf()
597 cur->leaf = ifp->if_data; in xfs_iext_alloc_root()
617 cur->leaf = new; in xfs_iext_realloc_root()
649 nr_entries = xfs_iext_leaf_nr_entries(ifp, cur->leaf, cur->pos); in xfs_iext_insert_raw()
661 if (cur->leaf != new && cur->pos == 0 && nr_entries > 0) { in xfs_iext_insert_raw()
662 xfs_iext_update_node(ifp, xfs_iext_leaf_key(cur->leaf, 0), in xfs_iext_insert_raw()
663 offset, 1, cur->leaf); in xfs_iext_insert_raw()
667 cur->leaf->recs[i] = cur->leaf->recs[i - 1]; in xfs_iext_insert_raw()
808 struct xfs_iext_leaf *leaf, in xfs_iext_rebalance_leaf() argument
820 if (leaf->prev) { in xfs_iext_rebalance_leaf()
821 int nr_prev = xfs_iext_leaf_nr_entries(ifp, leaf->prev, 0), i; in xfs_iext_rebalance_leaf()
825 leaf->prev->recs[nr_prev + i] = leaf->recs[i]; in xfs_iext_rebalance_leaf()
827 if (cur->leaf == leaf) { in xfs_iext_rebalance_leaf()
828 cur->leaf = leaf->prev; in xfs_iext_rebalance_leaf()
835 if (leaf->next) { in xfs_iext_rebalance_leaf()
836 int nr_next = xfs_iext_leaf_nr_entries(ifp, leaf->next, 0), i; in xfs_iext_rebalance_leaf()
845 leaf->recs[nr_entries + i] = in xfs_iext_rebalance_leaf()
846 leaf->next->recs[i]; in xfs_iext_rebalance_leaf()
849 if (cur->leaf == leaf->next) { in xfs_iext_rebalance_leaf()
850 cur->leaf = leaf; in xfs_iext_rebalance_leaf()
854 offset = xfs_iext_leaf_key(leaf->next, 0); in xfs_iext_rebalance_leaf()
855 leaf = leaf->next; in xfs_iext_rebalance_leaf()
862 if (leaf->prev) in xfs_iext_rebalance_leaf()
863 leaf->prev->next = leaf->next; in xfs_iext_rebalance_leaf()
864 if (leaf->next) in xfs_iext_rebalance_leaf()
865 leaf->next->prev = leaf->prev; in xfs_iext_rebalance_leaf()
866 xfs_iext_remove_node(ifp, offset, leaf); in xfs_iext_rebalance_leaf()
885 struct xfs_iext_leaf *leaf = cur->leaf; in xfs_iext_remove() local
886 xfs_fileoff_t offset = xfs_iext_leaf_key(leaf, 0); in xfs_iext_remove()
897 nr_entries = xfs_iext_leaf_nr_entries(ifp, leaf, cur->pos) - 1; in xfs_iext_remove()
899 leaf->recs[i] = leaf->recs[i + 1]; in xfs_iext_remove()
900 xfs_iext_rec_clear(&leaf->recs[nr_entries]); in xfs_iext_remove()
904 xfs_iext_update_node(ifp, offset, xfs_iext_leaf_key(leaf, 0), 1, in xfs_iext_remove()
905 leaf); in xfs_iext_remove()
906 offset = xfs_iext_leaf_key(leaf, 0); in xfs_iext_remove()
908 if (ifp->if_height > 1 && leaf->next) in xfs_iext_remove()
909 cur->leaf = leaf->next; in xfs_iext_remove()
911 cur->leaf = NULL; in xfs_iext_remove()
919 xfs_iext_rebalance_leaf(ifp, cur, leaf, offset, nr_entries); in xfs_iext_remove()
945 cur->leaf = xfs_iext_find_level(ifp, offset, 1); in xfs_iext_lookup_extent()
946 if (!cur->leaf) { in xfs_iext_lookup_extent()
961 if (ifp->if_height == 1 || !cur->leaf->next) in xfs_iext_lookup_extent()
963 cur->leaf = cur->leaf->next; in xfs_iext_lookup_extent()
1011 new->br_startoff, 1, cur->leaf); in xfs_iext_update_extent()