X-Git-Url: https://git.subgeniuskitty.com/xeon-phi-kernel-module/.git/blobdiff_plain/800f879a77716ad833d229ccc058e700c698b039..446ac8fd5bb540e0073bc58deaed4507d3d5a2e6:/micscif/micscif_api.c diff --git a/micscif/micscif_api.c b/micscif/micscif_api.c index e13e59d..a318a73 100644 --- a/micscif/micscif_api.c +++ b/micscif/micscif_api.c @@ -1982,12 +1982,9 @@ retry: } pinned_pages->nr_pages = get_user_pages( - current, - mm, (uint64_t)addr, nr_pages, - !!(prot & SCIF_PROT_WRITE), - 0, + prot & SCIF_PROT_WRITE ? FOLL_WRITE : 0, pinned_pages->pages, pinned_pages->vma); up_write(&mm->mmap_sem); @@ -2007,7 +2004,7 @@ retry: /* Roll back any pinned pages */ for (i = 0; i < pinned_pages->nr_pages; i++) { if (pinned_pages->pages[i]) - page_cache_release(pinned_pages->pages[i]); + put_page(pinned_pages->pages[i]); } prot &= ~SCIF_PROT_WRITE; try_upgrade = false; @@ -2436,13 +2433,13 @@ scif_put_pages(struct scif_range *pages) int ret; struct reg_range_t *window = pages->cookie; struct endpt *ep = (struct endpt *)window->ep; - if (atomic_read(&(&(ep->ref_count))->refcount) > 0) { + if (atomic_read(&(&(&(ep->ref_count))->refcount)->refs) > 0) { kref_get(&(ep->ref_count)); } else { WARN_ON(1); } ret = __scif_put_pages(pages); - if (atomic_read(&(&(ep->ref_count))->refcount) > 0) { + if (atomic_read(&(&(&(ep->ref_count))->refcount)->refs) > 0) { kref_put(&(ep->ref_count), scif_ref_rel); } else { //WARN_ON(1);