Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should this place return i #77

Open
xiaoxiang-kuang opened this issue Jun 14, 2023 · 0 comments
Open

Should this place return i #77

xiaoxiang-kuang opened this issue Jun 14, 2023 · 0 comments

Comments

@xiaoxiang-kuang
Copy link

/* 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant