summaryrefslogtreecommitdiffstats
path: root/driver/umem.c
diff options
context:
space:
mode:
Diffstat (limited to 'driver/umem.c')
-rw-r--r--driver/umem.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/driver/umem.c b/driver/umem.c
index 8d73207..e643102 100644
--- a/driver/umem.c
+++ b/driver/umem.c
@@ -81,15 +81,7 @@ int pcidriver_umem_sgmap(pcidriver_privdata_t *privdata, umem_handle_t *umem_han
/* Get the page information */
down_read(&current->mm->mmap_sem);
- res = get_user_pages(
- current,
- current->mm,
- umem_handle->vma,
- nr_pages,
- 1,
- 0, /* do not force, FIXME: shall I? */
- pages,
- NULL );
+ res = get_user_pages_compat(umem_handle->vma, nr_pages, pages);
up_read(&current->mm->mmap_sem);
/* Error, not all pages mapped */
@@ -106,7 +98,7 @@ int pcidriver_umem_sgmap(pcidriver_privdata_t *privdata, umem_handle_t *umem_han
/* Lock the pages, then populate the SG list with the pages */
/* page0 is different */
if ( !PageReserved(pages[0]) )
- __set_page_locked(pages[0]);
+ lock_page(pages[0]);
offset = (umem_handle->vma & ~PAGE_MASK);
length = (umem_handle->size > (PAGE_SIZE-offset) ? (PAGE_SIZE-offset) : umem_handle->size);
@@ -117,7 +109,7 @@ int pcidriver_umem_sgmap(pcidriver_privdata_t *privdata, umem_handle_t *umem_han
for(i=1; i<nr_pages; i++) {
/* Lock page first */
if ( !PageReserved(pages[i]) )
- __set_page_locked(pages[i]);
+ lock_page(pages[i]);
/* Populate the list */
sg_set_page(&sg[i], pages[i], ((count > PAGE_SIZE) ? PAGE_SIZE : count), 0);
@@ -166,10 +158,10 @@ umem_sgmap_unmap:
if (nr_pages > 0) {
for(i=0; i<nr_pages; i++) {
if (PageLocked(pages[i]))
- __clear_page_locked(pages[i]);
+ unlock_page(pages[i]);
if (!PageReserved(pages[i]))
set_page_dirty(pages[i]);
- page_cache_release(pages[i]);
+ put_page(pages[i]);
}
}
vfree(sg);
@@ -198,10 +190,10 @@ int pcidriver_umem_sgunmap(pcidriver_privdata_t *privdata, pcidriver_umem_entry_
/* Mark pages as Dirty and unlock it */
if ( !PageReserved( umem_entry->pages[i] )) {
SetPageDirty( umem_entry->pages[i] );
- __clear_page_locked(umem_entry->pages[i]);
+ unlock_page(umem_entry->pages[i]);
}
/* and release it from the cache */
- page_cache_release( umem_entry->pages[i] );
+ put_page( umem_entry->pages[i] );
}
}