Lines Matching defs:block

10  *  Enhanced block allocation by Stephen Tweedie (sct@redhat.com), 1993
29 * blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
30 * block for inodes, N blocks for the inode table and data blocks.
33 * super block. Each descriptor contains the number of the bitmap block and
34 * the free blocks count in the block. The descriptors are loaded in memory
85 /* check whether block bitmap block number is set */
89 /* bad block bitmap */
92 /* check whether the inode bitmap block number is set */
96 /* bad block bitmap */
99 /* check whether the inode table block number is set */
111 "Invalid block bitmap - "
112 "block_group = %d, block = %lu",
119 * bits for block/inode/inode tables are set in the bitmaps
137 "Cannot read block bitmap - "
148 "Cannot read block bitmap - "
189 * __rsv_window_dump() -- Dump the filesystem block allocation reservation map
194 * If verbose is turned on, it will print the whole block reservation
250 * @grp_goal: given goal block relative to the allocation block group
251 * @group: the current allocation block group
252 * @sb: filesystem super block
254 * Test if the given goal block (group relative) is within the file's
255 * own block reservation window range.
258 * grp_goal (given goal block) could be -1, which means no specific
259 * goal block. In this case, always return 1.
260 * If the goal block is within the reservation window, return 1;
284 * @goal: target allocation block
323 * ext2_rsv_window_add() -- Insert a window to the block reservation rb tree.
324 * @sb: super block
361 * @sb: super block
364 * Mark the block reservation window as not allocated, and unlink it
381 * returns 1 if the end block is EXT2_RESERVE_WINDOW_NOT_ALLOCATED.
385 /* a valid reservation end block could not be 0 */
398 * needs a new block. So, before every ext2_new_block(s) call, for
401 * Fail to do so will result in block reservation being turned off for that
406 * is open for write (needs block allocation).
426 * block reservation is off
443 * Discard(free) block reservation window on last file close, or truncate
449 * ext2_truncate(): when the block indirect map is about to change.
473 * @block: start physical block to free
476 void ext2_free_blocks (struct inode * inode, unsigned long block,
491 if (!ext2_data_block_valid(sbi, block, count)) {
494 "block = %lu, count = %lu", block, count);
498 ext2_debug ("freeing block(s) %lu-%lu\n", block, block + count - 1);
502 block_group = (block - le32_to_cpu(es->s_first_data_block)) /
504 bit = (block - le32_to_cpu(es->s_first_data_block)) %
523 if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) ||
524 in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) ||
525 in_range (block, le32_to_cpu(desc->bg_inode_table),
527 in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table),
532 block, count);
540 "bit already cleared for block %lu", block + i);
554 block += count;
569 * @start: the starting block (group relative) of the search
570 * @bh: bufferhead contains the block group bitmap
571 * @maxblocks: the ending block (group relative) of the reservation
590 * @start: the starting block (group relative) to find next
591 * allocatable block in bitmap.
592 * @bh: bufferhead contains the block group bitmap
593 * @maxblocks: the ending block (group relative) for the search
595 * Find an allocatable block in a bitmap. We perform the "most
596 * appropriate allocation" algorithm of looking for a free block near
609 * block within the next XX blocks.
642 * @group: given allocation block group
643 * @bitmap_bh: bufferhead holds the block bitmap
644 * @grp_goal: given target block within the group
653 * if there is a reservation window, only try to allocate block(s)
655 * Otherwise, the allocation range starts from the give goal block,
656 * ends at the block group's last block.
658 * If we failed to allocate the desired block then we may end up crossing to a
733 * @sb: the super block.
735 * @start_block: the first block we consider to start the real search from
738 * the maximum block number that our goal reservable space
739 * could start from. This is normally the last block in this
845 * there, we check the bitmap for the first free block after
846 * it. If there is no free block until the end of group, then the
848 * block is inside the expected reservable space, if so, we
850 * If the first free block is outside the reservable space, then
851 * start from the first free block, we search for next available
855 * It contains at least one free block, and it does not overlap with other
865 * no goal(goal = -1), we start from the first block
868 * @sb: the super block
870 * @bitmap_bh: the block group block bitmap
906 * Maybe we could shift the start block of the reservation
907 * window to the first block of next group.
932 * shift the search start to the window near the goal block
958 * to make sure there is at least a free block inside this region.
960 * Search the first free bit on the block bitmap. Search starts from
961 * the start block of the reservable space we just found.
970 * no free block left on the bitmap, no point
982 * check if the first free block is within the
990 * start from where the free block is,
1001 * @sb: super block
1043 * @group: given allocation block group
1044 * @bitmap_bh: bufferhead holds the block bitmap
1045 * @grp_goal: given target block within the group
1049 * This is the main function used to allocate a new block and its reservation
1052 * Each time when a new block allocation is need, first try to allocate from
1056 * reservation window for it starting from the goal first. Then do the block
1060 * again when somebody is looking for a free block (without
1080 * or last attempt to allocate a block with reservation turned on failed
1087 * grp_goal is a group relative block number (if there is a goal)
1089 * first block is a filesystem wide block number
1090 * first block is the block number of the first block in this group
1096 * Basically we will allocate a new block from inode's reservation
1101 * b) last attempt to allocate a block from existing reservation
1152 * @sbi: in-core super block structure.
1154 * Check if filesystem has at least 1 free block available for allocation.
1172 * Returns 1 if the passed-in block region is valid; 0 if some part overlaps
1192 * ext2_new_blocks() -- core block(s) allocation function
1194 * @goal: given target block(filesystem wide)
1198 * ext2_new_blocks uses a goal block to assist allocation. If the goal is
1199 * free, or there is a free block within 32 blocks of the goal, that block
1200 * is allocated. Otherwise a forward search is made for a free block; within
1201 * each block group the search first looks for an entire free byte in the block
1212 ext2_grpblk_t grp_target_blk; /* blockgroup relative goal block */
1213 ext2_grpblk_t grp_alloc_blk; /* blockgroup-relative allocated block*/
1214 ext2_fsblk_t ret_block; /* filesyetem-wide allocated block */
1233 * Check quota for allocation of this block.
1245 * Allocate a block from reservation only when
1265 * First, test whether the goal block is free.
1343 * try to allocate block(s) from this group, without a goal(-1).
1355 * just do block allocation as without reservations.
1369 ext2_debug("using block group %d(%d)\n",
1381 "Allocating block in system zone - "
1397 "block("E2FSBLK") >= blocks count(%d) - "
1423 * Undo the block allocation