Lines Matching refs:batch

836 static int gntdev_get_page(struct gntdev_copy_batch *batch, void __user *virt,  in gntdev_get_page()  argument
848 batch->pages[batch->nr_pages++] = page; in gntdev_get_page()
856 static void gntdev_put_pages(struct gntdev_copy_batch *batch) in gntdev_put_pages() argument
860 for (i = 0; i < batch->nr_pages; i++) in gntdev_put_pages()
861 put_page(batch->pages[i]); in gntdev_put_pages()
862 batch->nr_pages = 0; in gntdev_put_pages()
865 static int gntdev_copy(struct gntdev_copy_batch *batch) in gntdev_copy() argument
869 gnttab_batch_copy(batch->ops, batch->nr_ops); in gntdev_copy()
870 gntdev_put_pages(batch); in gntdev_copy()
876 for (i = 0; i < batch->nr_ops; i++) { in gntdev_copy()
877 s16 status = batch->ops[i].status; in gntdev_copy()
883 if (__get_user(old_status, batch->status[i])) in gntdev_copy()
889 if (__put_user(status, batch->status[i])) in gntdev_copy()
893 batch->nr_ops = 0; in gntdev_copy()
897 static int gntdev_grant_copy_seg(struct gntdev_copy_batch *batch, in gntdev_grant_copy_seg() argument
931 if (batch->nr_ops >= GNTDEV_COPY_BATCH) { in gntdev_grant_copy_seg()
932 ret = gntdev_copy(batch); in gntdev_grant_copy_seg()
939 op = &batch->ops[batch->nr_ops]; in gntdev_grant_copy_seg()
952 ret = gntdev_get_page(batch, virt, false, &gfn); in gntdev_grant_copy_seg()
971 ret = gntdev_get_page(batch, virt, true, &gfn); in gntdev_grant_copy_seg()
983 batch->status[batch->nr_ops] = status; in gntdev_grant_copy_seg()
984 batch->nr_ops++; in gntdev_grant_copy_seg()
993 struct gntdev_copy_batch batch; in gntdev_ioctl_grant_copy() local
1000 batch.nr_ops = 0; in gntdev_ioctl_grant_copy()
1001 batch.nr_pages = 0; in gntdev_ioctl_grant_copy()
1011 ret = gntdev_grant_copy_seg(&batch, &seg, &copy.segments[i].status); in gntdev_ioctl_grant_copy()
1017 if (batch.nr_ops) in gntdev_ioctl_grant_copy()
1018 ret = gntdev_copy(&batch); in gntdev_ioctl_grant_copy()
1022 gntdev_put_pages(&batch); in gntdev_ioctl_grant_copy()