* Return the first element in the tree, and put its location in where if * non-null. */
| 1069 | * non-null. |
| 1070 | */ |
| 1071 | void * |
| 1072 | zfs_btree_first(zfs_btree_t *tree, zfs_btree_index_t *where) |
| 1073 | { |
| 1074 | if (tree->bt_height == -1) { |
| 1075 | ASSERT0(tree->bt_num_elems); |
| 1076 | return (NULL); |
| 1077 | } |
| 1078 | return (zfs_btree_first_helper(tree->bt_root, where)); |
| 1079 | } |
| 1080 | |
| 1081 | /* |
| 1082 | * Find the last element in the subtree rooted at hdr, return its value and |