From: Jeff Dike <jdike@addtoit.com>
To: akpm@osdl.org, Blaisorblade <blaisorblade@yahoo.it>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/10] UML - allow ubd devices to provide partial end blocks
Date: Mon, 17 Jan 2005 00:56:08 -0500 [thread overview]
Message-ID: <200501170556.j0H5u8kY006057@ccure.user-mode-linux.org> (raw)
If the file backing a ubd device is not an even blocklength, then the last
partial block is now readable, and it is padded with zeros.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Index: 2.6.10/arch/um/drivers/ubd_kern.c
===================================================================
--- 2.6.10.orig/arch/um/drivers/ubd_kern.c 2005-01-16 20:37:24.000000000 -0500
+++ 2.6.10/arch/um/drivers/ubd_kern.c 2005-01-16 20:40:41.000000000 -0500
@@ -682,6 +682,8 @@
return 0;
}
+#define ROUND_BLOCK(n) ((n + ((1 << 9) - 1)) & (-1 << 9))
+
static int ubd_add(int n)
{
struct ubd *dev = &ubd_dev[n];
@@ -697,6 +699,8 @@
if(err < 0)
return(err);
+ dev->size = ROUND_BLOCK(dev->size);
+
err = ubd_new_disk(MAJOR_NR, dev->size, n, &ubd_gendisk[n]);
if(err)
return(err);
reply other threads:[~2005-01-17 3:35 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=200501170556.j0H5u8kY006057@ccure.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@osdl.org \
--cc=blaisorblade@yahoo.it \
--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®