mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] - UML - iomem fix
Date: Tue, 14 Sep 2004 15:33:48 -0400	[thread overview]
Message-ID: <200409141933.i8EJXm4W003547@ccure.user-mode-linux.org> (raw)

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: Jeff Dike <jdike@addtoit.com>

Index: 2.6.9-rc2/arch/um/kernel/mem_user.c
===================================================================
--- 2.6.9-rc2.orig/arch/um/kernel/mem_user.c	2004-09-14 13:43:32.000000000 -0400
+++ 2.6.9-rc2/arch/um/kernel/mem_user.c	2004-09-14 13:53:25.000000000 -0400
@@ -143,7 +143,7 @@
 	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 @@
 		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;


                 reply	other threads:[~2004-09-14 18:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200409141933.i8EJXm4W003547@ccure.user-mode-linux.org \
    --to=jdike@addtoit.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®