[openib-general] Re: [PATCH] AIO code to use get_user_pages

Michael S. Tsirkin mst at mellanox.co.il
Thu Mar 10 06:17:01 PST 2005


Quoting r. Michael S. Tsirkin <mst at mellanox.co.il>:
> Subject: [PATCH] AIO code to use get_user_pages
> 
> Well, I went ahead and modified the AIO code to use get_user_pages.
> Since we dont yet have fmr support, this patch is untested, but it
> does compile :) Please let me know what do you think.
> 
> Another approach (instead of waiting for fmr support) could be
> to add a fall-back option to use a regular memory region.
> A todo item is to add zcopy support for synchronous operations.

It seems I tried to use the same kmap slot twice. Thats not right.
Here's a small patch to apply on top of that.

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

--- sdp/sdp_iocb.c	2005-03-10 11:28:02.000000000 +0200
+++ sdp-fix//sdp_iocb.c	2005-03-10 13:36:28.000000000 +0200
@@ -48,11 +48,11 @@ static void sdp_copy_one_page(struct pag
 	void* tptr;
 
 	fptr = kmap_atomic(from, KM_USER0);
-	tptr = kmap_atomic(to, KM_USER0);
+	tptr = kmap_atomic(to, KM_USER1);
 
 	memcpy(tptr + offset, fptr + offset, size);
 
-	kunmap_atomic(tptr, KM_USER0);
+	kunmap_atomic(tptr, KM_USER1);
 	kunmap_atomic(fptr, KM_USER0);
 	set_page_dirty_lock(to);
 }

-- 
MST - Michael S. Tsirkin



More information about the general mailing list