void bdrv_round_to_clusters(BlockDriverState *bs,

                            int64_t offset, unsigned int bytes,

                            int64_t *cluster_offset,

                            unsigned int *cluster_bytes)

{

    BlockDriverInfo bdi;



    if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {

        *cluster_offset = offset;

        *cluster_bytes = bytes;

    } else {

        int64_t c = bdi.cluster_size;

        *cluster_offset = QEMU_ALIGN_DOWN(offset, c);

        *cluster_bytes = QEMU_ALIGN_UP(offset - *cluster_offset + bytes, c);

    }

}

void bdrv_round_to_clusters(BlockDriverState *bs,

                            int64_t offset, unsigned int bytes,

                            int64_t *cluster_offset,

                            unsigned int *cluster_bytes)

{

    BlockDriverInfo bdi;



    if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {

        *cluster_offset = offset;

        *cluster_bytes = bytes;

    } else {

        int64_t c = bdi.cluster_size;

        *cluster_offset = QEMU_ALIGN_DOWN(offset, c);

        *cluster_bytes = QEMU_ALIGN_UP(offset - *cluster_offset + bytes, c);

    }

}

                            int64_t offset, unsigned int bytes,                             unsigned int *cluster_bytes)                             int64_t offset, unsigned int bytes,
void FUNC_0(BlockDriverState *VAR_0,

                            int64_t VAR_1, unsigned int VAR_2,

                            int64_t *VAR_3,

                            unsigned int *VAR_4)

{

    BlockDriverInfo bdi;



    if (bdrv_get_info(VAR_0, &bdi) < 0 || bdi.cluster_size == 0) {

        *VAR_3 = VAR_1;

        *VAR_4 = VAR_2;

    } else {

        int64_t c = bdi.cluster_size;

        *VAR_3 = QEMU_ALIGN_DOWN(VAR_1, c);

        *VAR_4 = QEMU_ALIGN_UP(VAR_1 - *VAR_3 + VAR_2, c);

    }

}

void FUNC_0(BlockDriverState *VAR_0,
int64_t VAR_1, unsigned int VAR_2,
int64_t *VAR_3,
unsigned int *VAR_4)
{ BlockDriverInfo bdi; if (bdrv_get_info(VAR_0, &bdi) < 0 || bdi.cluster_size == 0) { *VAR_3 = VAR_1; *VAR_4 = VAR_2; } else { int64_t c = bdi.cluster_size; *VAR_3 = QEMU_ALIGN_DOWN(VAR_1, c); *VAR_4 = QEMU_ALIGN_UP(VAR_1 - *VAR_3 + VAR_2, c); } }