--- /dev/null
+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(¤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);