static int parse_block_size_shift(BDRVSheepdogState *s, QemuOpts *opt)

{

    struct SheepdogInode *inode = &s->inode;

    uint64_t object_size;

    int obj_order;



    object_size = qemu_opt_get_size_del(opt, BLOCK_OPT_OBJECT_SIZE, 0);

    if (object_size) {

        if ((object_size - 1) & object_size) {    /* not a power of 2? */

            return -EINVAL;

        }

        obj_order = ffs(object_size) - 1;

        if (obj_order < 20 || obj_order > 31) {

            return -EINVAL;

        }

        inode->block_size_shift = (uint8_t)obj_order;

    }



    return 0;

}

static int parse_block_size_shift(BDRVSheepdogState *s, QemuOpts *opt)

{

    struct SheepdogInode *inode = &s->inode;

    uint64_t object_size;

    int obj_order;



    object_size = qemu_opt_get_size_del(opt, BLOCK_OPT_OBJECT_SIZE, 0);

    if (object_size) {

        if ((object_size - 1) & object_size) {    

            return -EINVAL;

        }

        obj_order = ffs(object_size) - 1;

        if (obj_order < 20 || obj_order > 31) {

            return -EINVAL;

        }

        inode->block_size_shift = (uint8_t)obj_order;

    }



    return 0;

}

static int FUNC_0(BDRVSheepdogState *VAR_0, QemuOpts *VAR_1)

{

    struct SheepdogInode *VAR_2 = &VAR_0->VAR_2;

    uint64_t object_size;

    int VAR_3;



    object_size = qemu_opt_get_size_del(VAR_1, BLOCK_OPT_OBJECT_SIZE, 0);

    if (object_size) {

        if ((object_size - 1) & object_size) {    

            return -EINVAL;

        }

        VAR_3 = ffs(object_size) - 1;

        if (VAR_3 < 20 || VAR_3 > 31) {

            return -EINVAL;

        }

        VAR_2->block_size_shift = (uint8_t)VAR_3;

    }



    return 0;

}

static int FUNC_0(BDRVSheepdogState *VAR_0, QemuOpts *VAR_1)
{ struct SheepdogInode *VAR_2 = &VAR_0->VAR_2; uint64_t object_size; int VAR_3; object_size = qemu_opt_get_size_del(VAR_1, BLOCK_OPT_OBJECT_SIZE, 0); if (object_size) { if ((object_size - 1) & object_size) { return -EINVAL; } VAR_3 = ffs(object_size) - 1; if (VAR_3 < 20 || VAR_3 > 31) { return -EINVAL; } VAR_2->block_size_shift = (uint8_t)VAR_3; } return 0; }