Whamcloud - gitweb
LU-9183 libcfs: handle get_user_pages() with gup_flags
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-curproc.c
index 91c1ef1..7b2e46e 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -153,7 +149,9 @@ static int cfs_access_process_vm(struct task_struct *tsk,
                int bytes, rc, offset;
                void *maddr;
 
-#ifdef HAVE_GET_USER_PAGES_6ARG
+#if defined(HAVE_GET_USER_PAGES_GUP_FLAGS)
+               rc = get_user_pages(addr, 1, write ? FOLL_WRITE : 0, &page, &vma);
+#elif defined(HAVE_GET_USER_PAGES_6ARG)
                rc = get_user_pages(addr, 1, write, 1, &page, &vma);
 #else
                rc = get_user_pages(tsk, mm, addr, 1, write, 1, &page, &vma);