Lines Matching refs:swap
175 getJournalTransaction(JournalIOInfo_t *jinfo, swapper_t *swap)
191 if (swap->swap32(hdr->num_blocks) == 0) {
208 uint32_t tmpChecksum = swap->swap32(hdr->checksum);
212 hdr->checksum = swap->swap32(tmpChecksum);
220 if (swap->swap32(hdr->bytes_used) < sizeof(block)) {
224 __FUNCTION__, __LINE__, swap->swap32(hdr->bytes_used), sizeof(block));
230 retval = malloc(swap->swap32(hdr->bytes_used));
234 memset(retval, 0, swap->swap32(hdr->bytes_used));
236 amt = swap->swap32(hdr->bytes_used) - sizeof(block);
263 * swap -- A pointer to a swapper_t used to swap journal data structure elements.
269 replayTransaction(block_list_header *txn, size_t blSize, size_t blkSize, swapper_t *swap, journal_write_block_t writer)
272 uint8_t *endPtr = ((uint8_t*)txn) + swap->swap32(txn->bytes_used);
275 for (i = 1; i < swap->swap32(txn->num_blocks); i++) {
278 plog("\tBlock %d: blkNum %llu, size %u, data offset = %zd\n", i, swap->swap64(txn->binfo[i].bnum), swap->swap32(txn->binfo[i].bsize), dataPtr - (uint8_t*)txn);
291 if ((endPtr - dataPtr) < swap->swap32(txn->binfo[i].bsize)) {
296 if ((dataPtr + swap->swap32(txn->binfo[i].bsize)) > endPtr) {
304 if (swap->swap64(txn->binfo[i].bnum) == 2) {
311 if (swap->swap64(txn->binfo[i].bnum) == ~(uint64_t)0) {
319 if ((writer)(swap->swap64(txn->binfo[i].bnum) * blkSize, dataPtr, swap->swap32(txn->binfo[i].bsize)) == -1)
323 dataPtr += swap->swap32(txn->binfo[i].bsize);
385 swapper_t *jnlSwap; // Used to swap fields of the journal