From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [RFC PATCH] Re: [PATCH] biosdisk / open_device() messing up offsets
Date: Tue, 10 Jun 2008 19:18:14 -0400 [thread overview]
Message-ID: <1213139894.2345.13.camel@dv> (raw)
In-Reply-To: <1213138695.2345.4.camel@dv>
Hello!
Here's the patch with some cleanups and nice wrapped lines. I leaving
out other fixes from e3.diff, they should be applied separately and
don't appear to be critical for my setup.
Changelog:
* fs/ext2.c (grub_ext2_blockgroup): Call grub_fshelp_map_block()
for the block that contains data for the requested group.
diff --git a/fs/ext2.c b/fs/ext2.c
index ffe9e33..f8642bb 100644
--- a/fs/ext2.c
+++ b/fs/ext2.c
@@ -257,12 +257,18 @@ inline static grub_err_t
grub_ext2_blockgroup (struct grub_ext2_data *data, int group,
struct grub_ext2_block_group *blkgrp)
{
+ int blkno, blkoff;
+
+ blkoff = group * sizeof (struct grub_ext2_block_group);
+ blkno = blkoff >> (LOG2_EXT2_BLOCK_SIZE (data) + 9);
+ blkoff -= (blkno << (LOG2_EXT2_BLOCK_SIZE (data) + 9));
+ blkno += grub_le_to_cpu32 (data->sblock.first_data_block) + 1;
+
return grub_disk_read (data->disk,
- (grub_fshelp_map_block (data->journal,
- grub_le_to_cpu32 (data->sblock.first_data_block) + 1)
+ (grub_fshelp_map_block (data->journal, blkno)
<< LOG2_EXT2_BLOCK_SIZE (data)),
- group * sizeof (struct grub_ext2_block_group),
- sizeof (struct grub_ext2_block_group), (char *) blkgrp);
+ blkoff, sizeof (struct grub_ext2_block_group),
+ (char *) blkgrp);
}
--
Regards,
Pavel Roskin
next prev parent reply other threads:[~2008-06-10 23:18 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 23:35 [PATCH] biosdisk / open_device() messing up offsets Robert Millan
2008-06-05 1:47 ` Pavel Roskin
2008-06-05 21:12 ` Robert Millan
2008-06-06 15:56 ` Robert Millan
2008-06-06 22:53 ` Pavel Roskin
2008-06-06 23:38 ` Robert Millan
2008-06-07 2:58 ` Pavel Roskin
2008-06-08 19:29 ` Robert Millan
2008-06-07 6:33 ` Pavel Roskin
2008-06-07 7:48 ` Bean
2008-06-08 6:00 ` Pavel Roskin
2008-06-08 6:44 ` Bean
2008-06-08 6:52 ` Pavel Roskin
2008-06-08 7:11 ` Bean
2008-06-08 7:29 ` Pavel Roskin
2008-06-08 11:49 ` Bean
2008-06-08 18:42 ` Pavel Roskin
2008-06-08 18:57 ` Bean
2008-06-09 1:43 ` Pavel Roskin
2008-06-09 18:30 ` Bean
2008-06-10 7:16 ` Bean
2008-06-10 18:26 ` Pavel Roskin
2008-06-10 18:51 ` Bean
2008-06-10 20:19 ` Pavel Roskin
2008-06-10 22:58 ` Pavel Roskin
2008-06-10 23:18 ` Pavel Roskin [this message]
2008-06-11 5:25 ` Bean
2008-06-12 4:01 ` Pavel Roskin
2008-06-12 6:22 ` Pavel Roskin
2008-06-12 9:51 ` Bean
2008-06-12 16:25 ` Pavel Roskin
2008-06-13 3:48 ` Bean
2008-06-13 4:31 ` Pavel Roskin
2008-06-13 4:39 ` Bean
2008-06-13 5:00 ` Pavel Roskin
2008-06-13 5:18 ` Bean
2008-06-07 8:37 ` Bean
2008-06-08 5:41 ` Pavel Roskin
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=1213139894.2345.13.camel@dv \
--to=proski@gnu.org \
--cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.