Commit 74c81f8c authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

[PATCH] uml: iomem fix

This patch rounds up the size of a file used for iomem emulation up to the
nearest page.  This makes mmap work much better on the last page of the
file.
Signed-off-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1f9961ab
......@@ -143,7 +143,7 @@ static int __init parse_iomem(char *str, int *add)
struct iomem_region *new;
struct uml_stat buf;
char *file, *driver;
int fd, err;
int fd, err, size;
driver = str;
file = strchr(str,',');
......@@ -171,10 +171,12 @@ static int __init parse_iomem(char *str, int *add)
goto out_close;
}
size = (buf.ust_size + UM_KERN_PAGE_SIZE) & ~(UM_KERN_PAGE_SIZE - 1);
*new = ((struct iomem_region) { .next = iomem_regions,
.driver = driver,
.fd = fd,
.size = buf.ust_size,
.size = size,
.phys = 0,
.virt = 0 });
iomem_regions = new;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment