Lines Matching defs:iterator
62 BTreeIterator iterator;
350 struct BTreeIterator *iterator;
362 MALLOC(iterator, BTreeIterator *, 2 * sizeof(*iterator), M_TEMP, M_WAITOK);
363 bzero(&iterator[0], 2* sizeof(*iterator));
364 result = buildkey(hfsmp, descp, (HFSPlusCatalogKey *)&iterator[0].key, 0);
369 result = BTSearchRecord(fcb, &iterator[0], &file_data, &datasize, &iterator[0]);
384 thread_data.itemSize = buildthread(&iterator[0].key, &thread_rec, 1, 0);
385 buildthreadkey(file_rec.fileID, 1, (CatalogKey *)&iterator[1].key);
387 result = BTInsertRecord(fcb, &iterator[1], &thread_data, thread_data.itemSize);
391 (void) BTReplaceRecord(fcb, &iterator[0], &file_data, datasize);
396 FREE(iterator, M_TEMP);
414 struct BTreeIterator * iterator;
425 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
426 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
427 iterator->hint.nodeNum = 0;
432 result = BTSearchRecord(VTOF(hfsmp->hfs_catalog_vp), iterator, &btdata, NULL, NULL);
472 FREE(iterator, M_TEMP);
487 struct BTreeIterator * iterator;
497 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
498 bzero(iterator, sizeof(*iterator));
499 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
504 result = BTSearchRecord(VTOF(HFSTOVCB(hfsmp)->catalogRefNum), iterator,
505 &btdata, &datasize, iterator);
562 FREE(iterator, M_TEMP);
640 struct BTreeIterator * iterator;
655 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
656 bzero(iterator, sizeof(*iterator));
657 iterator->hint.nodeNum = hint;
658 bcopy(keyp, &iterator->key, sizeof(CatalogKey));
660 result = BTSearchRecord(VTOF(HFSTOVCB(hfsmp)->catalogRefNum), iterator,
661 &btdata, &datasize, iterator);
672 hint = iterator->hint.nodeNum;
854 promotekey(hfsmp, (HFSCatalogKey *)&iterator->key, pluskey, &encoding);
857 pluskey = (HFSPlusCatalogKey *)&iterator->key;
869 FREE(iterator, M_TEMP);
922 /* Get space for iterator, key and data */
924 bto->iterator.hint.nodeNum = 0;
958 buildthreadkey(nextCNID, std_hfs, (CatalogKey *) &bto->iterator.key);
973 result = BTInsertRecord(fcb, &bto->iterator, &btdata, datalen);
1009 bcopy(&bto->key, &bto->iterator.key, sizeof(bto->key));
1011 result = BTInsertRecord(fcb, &bto->iterator, &btdata, datalen);
1018 buildthreadkey(nextCNID, std_hfs, (CatalogKey *)&bto->iterator.key);
1019 if (BTDeleteRecord(fcb, &bto->iterator)) {
1038 promotekey(hfsmp, (HFSCatalogKey *)&bto->iterator.key, pluskey, &encoding);
1041 pluskey = (HFSPlusCatalogKey *)&bto->iterator.key;
1043 builddesc(pluskey, nextCNID, bto->iterator.hint.nodeNum,
1385 BTreeIterator *iterator;
1405 /* Borrow the btcb iterator since we have an exclusive catalog lock. */
1406 iterator = &((BTreeControlBlockPtr)(fcb->ff_sysfileinfo))->iterator;
1407 iterator->hint.nodeNum = 0;
1414 result = getkey(hfsmp, attrp->ca_fileid, (CatalogKey *)&iterator->key);
1417 result = buildkey(hfsmp, descp, (HFSPlusCatalogKey *)&iterator->key, 0);
1424 result = BTDeleteRecord(fcb, iterator);
1437 bzero(iterator, sizeof(*iterator));
1438 result = buildkey(hfsmp, &temp_desc, (HFSPlusCatalogKey *)&iterator->key, 0);
1445 result = BTDeleteRecord(fcb, iterator);
1455 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
1456 if (BTDeleteRecord(fcb, iterator)) {
1481 BTreeIterator * iterator;
1495 /* Borrow the btcb iterator since we have an exclusive catalog lock. */
1496 iterator = &((BTreeControlBlockPtr)(fcb->ff_sysfileinfo))->iterator;
1510 result = getkey(hfsmp, attrp->ca_fileid, (CatalogKey *)&iterator->key);
1512 result = buildkey(hfsmp, descp, (HFSPlusCatalogKey *)&iterator->key, 0);
1518 iterator->hint.nodeNum = descp->cd_hint;
1520 result = BTUpdateRecord(fcb, iterator,
1526 descp->cd_hint = iterator->hint.nodeNum;
1975 BTreeIterator * iterator;
1984 /* Create an iterator for use by us temporarily */
1985 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
1986 bzero(iterator, sizeof(*iterator));
1988 result = getkey(hfsmp, linkfileid, (CatalogKey *)&iterator->key);
1990 result = BTUpdateRecord(fcb, iterator, (IterateCallBackProcPtr)update_siblinglinks_callback, &state);
1996 FREE (iterator, M_TEMP);
2007 BTreeIterator * iterator;
2014 /* Create an iterator for use by us temporarily */
2015 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
2016 bzero(iterator, sizeof(*iterator));
2018 if ((result = buildkey(hfsmp, descp, (HFSPlusCatalogKey *)&iterator->key, 0))) {
2023 if ((result = BTSearchRecord(fcb, iterator, &btdata, NULL, NULL))) {
2040 FREE(iterator, M_TEMP);
2052 BTreeIterator * iterator;
2059 /* Create an iterator for use by us temporarily */
2060 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
2061 bzero(iterator, sizeof(*iterator));
2063 if ((result = getkey(hfsmp, linkfileid, (CatalogKey *)&iterator->key))) {
2068 if ((result = BTSearchRecord(fcb, iterator, &btdata, NULL, NULL))) {
2075 parent = ((HFSPlusCatalogKey *)&iterator->key)->parentID;
2092 FREE(iterator, M_TEMP);
2142 /* Get space for iterator, key and data */
2144 bto->iterator.hint.nodeNum = 0;
2163 buildthreadkey(nextCNID, 0, (CatalogKey *) &bto->iterator.key);
2179 result = BTInsertRecord(fcb, &bto->iterator, &btdata, datalen);
2230 bcopy(&bto->key, &bto->iterator.key, sizeof(bto->key));
2232 result = BTInsertRecord(fcb, &bto->iterator, &btdata, datalen);
2246 buildthreadkey(nextCNID, 0, (CatalogKey *)&bto->iterator.key);
2247 if (BTDeleteRecord(fcb, &bto->iterator)) {
2437 BTreeIterator * iterator;
2442 /* Borrow the btcb iterator since we have an exclusive catalog lock. */
2443 iterator = &((BTreeControlBlockPtr)(fcb->ff_sysfileinfo))->iterator;
2444 iterator->hint.nodeNum = 0;
2446 if ((result = buildkey(hfsmp, descp, (HFSPlusCatalogKey *)&iterator->key, 0))) {
2451 if ((result = BTSearchRecord(fcb, iterator, &btdata, NULL, NULL))) {
2602 BTreeIterator * iterator;
2623 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
2624 bzero(iterator, sizeof(*iterator));
2625 key = (CatalogKey *)&iterator->key;
2627 iterator->hint.nodeNum = dirhint->dh_desc.cd_hint;
2640 * If the last entry wasn't cached then position the btree iterator
2644 * Position the iterator at the directory's thread record.
2648 result = BTSearchRecord(fcb, iterator, NULL, NULL, iterator);
2667 result = BTIterateRecords(fcb, kBTreeNextRecord, iterator,
2680 /* Fill list with entries starting at iterator->key. */
2681 result = BTIterateRecords(fcb, kBTreeNextRecord, iterator,
2734 FREE(iterator, M_TEMP);
3199 BTreeIterator * iterator;
3218 * Get a buffer for link info array, btree iterator and a direntry:
3221 bufsize = MAXPATHLEN + (maxlinks * sizeof(linkinfo_t)) + sizeof(*iterator);
3237 * field to track whether or not we've returned EOF from the iterator function.
3241 iterator = (BTreeIterator *) ((char *)state.cbs_linkinfo + (maxlinks * sizeof(linkinfo_t)));
3242 key = (CatalogKey *)&iterator->key;
3246 state.cbs_direntry = (struct direntry *)((char *)iterator + sizeof(BTreeIterator));
3254 iterator->hint.nodeNum = dirhint->dh_desc.cd_hint;
3261 * Position the iterator at the directory's thread record.
3265 iterator->hint.nodeNum = dirhint->dh_threadhint;
3266 iterator->hint.index = 0;
3271 * If the last entry wasn't cached then position the btree iterator
3275 * Position the iterator at the directory's thread record.
3279 result = BTSearchRecord(fcb, iterator, NULL, NULL, iterator);
3285 dirhint->dh_threadhint = iterator->hint.nodeNum;
3300 result = BTIterateRecords(fcb, kBTreeNextRecord, iterator,
3338 * Process as many entries as possible starting at iterator->key.
3341 result = BTIterateRecords(fcb, op, iterator,
3344 result = BTIterateRecords(fcb, op, iterator,
3380 /* Finish updating the catalog iterator. */
3381 dirhint->dh_desc.cd_hint = iterator->hint.nodeNum;
3674 struct BTreeIterator *iterator;
3690 /* Get space for iterator */
3691 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
3692 bzero(iterator, sizeof(*iterator));
3701 (void) buildkey(hfsmp, &idesc, (HFSPlusCatalogKey *)&iterator->key, 0);
3703 result = BTSearchRecord(VTOF(HFSTOVCB(hfsmp)->catalogRefNum), iterator,
3714 FREE(iterator, M_TEMP);
3750 struct BTreeIterator * iterator;
3760 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
3761 bzero(iterator, sizeof(*iterator));
3762 buildthreadkey(cnid, std_hfs, (CatalogKey *)&iterator->key);
3767 result = BTSearchRecord(VTOF(HFSTOVCB(hfsmp)->catalogRefNum), iterator,
3768 &btdata, &datasize, iterator);
3795 FREE(iterator, M_TEMP);
4368 struct BTreeIterator *iterator = NULL;
4380 MALLOC(iterator, BTreeIterator *, sizeof(*iterator), M_TEMP, M_WAITOK);
4381 if (iterator == NULL) {
4384 bzero(iterator, sizeof(*iterator));
4385 buildthreadkey(dirlink_id, 1, (CatalogKey *)&iterator->key);
4394 error = BTSearchRecord(VTOF(HFSTOVCB(hfsmp)->catalogRefNum), iterator,
4395 &btdata, &datasize, iterator);
4431 FREE(iterator, M_TEMP);