1 diff -ur lin_tape-3.0.8.orig/lin_tape_scsi_tape.c lin_tape-3.0.8/lin_tape_scsi_tape.c
2 --- lin_tape-3.0.8.orig/lin_tape_scsi_tape.c 2016-02-23 22:16:42.000000000 +0100
3 +++ lin_tape-3.0.8/lin_tape_scsi_tape.c 2016-06-19 13:17:29.632951394 +0200
4 @@ -11480,10 +11480,14 @@
6 memset(pages, '\0', drv->supported_sg_tablesize * sizeof(struct page*));
8 +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
9 + mapped_pages = get_user_pages_unlocked((ulong)user_location, number_pages, rw, 0, pages);
11 down_read(¤t->mm->mmap_sem);
12 mapped_pages = get_user_pages(current, current->mm,
13 (ulong)user_location, number_pages, rw, 0, pages, NULL);
14 up_read(¤t->mm->mmap_sem);
17 if(mapped_pages < number_pages) {
19 @@ -11532,7 +11536,11 @@
22 if(rc < STATUS_SUCCESS)
23 +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
24 + for(i = 0; i < mapped_pages; i++) put_page(pages[i]);
26 for(i = 0; i < mapped_pages; i++) page_cache_release(pages[i]);
28 if(pages_allocd) kfree(pages);
30 } /* lin_tape_get_user_pages() */
31 @@ -11567,7 +11575,11 @@
32 &drv->sg_list->gather[i]))) {
33 SetPageDirty(sg_page(&drv->sg_list->gather[i]));
35 +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
36 + put_page(sg_page(&drv->sg_list->gather[i]));
38 page_cache_release(sg_page(&drv->sg_list->gather[i]));
43 diff -ur lin_tape-3.0.8.orig/stmp.c lin_tape-3.0.8/stmp.c
44 --- lin_tape-3.0.8.orig/stmp.c 2016-06-19 13:17:14.000000000 +0200
45 +++ lin_tape-3.0.8/stmp.c 2016-06-19 13:17:29.632951394 +0200
46 @@ -5329,7 +5329,14 @@
48 if ((pages = kmalloc(max_pages * sizeof(*pages), GFP_KERNEL)) == NULL)
51 +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
52 + res = get_user_pages_unlocked(
56 + 0, /* don't force */
59 /* Try to fault in all of the necessary pages */
60 down_read(¤t->mm->mmap_sem);
61 /* rw==READ means read from drive, write into memory area */
65 up_read(¤t->mm->mmap_sem);
68 /* Errors and no page mapped should return here */
70 @@ -5362,7 +5370,11 @@
73 for (j=0; j < res; j++)
74 +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
77 page_cache_release(pages[j]);
82 @@ -5384,7 +5396,11 @@
83 /* FIXME: cache flush missing for rw==READ
84 * FIXME: call the correct reference counting function
86 +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,5,0)
89 page_cache_release(page);
92 kfree(STbp->mapped_pages);
93 STbp->mapped_pages = NULL;
94 Only in lin_tape-3.0.8: stmp.c.orig