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

« back to all changes in this revision

Viewing changes to ring.c

  • 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:
26
26
#include <linux/poll.h>
27
27
#include <linux/blkdev.h>
28
28
#include <linux/mman.h>
 
29
#include <linux/version.h>
 
30
#include <linux/mm.h>
29
31
 
30
32
#include "blktap.h"
31
33
 
203
205
 
204
206
        pgoff = 1 + request->usr_idx * BLKTAP_SEGMENT_MAX;
205
207
 
 
208
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
206
209
        addr = do_mmap_pgoff(filp, addr, len, prot, flags, pgoff);
 
210
#else
 
211
        addr = vm_mmap(filp, addr, len, prot, flags, pgoff);
 
212
#endif
207
213
 
208
214
        return IS_ERR_VALUE(addr) ? addr : 0;
209
215
}
223
229
        addr  = MMAP_VADDR(ring->user_vstart, request->usr_idx, 0);
224
230
        len   = request->nr_pages << PAGE_SHIFT;
225
231
 
 
232
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
226
233
        err = do_munmap(current->mm, addr, len);
 
234
#else
 
235
        err = vm_munmap(addr, len);
 
236
#endif
227
237
        WARN_ON_ONCE(err);
228
238
}
229
239