Lines Matching refs:root

168 static inline NTFS_CMP_FUNC get_cmp_func(const struct INDEX_ROOT *root)
170 switch (root->type) {
172 if (root->rule == NTFS_COLLATION_TYPE_FILENAME)
176 switch (root->rule) {
878 const struct INDEX_ROOT *root = resident_data(attr);
882 !index_hdr_check(&root->ihdr,
887 /* Check root fields. */
888 if (!root->index_block_clst)
892 indx->idx2vbn_bits = __ffs(root->index_block_clst);
894 t32 = le32_to_cpu(root->index_block_size);
900 if (t32 != root->index_block_clst * SECTOR_SIZE)
905 (root->index_block_clst - 1)) {
912 if (t32 != root->index_block_clst << sbi->cluster_bits)
920 indx->cmp = get_cmp_func(root);
1000 struct INDEX_ROOT *root;
1010 root = resident_data_ex(a, sizeof(struct INDEX_ROOT));
1013 if (root &&
1014 offsetof(struct INDEX_ROOT, ihdr) + le32_to_cpu(root->ihdr.used) >
1019 return root;
1140 const struct INDEX_ROOT *root, const void *key, size_t key_len,
1148 if (!root)
1149 root = indx_get_root(&ni->dir, ni, NULL, NULL);
1151 if (!root) {
1169 e = hdr_find_e(indx, &root->ihdr, key, key_len, ctx, diff);
1203 const struct INDEX_ROOT *root, struct NTFS_DE **entry,
1214 e = hdr_first_de(&root->ihdr);
1225 e = hdr_next_de(&root->ihdr, fnd->root_de);
1313 const struct INDEX_ROOT *root, struct NTFS_DE **entry,
1328 e = hdr_first_de(&root->ihdr);
1342 /* Start enumeration from root. */
1353 /* Continue to enumerate root. */
1355 e = hdr_next_de(&root->ihdr, fnd->root_de);
1380 root->index_block_clst;
1416 /* 'e' points in root, */
1417 *off = PtrOffset(&root->ihdr, e);
1564 * indx_insert_into_root - Attempt to insert an entry into the index root.
1587 struct INDEX_ROOT *root, *a_root;
1589 /* Get the record this root placed in. */
1590 root = indx_get_root(indx, ni, &attr, &mi);
1591 if (!root)
1597 * room the root for the new entry.
1599 hdr = &root->ihdr;
1621 /* Make a copy of root attribute to restore if error. */
1628 * the index root to the new buffer.
1666 /* Make root external. */
1675 e = (struct NTFS_DE *)(root + 1);
1692 /* Layout of record may be changed, so rescan root. */
1693 root = indx_get_root(indx, ni, &attr, &mi);
1694 if (!root) {
1702 /* Restore root. */
1712 e = (struct NTFS_DE *)(root + 1);
1727 /* Copy root entries into new buffer. */
1737 * buffer. Move all root new index and have no space to add
1751 * Now root is a parent for new index buffer.
1783 struct INDEX_ROOT *root, const struct NTFS_DE *new_de,
1817 * - Insert sp into parent buffer (or root)
1897 /* Insert in root. */
1904 err = indx_insert_into_buffer(indx, ni, root, up_e, ctx,
1937 struct INDEX_ROOT *root;
1948 root = indx_get_root(indx, ni, NULL, NULL);
1949 if (!root) {
1959 err = indx_find(indx, ni, root, new_de + 1,
1973 * The root is also a leaf, so we'll insert the
1982 err = indx_insert_into_buffer(indx, ni, root, new_de, ctx,
1997 const struct INDEX_ROOT *root,
2003 const struct INDEX_HDR *hdr = n ? &n->index->ihdr : &root->ihdr;
2025 r = indx_find_buffer(indx, ni, root, vbn, n);
2255 struct INDEX_ROOT *root;
2281 root = indx_get_root(indx, ni, &attr, &mi);
2282 if (!root) {
2288 err = indx_find(indx, ni, root, key, key_len, ctx, &diff, &e, fnd);
2305 hdr = &root->ihdr;
2319 /* Shrink resident root attribute. */
2349 err = level ? indx_insert_into_buffer(indx, ni, root,
2376 /* Shrink resident root attribute. */
2386 /* Reinit root 'cause it can be changed. */
2387 root = indx_get_root(indx, ni, &attr, &mi);
2388 if (!root) {
2398 hdr = level ? &fnd->nodes[level - 1]->index->ihdr : &root->ihdr;
2417 /* Do slow search from root. */
2422 in = indx_find_buffer(indx, ni, root, sub_vbn, NULL);
2455 hdr = &root->ihdr;
2463 if (hdr != &root->ihdr || !de_is_last(e)) {
2511 * buffer or root, as appropriate.
2527 if (hdr == &root->ihdr) {
2531 /* Shrink resident root attribute. */
2568 * This tree needs to be collapsed down to an empty root.
2569 * Recreate the index root as an empty leaf and free all
2592 root = indx_get_root(indx, ni, &attr, &mi);
2593 if (!root) {
2609 e = (struct NTFS_DE *)(root + 1);
2618 hdr = &root->ihdr;
2645 struct INDEX_ROOT *root;
2653 root = indx_get_root(indx, ni, NULL, &mi);
2654 if (!root) {
2660 err = indx_find(indx, ni, root, fname, fname_full_size(fname), sbi,