From: Mike Marciniszyn Date: Wed, 25 Jul 2012 16:34:10 +0000 (-0400) Subject: IB/ipath: backport < 3.2 for pinned_vm field X-Git-Tag: vofed-3.5-x~51^2 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=20570e1af0a343fd5ffea343c1ba3a3677e706f9;p=~aditr%2Fcompat-rdma.git IB/ipath: backport < 3.2 for pinned_vm field Signed-off-by: Mike Marciniszyn --- diff --git a/patches/0012-ipath-pinned-vm.patch b/patches/0012-ipath-pinned-vm.patch new file mode 100644 index 0000000..17d62ee --- /dev/null +++ b/patches/0012-ipath-pinned-vm.patch @@ -0,0 +1,44 @@ +IB/ipath: backport < 3.2 for pinned_vm field + +Signed-off-by: Mike Marciniszyn + +diff --git a/drivers/infiniband/hw/ipath/ipath_user_pages.c b/drivers/infiniband/hw/ipath/ipath_user_pages.c +index dc66c45..f2858e6 100644 +--- a/drivers/infiniband/hw/ipath/ipath_user_pages.c ++++ b/drivers/infiniband/hw/ipath/ipath_user_pages.c +@@ -79,7 +79,11 @@ static int __ipath_get_user_pages(unsigned long start_page, size_t num_pages, + goto bail_release; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + current->mm->pinned_vm += num_pages; ++#else ++ current->mm->locked_vm += num_pages; ++#endif + + ret = 0; + goto bail; +@@ -178,7 +182,11 @@ void ipath_release_user_pages(struct page **p, size_t num_pages) + + __ipath_release_user_pages(p, num_pages, 1); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + current->mm->pinned_vm -= num_pages; ++#else ++ current->mm->locked_vm -= num_pages; ++#endif + + up_write(¤t->mm->mmap_sem); + } +@@ -195,7 +203,11 @@ static void user_pages_account(struct work_struct *_work) + container_of(_work, struct ipath_user_pages_work, work); + + down_write(&work->mm->mmap_sem); ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) + work->mm->pinned_vm -= work->num_pages; ++#else ++ work->mm->locked_vm -= work->num_pages; ++#endif + up_write(&work->mm->mmap_sem); + mmput(work->mm); + kfree(work);