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
83 /* check whether block bitmap block number is set */
87 /* bad block bitmap */
90 /* check whether the inode bitmap block number is set */
94 /* bad block bitmap */
97 /* check whether the inode table block number is set */
109 "Invalid block bitmap - "
110 "block_group = %d, block = %lu",
117 * bits for block/inode/inode tables are set in the bitmaps
136 "Cannot read block bitmap - "
147 "Cannot read block bitmap - "
188 * __rsv_window_dump() -- Dump the filesystem block allocation reservation map
193 * If verbose is turned on, it will print the whole block reservation
249 * @grp_goal: given goal block relative to the allocation block group
250 * @group: the current allocation block group
251 * @sb: filesystem super block
253 * Test if the given goal block (group relative) is within the file's
254 * own block reservation window range.
257 * grp_goal (given goal block) could be -1, which means no specific
258 * goal block. In this case, always return 1.
259 * If the goal block is within the reservation window, return 1;
283 * @goal: target allocation block
322 * ext2_rsv_window_add() -- Insert a window to the block reservation rb tree.
323 * @sb: super block
360 * @sb: super block
363 * Mark the block reservation window as not allocated, and unlink it
380 * returns 1 if the end block is EXT2_RESERVE_WINDOW_NOT_ALLOCATED.
384 /* a valid reservation end block could not be 0 */
397 * needs a new block. So, before every ext2_new_block(s) call, for
400 * Fail to do so will result in block reservation being turned off for that
405 * is open for write (needs block allocation).
425 * block reservation is off
442 * Discard(free) block reservation window on last file close, or truncate
448 * ext2_truncate(): when the block indirect map is about to change.
472 * @block: start physical block to free
475 void ext2_free_blocks(struct inode * inode, ext2_fsblk_t block,
490 if (!ext2_data_block_valid(sbi, block, count)) {
493 "block = %lu, count = %lu", block, count);
497 ext2_debug ("freeing block(s) %lu-%lu\n", block, block + count - 1);
501 block_group = (block - le32_to_cpu(es->s_first_data_block)) /
503 bit = (block - le32_to_cpu(es->s_first_data_block)) %
522 if (in_range (le32_to_cpu(desc->bg_block_bitmap), block, count) ||
523 in_range (le32_to_cpu(desc->bg_inode_bitmap), block, count) ||
524 in_range (block, le32_to_cpu(desc->bg_inode_table),
526 in_range (block + count - 1, le32_to_cpu(desc->bg_inode_table),
531 block, count);
539 "bit already cleared for block %lu", block + i);
553 block += count;
568 * @start: the starting block (group relative) of the search
569 * @bh: bufferhead contains the block group bitmap
570 * @maxblocks: the ending block (group relative) of the reservation
589 * @start: the starting block (group relative) to find next
590 * allocatable block in bitmap.
591 * @bh: bufferhead contains the block group bitmap
592 * @maxblocks: the ending block (group relative) for the search
594 * Find an allocatable block in a bitmap. We perform the "most
595 * appropriate allocation" algorithm of looking for a free block near
608 * block within the next XX blocks.
641 * @group: given allocation block group
642 * @bitmap_bh: bufferhead holds the block bitmap
643 * @grp_goal: given target block within the group
652 * if there is a reservation window, only try to allocate block(s)
654 * Otherwise, the allocation range starts from the give goal block,
655 * ends at the block group's last block.
657 * If we failed to allocate the desired block then we may end up crossing to a
722 * @sb: The super block.
723 * @start_block: The first block we consider to start the real search from
724 * @last_block: The maximum block number that our goal reservable space
740 * @last_block is normally the last block in this group. The search will end
836 * @grp_goal: The goal block relative to the start of the group.
837 * @sb: The super block.
839 * @bitmap_bh: The block group block bitmap.
847 * we check the bitmap for the first free block after it. If there is
848 * no free block until the end of group, then the whole group is full,
849 * we failed. Otherwise, check if the free block is inside the expected
852 * If the first free block is outside the reservable space, then start
853 * from the first free block, we search for next available space, and
857 * list. It contains at least one free block, and it does not overlap
896 * Maybe we could shift the start block of the reservation
897 * window to the first block of next group.
922 * shift the search start to the window near the goal block
948 * to make sure there is at least a free block inside this region.
950 * Search the first free bit on the block bitmap. Search starts from
951 * the start block of the reservable space we just found.
960 * no free block left on the bitmap, no point
972 * check if the first free block is within the
980 * start from where the free block is,
991 * @sb: super block
1033 * @group: given allocation block group
1034 * @bitmap_bh: bufferhead holds the block bitmap
1035 * @grp_goal: given target block within the group
1039 * This is the main function used to allocate a new block and its reservation
1042 * Each time when a new block allocation is need, first try to allocate from
1046 * reservation window for it starting from the goal first. Then do the block
1050 * again when somebody is looking for a free block (without
1070 * or last attempt to allocate a block with reservation turned on failed
1077 * grp_goal is a group relative block number (if there is a goal)
1079 * first block is a filesystem wide block number
1080 * first block is the block number of the first block in this group
1086 * Basically we will allocate a new block from inode's reservation
1091 * b) last attempt to allocate a block from existing reservation
1147 * @sbi: in-core super block structure.
1149 * Check if filesystem has at least 1 free block available for allocation.
1167 * Returns 1 if the passed-in block region is valid; 0 if some part overlaps
1187 * ext2_new_blocks() -- core block(s) allocation function
1189 * @goal: given target block(filesystem wide)
1194 * ext2_new_blocks uses a goal block to assist allocation. If the goal is
1195 * free, or there is a free block within 32 blocks of the goal, that block
1196 * is allocated. Otherwise a forward search is made for a free block; within
1197 * each block group the search first looks for an entire free byte in the block
1208 ext2_grpblk_t grp_target_blk; /* blockgroup relative goal block */
1209 ext2_grpblk_t grp_alloc_blk; /* blockgroup-relative allocated block*/
1210 ext2_fsblk_t ret_block; /* filesyetem-wide allocated block */
1229 * Check quota for allocation of this block.
1241 * Allocate a block from reservation only when the filesystem is
1261 * First, test whether the goal block is free.
1339 * try to allocate block(s) from this group, without a goal(-1).
1351 * just do block allocation as without reservations.
1365 ext2_debug("using block group %d(%d)\n",
1377 "Allocating block in system zone - "
1393 "block("E2FSBLK") >= blocks count(%d) - "
1419 * Undo the block allocation