int nbd_client_session_co_readv(NbdClientSession *client, int64_t sector_num,

    int nb_sectors, QEMUIOVector *qiov)

{

    int offset = 0;

    int ret;

    while (nb_sectors > NBD_MAX_SECTORS) {

        ret = nbd_co_readv_1(client, sector_num,

                             NBD_MAX_SECTORS, qiov, offset);

        if (ret < 0) {

            return ret;

        }

        offset += NBD_MAX_SECTORS * 512;

        sector_num += NBD_MAX_SECTORS;

        nb_sectors -= NBD_MAX_SECTORS;

    }

    return nbd_co_readv_1(client, sector_num, nb_sectors, qiov, offset);

}

int nbd_client_session_co_readv(NbdClientSession *client, int64_t sector_num,

    int nb_sectors, QEMUIOVector *qiov)

{

    int offset = 0;

    int ret;

    while (nb_sectors > NBD_MAX_SECTORS) {

        ret = nbd_co_readv_1(client, sector_num,

                             NBD_MAX_SECTORS, qiov, offset);

        if (ret < 0) {

            return ret;

        }

        offset += NBD_MAX_SECTORS * 512;

        sector_num += NBD_MAX_SECTORS;

        nb_sectors -= NBD_MAX_SECTORS;

    }

    return nbd_co_readv_1(client, sector_num, nb_sectors, qiov, offset);

}

int FUNC_0(NbdClientSession *VAR_0, int64_t VAR_1,

    int VAR_2, QEMUIOVector *VAR_3)

{

    int VAR_4 = 0;

    int VAR_5;

    while (VAR_2 > NBD_MAX_SECTORS) {

        VAR_5 = nbd_co_readv_1(VAR_0, VAR_1,

                             NBD_MAX_SECTORS, VAR_3, VAR_4);

        if (VAR_5 < 0) {

            return VAR_5;

        }

        VAR_4 += NBD_MAX_SECTORS * 512;

        VAR_1 += NBD_MAX_SECTORS;

        VAR_2 -= NBD_MAX_SECTORS;

    }

    return nbd_co_readv_1(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4);

}

int FUNC_0(NbdClientSession *VAR_0, int64_t VAR_1,
int VAR_2, QEMUIOVector *VAR_3)
{ int VAR_4 = 0; int VAR_5; while (VAR_2 > NBD_MAX_SECTORS) { VAR_5 = nbd_co_readv_1(VAR_0, VAR_1,
NBD_MAX_SECTORS, VAR_3, VAR_4); if (VAR_5 < 0) { return VAR_5; } VAR_4 += NBD_MAX_SECTORS * 512; VAR_1 += NBD_MAX_SECTORS; VAR_2 -= NBD_MAX_SECTORS; } return nbd_co_readv_1(VAR_0, VAR_1, VAR_2, VAR_3, VAR_4); }