Lines Matching full:bounce
127 static int dmirror_bounce_init(struct dmirror_bounce *bounce, in dmirror_bounce_init() argument
131 bounce->addr = addr; in dmirror_bounce_init()
132 bounce->size = size; in dmirror_bounce_init()
133 bounce->cpages = 0; in dmirror_bounce_init()
134 bounce->ptr = vmalloc(size); in dmirror_bounce_init()
135 if (!bounce->ptr) in dmirror_bounce_init()
155 static void dmirror_bounce_fini(struct dmirror_bounce *bounce) in dmirror_bounce_fini() argument
157 vfree(bounce->ptr); in dmirror_bounce_fini()
361 unsigned long end, struct dmirror_bounce *bounce) in dmirror_do_read() argument
366 ptr = bounce->ptr + ((start - bounce->addr) & PAGE_MASK); in dmirror_do_read()
380 bounce->cpages++; in dmirror_do_read()
388 struct dmirror_bounce bounce; in dmirror_read() local
398 ret = dmirror_bounce_init(&bounce, start, size); in dmirror_read()
404 ret = dmirror_do_read(dmirror, start, end, &bounce); in dmirror_read()
409 start = cmd->addr + (bounce.cpages << PAGE_SHIFT); in dmirror_read()
417 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr, in dmirror_read()
418 bounce.size)) in dmirror_read()
421 cmd->cpages = bounce.cpages; in dmirror_read()
422 dmirror_bounce_fini(&bounce); in dmirror_read()
427 unsigned long end, struct dmirror_bounce *bounce) in dmirror_do_write() argument
432 ptr = bounce->ptr + ((start - bounce->addr) & PAGE_MASK); in dmirror_do_write()
446 bounce->cpages++; in dmirror_do_write()
454 struct dmirror_bounce bounce; in dmirror_write() local
464 ret = dmirror_bounce_init(&bounce, start, size); in dmirror_write()
467 if (copy_from_user(bounce.ptr, u64_to_user_ptr(cmd->ptr), in dmirror_write()
468 bounce.size)) { in dmirror_write()
475 ret = dmirror_do_write(dmirror, start, end, &bounce); in dmirror_write()
480 start = cmd->addr + (bounce.cpages << PAGE_SHIFT); in dmirror_write()
488 cmd->cpages = bounce.cpages; in dmirror_write()
489 dmirror_bounce_fini(&bounce); in dmirror_write()
784 struct dmirror_bounce bounce; in dmirror_exclusive() local
829 ret = dmirror_bounce_init(&bounce, start, size); in dmirror_exclusive()
833 ret = dmirror_do_read(dmirror, start, end, &bounce); in dmirror_exclusive()
836 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr, in dmirror_exclusive()
837 bounce.size)) in dmirror_exclusive()
841 cmd->cpages = bounce.cpages; in dmirror_exclusive()
842 dmirror_bounce_fini(&bounce); in dmirror_exclusive()
966 struct dmirror_bounce bounce; in dmirror_migrate_to_device() local
1015 ret = dmirror_bounce_init(&bounce, start, size); in dmirror_migrate_to_device()
1019 ret = dmirror_do_read(dmirror, start, end, &bounce); in dmirror_migrate_to_device()
1022 if (copy_to_user(u64_to_user_ptr(cmd->ptr), bounce.ptr, in dmirror_migrate_to_device()
1023 bounce.size)) in dmirror_migrate_to_device()
1026 cmd->cpages = bounce.cpages; in dmirror_migrate_to_device()
1027 dmirror_bounce_fini(&bounce); in dmirror_migrate_to_device()