Lines Matching defs:block
20 * Goal-directed block allocation by Stephen Tweedie
44 * ext4_block_to_path - parse the block number into array of offsets
46 * @i_block: block number to be parsed
48 * @boundary: set this non-zero if the referred-to block is likely to be
49 * followed (on disk) by an indirect block.
54 * This function translates the block number into path in that tree -
56 * pointer to (n+1)th node in the nth one. If @block is out of range
66 * indirect block) is spelled differently, because otherwise on an
105 ext4_warning(inode->i_sb, "block %lu > max in inode %lu",
125 * the number of (i+1)-th block in the chain (as it is stored in memory,
129 * block for i>0 and NULL for i==0. In other words, it holds the block
134 * Function stops when it stumbles upon zero pointer (absent block)
136 * or when it gets an IO error reading an indirect block
162 /* the block was out of range */
177 /* validate block references */
200 * @ind: descriptor of indirect block.
202 * This function returns the preferred place for block allocation.
205 * + if there is a block to the left of our position - allocate near it.
206 * + if pointer will live in indirect block - allocate near that block.
210 * In the latter case we colour the starting block by the callers PID to
212 * in the same block group. The PID is used here so that functionally related
223 /* Try to find previous block */
229 /* No such thing, so let's try location of indirect block */
243 * @block: block we want
246 * Normally this function find the preferred place for block allocation,
248 * Because this is only used for non-extent files, we limit the block nr
251 static ext4_fsblk_t ext4_find_goal(struct inode *inode, ext4_lblk_t block,
257 * XXX need to get goal block from mballoc's data structures
266 * ext4_blks_to_allocate - Look up the block map and count the number
272 * @blocks_to_boundary: the offset in the indirect block
283 * Simple case, [t,d]Indirect block(s) has not allocated yet
400 * (buffer at branch[0].bh is indirect block / inode already
422 * chain to new block and return 0.
433 * If we're splicing into a [td]indirect block (as opposed to the
434 * inode) then we need to get write access to the [td]indirect block
458 /* had we spliced it onto indirect block? */
461 * If we spliced it onto an indirect block, we haven't
463 * onto an indirect block at the very end of the file (the
475 * OK, we spliced it into the inode itself on a direct block.
488 * need to revoke the block, which is why we don't
511 * write on the parent block.
554 /* Simplest case - block found, no allocation needed */
593 /* Failed read of indirect block */
598 * Okay, we need to do block allocation.
607 /* Set up for the direct block allocation */
654 * Update reserved blocks/metadata blocks after successful block
689 * 2 dindirect blocks, and 1 tindirect block
780 * data block, indeed). We have to free the top of that path along
788 * block number of its root in *@top, pointers to buffer_heads of
826 * OK, we've found the last block that must survive. The rest of our
851 * Zero a number of block pointers in either an inode or an indirect block.
853 * indirect block for further modification.
858 * Return 0 on success, 1 on invalid block range
904 * @first: array of block numbers
916 * block pointers.
922 ext4_fsblk_t block_to_free = 0; /* Starting block # of a run */
927 ext4_fsblk_t nr; /* Current block # */
929 for current block */
932 if (this_bh) { /* For indirect block */
977 * block pointed to itself, it would have been detached when
978 * the block was cleared. Check for this instead of OOPSing.
984 "circular indirect block detected at "
985 "block %llu",
995 * @first: array of block numbers
1025 "block %lu (level %d)",
1043 /* This zaps the entire block. Bottom up. */
1055 * We want the freeing of this indirect block to be
1057 * bitmap block which owns it. So make some room in
1064 * will merely complain about releasing a free block,
1081 * indirect block if it gets reallocated as a
1082 * data block. This must happen in the same
1092 * The block which we have just freed is
1093 * pointed to by an indirect block: journal it
1152 * equal to the indirect block limit.
1174 /* Shared branch grows from an indirect block */
1223 * @start: First block to remove
1224 * @end: One block after the last block to remove (exclusive)
1257 /* We're punching only within direct block range */
1264 * free partial block at start, and partial block at end of
1271 * Start is at the direct block level, free
1288 /* Shared branch grows from an indirect block */
1369 /* Shared branch grows from an indirect block */
1396 * We've converged on the same block. Clear the range,
1411 * block.