Lines Matching refs:op
121 static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, in add_grefs() argument
129 readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE); in add_grefs()
131 for (i = 0; i < op->count; i++) { in add_grefs()
138 gref->file_index = op->index + i * PAGE_SIZE; in add_grefs()
144 rc = gnttab_grant_foreign_access(op->domid, in add_grefs()
161 gref_size -= (op->count - i); in add_grefs()
283 struct ioctl_gntalloc_alloc_gref op; in gntalloc_ioctl_alloc() local
288 if (copy_from_user(&op, arg, sizeof(op))) { in gntalloc_ioctl_alloc()
293 gref_ids = kcalloc(op.count, sizeof(gref_ids[0]), GFP_TEMPORARY); in gntalloc_ioctl_alloc()
305 if (gref_size + op.count > limit) { in gntalloc_ioctl_alloc()
310 gref_size += op.count; in gntalloc_ioctl_alloc()
311 op.index = priv->index; in gntalloc_ioctl_alloc()
312 priv->index += op.count * PAGE_SIZE; in gntalloc_ioctl_alloc()
315 rc = add_grefs(&op, gref_ids, priv); in gntalloc_ioctl_alloc()
326 if (copy_to_user(arg, &op, sizeof(op))) { in gntalloc_ioctl_alloc()
331 sizeof(gref_ids[0]) * op.count)) { in gntalloc_ioctl_alloc()
346 struct ioctl_gntalloc_dealloc_gref op; in gntalloc_ioctl_dealloc() local
351 if (copy_from_user(&op, arg, sizeof(op))) { in gntalloc_ioctl_dealloc()
357 gref = find_grefs(priv, op.index, op.count); in gntalloc_ioctl_dealloc()
363 for (i = 0; i < op.count; i++) { in gntalloc_ioctl_dealloc()
384 struct ioctl_gntalloc_unmap_notify op; in gntalloc_ioctl_unmap_notify() local
390 if (copy_from_user(&op, arg, sizeof(op))) in gntalloc_ioctl_unmap_notify()
393 index = op.index & ~(PAGE_SIZE - 1); in gntalloc_ioctl_unmap_notify()
394 pgoff = op.index & (PAGE_SIZE - 1); in gntalloc_ioctl_unmap_notify()
404 if (op.action & ~(UNMAP_NOTIFY_CLEAR_BYTE|UNMAP_NOTIFY_SEND_EVENT)) { in gntalloc_ioctl_unmap_notify()
416 if (op.action & UNMAP_NOTIFY_SEND_EVENT) { in gntalloc_ioctl_unmap_notify()
417 if (evtchn_get(op.event_channel_port)) { in gntalloc_ioctl_unmap_notify()
426 gref->notify.flags = op.action; in gntalloc_ioctl_unmap_notify()
428 gref->notify.event = op.event_channel_port; in gntalloc_ioctl_unmap_notify()