Skip to content

Should this place return i #77

@xiaoxiang-kuang

Description

@xiaoxiang-kuang
/* src/ext4_bitmap.c */
int ext4_bmap_bit_find_clr(uint8_t *bmap, uint32_t sbit, uint32_t ebit,
               uint32_t *bit_id)
{
    uint32_t i;
    uint32_t bcnt = ebit - sbit;

    i = sbit;

    while (i & 7) {

        if (!bcnt)
            return ENOSPC;

        if (ext4_bmap_is_bit_clr(bmap, i)) {
            /* Should this place return i? */
            *bit_id = sbit;
            return EOK;
        }

        i++;
        bcnt--;
    }

This code is about first incomplete byte, and find a clear bit. but it always return “sbit”, Is this correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions