struct vhost_blk *blk;
struct list_head single, *head, *node, *tmp;
struct iovec *iov;
struct vhost_blk *blk;
struct list_head single, *head, *node, *tmp;
struct iovec *iov;
uint8_t *aper_va;
struct vring *vring;
unsigned int num;
uint8_t *aper_va;
struct vring *vring;
unsigned int num;
ret = vfs_fsync(vbio->file, 1);
#endif
} else if (vbio->type & VIRTIO_BLK_T_OUT) {
ret = vfs_fsync(vbio->file, 1);
#endif
} else if (vbio->type & VIRTIO_BLK_T_OUT) {
- for (iov = vbio->iov; iov < &vbio->iov[vbio->nvecs]; iov++) {
- iov->iov_base = mic_addr_in_host(aper_va, iov->iov_base);
- }
- ret = vfs_writev(vbio->file, vbio->iov, vbio->nvecs, &pos);
+ for (iov = vbio->iov; iov < &vbio->iov[vbio->nvecs]; iov++) {
+ iov->iov_base = mic_addr_in_host(aper_va, iov->iov_base);
+ }
+ iov_iter_init(&iter, WRITE, vbio->iov, vbio->nvecs, iov_length(vbio->iov, vbio->nvecs));
+ ret = vfs_iter_write(vbio->file, &iter, &pos, 0);
- for (iov = vbio->iov; iov < &vbio->iov[vbio->nvecs]; iov++) {
- iov->iov_base = mic_addr_in_host(aper_va, iov->iov_base);
- }
- ret = vfs_readv(vbio->file, vbio->iov, vbio->nvecs, &pos);
+ for (iov = vbio->iov; iov < &vbio->iov[vbio->nvecs]; iov++) {
+ iov->iov_base = mic_addr_in_host(aper_va, iov->iov_base);
+ }
+ iov_iter_init(&iter, READ, vbio->iov, vbio->nvecs, iov_length(vbio->iov, vbio->nvecs));
+ ret = vfs_iter_read(vbio->file, &iter, &pos, 0);
}
status = (ret < 0) ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK;
if (vbio->head != -1) {
}
status = (ret < 0) ? VIRTIO_BLK_S_IOERR : VIRTIO_BLK_S_OK;
if (vbio->head != -1) {
writel(DISK_SEG_MAX, &vb_shared->blk_config.seg_max);
writel(MIC_SECTOR_SIZE, &vb_shared->blk_config.blk_size);
writel(DISK_SEG_MAX, &vb_shared->blk_config.seg_max);
writel(MIC_SECTOR_SIZE, &vb_shared->blk_config.blk_size);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
- ret = vfs_getattr(&vblk->virtblk_file->f_path, &stat);
-#else
- ret = vfs_getattr(vblk->virtblk_file->f_path.mnt,
- vblk->virtblk_file->f_path.dentry, &stat);
-#endif
+ ret = vfs_getattr(&vblk->virtblk_file->f_path, &stat, STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
if (ret < 0)
goto _exit_;
if (ret < 0)
goto _exit_;