static void flash_sync_page(Flash *s, int page)

{

    int bdrv_sector, nb_sectors;

    QEMUIOVector iov;



    if (!s->bdrv || bdrv_is_read_only(s->bdrv)) {

        return;

    }



    bdrv_sector = (page * s->pi->page_size) / BDRV_SECTOR_SIZE;

    nb_sectors = DIV_ROUND_UP(s->pi->page_size, BDRV_SECTOR_SIZE);

    qemu_iovec_init(&iov, 1);

    qemu_iovec_add(&iov, s->storage + bdrv_sector * BDRV_SECTOR_SIZE,

                   nb_sectors * BDRV_SECTOR_SIZE);

    bdrv_aio_writev(s->bdrv, bdrv_sector, &iov, nb_sectors, bdrv_sync_complete,

                    NULL);

}

static void flash_sync_page(Flash *s, int page)

{

    int bdrv_sector, nb_sectors;

    QEMUIOVector iov;



    if (!s->bdrv || bdrv_is_read_only(s->bdrv)) {

        return;

    }



    bdrv_sector = (page * s->pi->page_size) / BDRV_SECTOR_SIZE;

    nb_sectors = DIV_ROUND_UP(s->pi->page_size, BDRV_SECTOR_SIZE);

    qemu_iovec_init(&iov, 1);

    qemu_iovec_add(&iov, s->storage + bdrv_sector * BDRV_SECTOR_SIZE,

                   nb_sectors * BDRV_SECTOR_SIZE);

    bdrv_aio_writev(s->bdrv, bdrv_sector, &iov, nb_sectors, bdrv_sync_complete,

                    NULL);

}

static void FUNC_0(Flash *VAR_0, int VAR_1)

{

    int VAR_2, VAR_3;

    QEMUIOVector iov;



    if (!VAR_0->bdrv || bdrv_is_read_only(VAR_0->bdrv)) {

        return;

    }



    VAR_2 = (VAR_1 * VAR_0->pi->page_size) / BDRV_SECTOR_SIZE;

    VAR_3 = DIV_ROUND_UP(VAR_0->pi->page_size, BDRV_SECTOR_SIZE);

    qemu_iovec_init(&iov, 1);

    qemu_iovec_add(&iov, VAR_0->storage + VAR_2 * BDRV_SECTOR_SIZE,

                   VAR_3 * BDRV_SECTOR_SIZE);

    bdrv_aio_writev(VAR_0->bdrv, VAR_2, &iov, VAR_3, bdrv_sync_complete,

                    NULL);

}

static void FUNC_0(Flash *VAR_0, int VAR_1)
{ int VAR_2, VAR_3; QEMUIOVector iov; if (!VAR_0->bdrv || bdrv_is_read_only(VAR_0->bdrv)) { return; } VAR_2 = (VAR_1 * VAR_0->pi->page_size) / BDRV_SECTOR_SIZE; VAR_3 = DIV_ROUND_UP(VAR_0->pi->page_size, BDRV_SECTOR_SIZE); qemu_iovec_init(&iov, 1); qemu_iovec_add(&iov, VAR_0->storage + VAR_2 * BDRV_SECTOR_SIZE,
VAR_3 * BDRV_SECTOR_SIZE); bdrv_aio_writev(VAR_0->bdrv, VAR_2, &iov, VAR_3, bdrv_sync_complete,
NULL); }