lkml.org 
[lkml]   [2023]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v3 20/20] ext4: simplify calculation of blkoff in ext4_mb_new_blocks_simple
    Date
    We try to allocate a block from goal in ext4_mb_new_blocks_simple. We
    only need get blkoff in first group with goal and set blkoff to 0 for
    the rest groups.

    Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
    ---
    fs/ext4/mballoc.c | 5 ++---
    1 file changed, 2 insertions(+), 3 deletions(-)

    diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
    index 1103d35b31cb..85d5e219933f 100644
    --- a/fs/ext4/mballoc.c
    +++ b/fs/ext4/mballoc.c
    @@ -5772,9 +5772,6 @@ static ext4_fsblk_t ext4_mb_new_blocks_simple(handle_t *handle,
    return 0;
    }

    - ext4_get_group_no_and_offset(sb,
    - max(ext4_group_first_block_no(sb, group), goal),
    - NULL, &blkoff);
    while (1) {
    i = mb_find_next_zero_bit(bitmap_bh->b_data, max,
    blkoff);
    @@ -5789,6 +5786,8 @@ static ext4_fsblk_t ext4_mb_new_blocks_simple(handle_t *handle,
    brelse(bitmap_bh);
    if (i < max)
    break;
    +
    + blkoff = 0;
    }

    if (group >= ext4_get_groups_count(sb) || i >= max) {
    --
    2.30.0
    \
     
     \ /
      Last update: 2023-03-27 00:42    [W:3.220 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site