UIO: Fix mapping of logical and virtual memory
authorAndrew G. Harvey <agh@cisco.com>
Tue, 23 Sep 2008 23:10:02 +0000 (01:10 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Oct 2008 16:24:54 +0000 (09:24 -0700)
mmap() doesn't work as expected for UIO_MEM_LOGICAL or UIO_MEM_VIRTUAL
mappings. The offset into the memory needs to be added, otherwise
uio_vma_fault always returns the first page only. Note that for UIO
userspace calls mmap() with offset = N * getpagesize() to access
mapping N. This must be compensated when calculating the offset. A
comment was added to explain this since it is not obvious.

Signed-off-by: Andrew G. Harvey <agh@cisco.com>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

No differences found