~mitya57/ubuntu/precise/blktap-dkms/lp1157421

« back to all changes in this revision

Viewing changes to debian/patches/support_kernel_3.4.patch

  • Committer: Dmitry Shachnev
  • Date: 2013-03-21 15:42:41 UTC
  • Revision ID: mitya57@ubuntu.com-20130321154241-1d0aygllqpuupavq
debian/patches/support_kernel_3.4.patch: support kernels >= 3.4,
including 12.04.2 kernel (LP: #1157421)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: fix build failure with Linux kernel >= 3.4
 
2
Author: Dmitry Shachnev <mitya57@ubuntu.com>
 
3
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1157421
 
4
 
 
5
--- a/ring.c
 
6
+++ b/ring.c
 
7
@@ -26,6 +26,8 @@
 
8
 #include <linux/poll.h>
 
9
 #include <linux/blkdev.h>
 
10
 #include <linux/mman.h>
 
11
+#include <linux/version.h>
 
12
+#include <linux/mm.h>
 
13
 
 
14
 #include "blktap.h"
 
15
 
 
16
@@ -203,7 +205,11 @@
 
17
 
 
18
        pgoff = 1 + request->usr_idx * BLKTAP_SEGMENT_MAX;
 
19
 
 
20
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
 
21
        addr = do_mmap_pgoff(filp, addr, len, prot, flags, pgoff);
 
22
+#else
 
23
+       addr = vm_mmap(filp, addr, len, prot, flags, pgoff);
 
24
+#endif
 
25
 
 
26
        return IS_ERR_VALUE(addr) ? addr : 0;
 
27
 }
 
28
@@ -223,7 +229,11 @@
 
29
        addr  = MMAP_VADDR(ring->user_vstart, request->usr_idx, 0);
 
30
        len   = request->nr_pages << PAGE_SHIFT;
 
31
 
 
32
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
 
33
        err = do_munmap(current->mm, addr, len);
 
34
+#else
 
35
+       err = vm_munmap(addr, len);
 
36
+#endif
 
37
        WARN_ON_ONCE(err);
 
38
 }
 
39