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()
162 gref_size -= (op->count - i); in add_grefs()
284 struct ioctl_gntalloc_alloc_gref op; in gntalloc_ioctl_alloc() local
289 if (copy_from_user(&op, arg, sizeof(op))) { in gntalloc_ioctl_alloc()
294 gref_ids = kcalloc(op.count, sizeof(gref_ids[0]), GFP_TEMPORARY); in gntalloc_ioctl_alloc()
306 if (gref_size + op.count > limit) { in gntalloc_ioctl_alloc()
311 gref_size += op.count; in gntalloc_ioctl_alloc()
312 op.index = priv->index; in gntalloc_ioctl_alloc()
313 priv->index += op.count * PAGE_SIZE; in gntalloc_ioctl_alloc()
316 rc = add_grefs(&op, gref_ids, priv); in gntalloc_ioctl_alloc()
327 if (copy_to_user(arg, &op, sizeof(op))) { in gntalloc_ioctl_alloc()
332 sizeof(gref_ids[0]) * op.count)) { in gntalloc_ioctl_alloc()
347 struct ioctl_gntalloc_dealloc_gref op; in gntalloc_ioctl_dealloc() local
352 if (copy_from_user(&op, arg, sizeof(op))) { in gntalloc_ioctl_dealloc()
358 gref = find_grefs(priv, op.index, op.count); in gntalloc_ioctl_dealloc()
364 for (i = 0; i < op.count; i++) { in gntalloc_ioctl_dealloc()
385 struct ioctl_gntalloc_unmap_notify op; in gntalloc_ioctl_unmap_notify() local
391 if (copy_from_user(&op, arg, sizeof(op))) in gntalloc_ioctl_unmap_notify()
394 index = op.index & ~(PAGE_SIZE - 1); in gntalloc_ioctl_unmap_notify()
395 pgoff = op.index & (PAGE_SIZE - 1); in gntalloc_ioctl_unmap_notify()
405 if (op.action & ~(UNMAP_NOTIFY_CLEAR_BYTE|UNMAP_NOTIFY_SEND_EVENT)) { in gntalloc_ioctl_unmap_notify()
417 if (op.action & UNMAP_NOTIFY_SEND_EVENT) { in gntalloc_ioctl_unmap_notify()
418 if (evtchn_get(op.event_channel_port)) { in gntalloc_ioctl_unmap_notify()
427 gref->notify.flags = op.action; in gntalloc_ioctl_unmap_notify()
429 gref->notify.event = op.event_channel_port; in gntalloc_ioctl_unmap_notify()