static inline int cow_set_bit(BlockDriverState *bs, int64_t bitnum)

{

    uint64_t offset = sizeof(struct cow_header_v2) + bitnum / 8;

    uint8_t bitmap;



    if (bdrv_pread(bs->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }



    bitmap |= (1 << (bitnum % 8));



    if (bdrv_pwrite(bs->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }

    return 0;

}

static inline int cow_set_bit(BlockDriverState *bs, int64_t bitnum)

{

    uint64_t offset = sizeof(struct cow_header_v2) + bitnum / 8;

    uint8_t bitmap;



    if (bdrv_pread(bs->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }



    bitmap |= (1 << (bitnum % 8));



    if (bdrv_pwrite(bs->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }

    return 0;

}

    if (bdrv_pread(bs->file, offset, &bitmap, sizeof(bitmap)) != 	    sizeof(bitmap)) {        return -errno;     if (bdrv_pwrite(bs->file, offset, &bitmap, sizeof(bitmap)) != 	    sizeof(bitmap)) {        return -errno;     if (bdrv_pread(bs->file, offset, &bitmap, sizeof(bitmap)) != 	    sizeof(bitmap)) {        return -errno;
static inline int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1)

{

    uint64_t offset = sizeof(struct cow_header_v2) + VAR_1 / 8;

    uint8_t bitmap;



    if (bdrv_pread(VAR_0->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }



    bitmap |= (1 << (VAR_1 % 8));



    if (bdrv_pwrite(VAR_0->file, offset, &bitmap, sizeof(bitmap)) !=

	    sizeof(bitmap)) {

       return -errno;

    }

    return 0;

}

static inline int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1)
{ uint64_t offset = sizeof(struct cow_header_v2) + VAR_1 / 8; uint8_t bitmap; if (bdrv_pread(VAR_0->file, offset, &bitmap, sizeof(bitmap)) !=
sizeof(bitmap)) { return -errno; } bitmap |= (1 << (VAR_1 % 8)); if (bdrv_pwrite(VAR_0->file, offset, &bitmap, sizeof(bitmap)) !=
sizeof(bitmap)) { return -errno; } return 0; }