int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset,

                                int bytes, BdrvRequestFlags flags)

{

    NBDClientSession *client = nbd_get_client_session(bs);

    NBDRequest request = {

        .type = NBD_CMD_WRITE_ZEROES,

        .from = offset,

        .len = bytes,

    };




    if (!(client->info.flags & NBD_FLAG_SEND_WRITE_ZEROES)) {

        return -ENOTSUP;

    }



    if (flags & BDRV_REQ_FUA) {

        assert(client->info.flags & NBD_FLAG_SEND_FUA);

        request.flags |= NBD_CMD_FLAG_FUA;

    }

    if (!(flags & BDRV_REQ_MAY_UNMAP)) {

        request.flags |= NBD_CMD_FLAG_NO_HOLE;

    }



    return nbd_co_request(bs, &request, NULL);

}
int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset,

                                int bytes, BdrvRequestFlags flags)

{

    NBDClientSession *client = nbd_get_client_session(bs);

    NBDRequest request = {

        .type = NBD_CMD_WRITE_ZEROES,

        .from = offset,

        .len = bytes,

    };




    if (!(client->info.flags & NBD_FLAG_SEND_WRITE_ZEROES)) {

        return -ENOTSUP;

    }



    if (flags & BDRV_REQ_FUA) {

        assert(client->info.flags & NBD_FLAG_SEND_FUA);

        request.flags |= NBD_CMD_FLAG_FUA;

    }

    if (!(flags & BDRV_REQ_MAY_UNMAP)) {

        request.flags |= NBD_CMD_FLAG_NO_HOLE;

    }



    return nbd_co_request(bs, &request, NULL);

}
int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,

                                int VAR_2, BdrvRequestFlags VAR_3)

{

    NBDClientSession *client = nbd_get_client_session(VAR_0);

    NBDRequest request = {

        .type = NBD_CMD_WRITE_ZEROES,

        .from = VAR_1,

        .len = VAR_2,

    };




    if (!(client->info.VAR_3 & NBD_FLAG_SEND_WRITE_ZEROES)) {

        return -ENOTSUP;

    }



    if (VAR_3 & BDRV_REQ_FUA) {

        assert(client->info.VAR_3 & NBD_FLAG_SEND_FUA);

        request.VAR_3 |= NBD_CMD_FLAG_FUA;

    }

    if (!(VAR_3 & BDRV_REQ_MAY_UNMAP)) {

        request.VAR_3 |= NBD_CMD_FLAG_NO_HOLE;

    }



    return nbd_co_request(VAR_0, &request, NULL);

}
int FUNC_0(BlockDriverState *VAR_0, int64_t VAR_1,
int VAR_2, BdrvRequestFlags VAR_3)
{ NBDClientSession *client = nbd_get_client_session(VAR_0); NBDRequest request = { .type = NBD_CMD_WRITE_ZEROES,
.from = VAR_1,
.len = VAR_2,
}; if (!(client->info.VAR_3 & NBD_FLAG_SEND_WRITE_ZEROES)) { return -ENOTSUP; } if (VAR_3 & BDRV_REQ_FUA) { assert(client->info.VAR_3 & NBD_FLAG_SEND_FUA); request.VAR_3 |= NBD_CMD_FLAG_FUA; } if (!(VAR_3 & BDRV_REQ_MAY_UNMAP)) { request.VAR_3 |= NBD_CMD_FLAG_NO_HOLE; } return nbd_co_request(VAR_0, &request, NULL); }