Lines Matching refs:block
75 OSStatus GetBTreeBlock(FileReference vp, u_int32_t blockNum, GetBlockOptions options, BlockDescriptor *block)
81 /* If the btree block is being read using hint, it is
94 offset = (daddr64_t)blockNum * (daddr64_t)block->blockSize;
95 bp = buf_getblk(vp, (daddr64_t)blockNum, block->blockSize, 0, 0, BLK_META);
97 VNOP_BLOCKMAP(vp, offset, block->blockSize, &blkno, NULL, NULL, 0, NULL) == 0) {
101 retval = buf_meta_bread(vp, (daddr64_t)blockNum, block->blockSize, NOCRED, &bp);
107 block->blockHeader = bp;
108 block->buffer = (char *)buf_dataptr(bp);
109 block->blockNum = buf_lblkno(bp);
110 block->blockReadFromDisk = (buf_fromcache(bp) == 0); /* not found in cache ==> came from disk */
113 block->isModified = 0;
115 /* Check and endian swap B-Tree node (only if it's a valid block) */
118 if ((((BTNodeDescriptor *)block->buffer)->kind == kBTHeaderNode) &&
119 (((BTHeaderRec *)((char *)block->buffer + 14))->nodeSize != buf_count(bp)) &&
120 (SWAP_BE16 (((BTHeaderRec *)((char *)block->buffer + 14))->nodeSize) != buf_count(bp))) {
125 * size once the B-tree control block is set up with the node size
128 retval = hfs_swap_BTNode (block, vp, kSwapBTNodeHeaderRecordOnly, allow_empty_node);
130 } else if (block->blockReadFromDisk) {
135 retval = hfs_swap_BTNode (block, vp, kSwapBTNodeBigToHost, allow_empty_node);
136 } else if (*((u_int16_t *)((char *)block->buffer + (block->blockSize - sizeof (u_int16_t)))) == 0x0e00) {
142 retval = hfs_swap_BTNode (block, vp, kSwapBTNodeBigToHost, allow_empty_node);
160 block->blockHeader = NULL;
161 block->buffer = NULL;
194 BlockDescriptor block;
196 /* Prepare the block pointer */
197 block.blockHeader = bp;
198 block.buffer = (char *)buf_dataptr(bp);
199 block.blockNum = buf_lblkno(bp);
201 block.blockReadFromDisk = (buf_fromcache(bp) == 0);
202 block.blockSize = buf_count(bp);
208 retval = hfs_swap_BTNode (&block, vp, kSwapBTNodeHostToBig, true);
277 * Delay-write this block.
297 // on this block and if so, abort it (which will call buf_brelse()).
301 // journal and blowing away a block that has
369 * the allocation block size is less than the b-tree node
643 * Set up Attribute B-tree control block