Commit df1ae36a authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Jan Kara

ext2: Fix kernel-doc warnings

Document a few parameters of ext2_alloc_blocks().  Redo the
alloc_new_reservation() and find_next_reservable_window() kernel-doc
entirely.
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20230818201121.2720451-1-willy@infradead.org>
parent 2ebc736c
...@@ -718,36 +718,34 @@ ext2_try_to_allocate(struct super_block *sb, int group, ...@@ -718,36 +718,34 @@ ext2_try_to_allocate(struct super_block *sb, int group,
} }
/** /**
* find_next_reservable_window(): * find_next_reservable_window - Find a reservable space within the given range.
* find a reservable space within the given range. * @search_head: The list to search.
* It does not allocate the reservation window for now: * @my_rsv: The reservation we're currently using.
* alloc_new_reservation() will do the work later. * @sb: The super block.
* @start_block: The first block we consider to start the real search from
* @last_block: The maximum block number that our goal reservable space
* could start from.
* *
* @search_head: the head of the searching list; * It does not allocate the reservation window: alloc_new_reservation()
* This is not necessarily the list head of the whole filesystem * will do the work later.
* *
* We have both head and start_block to assist the search * We search the given range, rather than the whole reservation double
* for the reservable space. The list starts from head, * linked list, (start_block, last_block) to find a free region that is
* but we will shift to the place where start_block is, * of my size and has not been reserved.
* then start from there, when looking for a reservable space.
* *
* @sb: the super block. * @search_head is not necessarily the list head of the whole filesystem.
* We have both head and @start_block to assist the search for the
* reservable space. The list starts from head, but we will shift to
* the place where start_block is, then start from there, when looking
* for a reservable space.
* *
* @start_block: the first block we consider to start the real search from * @last_block is normally the last block in this group. The search will end
* * when we found the start of next possible reservable space is out
* @last_block: * of this boundary. This could handle the cross boundary reservation
* the maximum block number that our goal reservable space * window request.
* could start from. This is normally the last block in this
* group. The search will end when we found the start of next
* possible reservable space is out of this boundary.
* This could handle the cross boundary reservation window
* request.
*
* basically we search from the given range, rather than the whole
* reservation double linked list, (start_block, last_block)
* to find a free region that is of my size and has not
* been reserved.
* *
* Return: -1 if we could not find a range of sufficient size. If we could,
* return 0 and fill in @my_rsv with the range information.
*/ */
static int find_next_reservable_window( static int find_next_reservable_window(
struct ext2_reserve_window_node *search_head, struct ext2_reserve_window_node *search_head,
...@@ -835,41 +833,34 @@ static int find_next_reservable_window( ...@@ -835,41 +833,34 @@ static int find_next_reservable_window(
} }
/** /**
* alloc_new_reservation()--allocate a new reservation window * alloc_new_reservation - Allocate a new reservation window.
* * @my_rsv: The reservation we're currently using.
* To make a new reservation, we search part of the filesystem * @grp_goal: The goal block relative to the start of the group.
* reservation list (the list that inside the group). We try to * @sb: The super block.
* allocate a new reservation window near the allocation goal, * @group: The group we are trying to allocate in.
* or the beginning of the group, if there is no goal. * @bitmap_bh: The block group block bitmap.
*
* We first find a reservable space after the goal, then from
* there, we check the bitmap for the first free block after
* it. If there is no free block until the end of group, then the
* whole group is full, we failed. Otherwise, check if the free
* block is inside the expected reservable space, if so, we
* succeed.
* If the first free block is outside the reservable space, then
* start from the first free block, we search for next available
* space, and go on.
*
* on succeed, a new reservation will be found and inserted into the list
* It contains at least one free block, and it does not overlap with other
* reservation windows.
* *
* failed: we failed to find a reservation window in this group * To make a new reservation, we search part of the filesystem reservation
* list (the list inside the group). We try to allocate a new
* reservation window near @grp_goal, or the beginning of the
* group, if @grp_goal is negative.
* *
* @my_rsv: the reservation * We first find a reservable space after the goal, then from there,
* we check the bitmap for the first free block after it. If there is
* no free block until the end of group, then the whole group is full,
* we failed. Otherwise, check if the free block is inside the expected
* reservable space, if so, we succeed.
* *
* @grp_goal: The goal (group-relative). It is where the search for a * If the first free block is outside the reservable space, then start
* free reservable space should start from. * from the first free block, we search for next available space, and
* if we have a goal(goal >0 ), then start from there, * go on.
* no goal(goal = -1), we start from the first block
* of the group.
* *
* @sb: the super block * on succeed, a new reservation will be found and inserted into the
* @group: the group we are trying to allocate in * list. It contains at least one free block, and it does not overlap
* @bitmap_bh: the block group block bitmap * with other reservation windows.
* *
* Return: 0 on success, -1 if we failed to find a reservation window
* in this group
*/ */
static int alloc_new_reservation(struct ext2_reserve_window_node *my_rsv, static int alloc_new_reservation(struct ext2_reserve_window_node *my_rsv,
ext2_grpblk_t grp_goal, struct super_block *sb, ext2_grpblk_t grp_goal, struct super_block *sb,
......
...@@ -385,12 +385,16 @@ ext2_blks_to_allocate(Indirect * branch, int k, unsigned long blks, ...@@ -385,12 +385,16 @@ ext2_blks_to_allocate(Indirect * branch, int k, unsigned long blks,
} }
/** /**
* ext2_alloc_blocks: multiple allocate blocks needed for a branch * ext2_alloc_blocks: Allocate multiple blocks needed for a branch.
* @indirect_blks: the number of blocks need to allocate for indirect * @inode: Owner.
* blocks * @goal: Preferred place for allocation.
* @blks: the number of blocks need to allocate for direct blocks * @indirect_blks: The number of blocks needed to allocate for indirect blocks.
* @new_blocks: on return it will store the new block numbers for * @blks: The number of blocks need to allocate for direct blocks.
* the indirect blocks(if needed) and the first direct block, * @new_blocks: On return it will store the new block numbers for
* the indirect blocks(if needed) and the first direct block.
* @err: Error pointer.
*
* Return: Number of blocks allocated.
*/ */
static int ext2_alloc_blocks(struct inode *inode, static int ext2_alloc_blocks(struct inode *inode,
ext2_fsblk_t goal, int indirect_blks, int blks, ext2_fsblk_t goal, int indirect_blks, int blks,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment