]> git.openfabrics.org - ~emulex/for-vlad/old/compat-rdma.git/commitdiff
IB/ipath: backport < 3.2 for pinned_vm field
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 25 Jul 2012 16:34:10 +0000 (12:34 -0400)
committerMike Marciniszyn <mike.marciniszyn@intel.com>
Wed, 25 Jul 2012 16:34:10 +0000 (12:34 -0400)
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
patches/0012-ipath-pinned-vm.patch [new file with mode: 0644]

diff --git a/patches/0012-ipath-pinned-vm.patch b/patches/0012-ipath-pinned-vm.patch
new file mode 100644 (file)
index 0000000..17d62ee
--- /dev/null
@@ -0,0 +1,44 @@
+IB/ipath: backport < 3.2 for pinned_vm field
+
+Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
+
+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(&current->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);