void testremove() { uint64_t cguid = 1; SDF_container_type_t ctype = SDF_BLOCK_CONTAINER; for (int blockNum = 0; blockNum < numBlocks; blockNum++) { local_key_t *lkey = get_local_block_key(blockNum); DirEntry *entry = HomeDir_remove(homedir, cguid, ctype, lkey); // {{ plat_assert_always(entry); fthThread_t *top = reqq_peek(entry->q); if (top) plat_assert_always(top == fthSelf()); fthWaitEl_t *wait = reqq_lock(entry->q); fthThread_t *self = reqq_dequeue(entry->q); if (self) plat_assert_always(self == fthSelf()); reqq_unlock(entry->q, wait); reqq_destroy(entry->q); plat_assert_always(NULL == entry->home); plat_free(entry); // }} free_local_key(lkey); } printf("Thread 1: Removed %d blocks from the directory\n", numBlocks); }
void testremove(uint64_t seq) { uint64_t cguid = 1; SDF_container_type_t ctype = SDF_BLOCK_CONTAINER; for (int i = 0; i < niterator; i++) { local_key_t *lkey = get_local_block_key(0); DirEntry *entry = HomeDir_remove(homedir, cguid, ctype, lkey); if (entry) { printf("fth %d remove block\n", seq); fflush(stdout); (void)__sync_fetch_and_add(&nremoves, 1); } else { free_local_key(lkey); continue; } // {{ plat_assert_always(entry); fthThread_t *top = reqq_peek(entry->q); if (top) plat_assert_always(top == fthSelf()); fthWaitEl_t *wait = reqq_lock(entry->q); fthThread_t *self = reqq_dequeue(entry->q); if (self) plat_assert_always(self == fthSelf()); reqq_unlock(entry->q, wait); reqq_destroy(entry->q); plat_assert_always(NULL == entry->home); plat_free(entry); // }} free_local_key(lkey); } }