On Thu 28-05-15 16:24:02, Andrew Morton wrote: > On Wed, 13 May 2015 15:08:08 +0200 Jan Kara <jack at suse.cz> wrote: > > > Provide new function get_vaddr_frames(). This function maps virtual > > addresses from given start and fills given array with page frame numbers of > > the corresponding pages. If given start belongs to a normal vma, the > > function > > grabs reference to each of the pages to pin them in memory. If start > > belongs to VM_IO | VM_PFNMAP vma, we don't touch page structures. Caller > > must make sure pfns aren't reused for anything else while he is using > > them. > > > > This function is created for various drivers to simplify handling of > > their buffers. > > > > Acked-by: Mel Gorman <mgorman at suse.de> > > Acked-by: Vlastimil Babka <vbabka at suse.cz> > > Signed-off-by: Jan Kara <jack at suse.cz> > > --- > > include/linux/mm.h | 44 +++++++++++ > > mm/gup.c | 226 > > +++++++++++++++++++++++++++++++++++++++++++++++++++++ > > That's a lump of new code which many kernels won't be needing. Can we > put all this in a new .c file and select it within drivers/media > Kconfig? So the attached patch should do what you had in mind. OK?
Honza -- Jan Kara <jack at suse.cz> SUSE Labs, CR -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-mm-Move-get_vaddr_frames-behind-a-config-option.patch Type: text/x-patch Size: 16447 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20150602/dec9e2f0/attachment.bin>