scst_user: Port to Linux kernel v4.9

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7016 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2016-10-25 20:49:21 +00:00
parent d4227adcb6
commit e837ec7dcd

View File

@@ -1267,8 +1267,13 @@ static int dev_user_map_buf(struct scst_user_cmd *ucmd, unsigned long ubuff,
(ucmd->cmd != NULL) ? ucmd->cmd->bufflen : -1);
down_read(&tsk->mm->mmap_sem);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0)
rc = get_user_pages(ubuff, ucmd->num_data_pages, 1/*writable*/,
0/*don't force*/, ucmd->data_pages, NULL);
#else
rc = get_user_pages(ubuff, ucmd->num_data_pages, FOLL_WRITE,
ucmd->data_pages, NULL);
#endif
up_read(&tsk->mm->mmap_sem);
/* get_user_pages() flushes dcache */