IMHO the name of this function is highly misleading. It makes one think
it just checks something, but it actually modifies our variables. I think
"adjust" would fit better than "check".
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What good is a phone call… if you are unable to speak?
(as seen on /.)
diff -x ChangeLog -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/kern/disk.c ./kern/disk.c
--- ../grub2/kern/disk.c 2008-02-08 13:22:51.000000000 +0100
+++ ./kern/disk.c 2008-06-04 16:15:24.000000000 +0200
@@ -323,7 +323,7 @@ grub_disk_close (grub_disk_t disk)
}
static grub_err_t
-grub_disk_check_range (grub_disk_t disk, grub_disk_addr_t *sector,
+grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector,
grub_off_t *offset, grub_size_t size)
{
*sector += *offset >> GRUB_DISK_SECTOR_BITS;
@@ -364,7 +364,7 @@ grub_disk_read (grub_disk_t disk, grub_d
grub_dprintf ("disk", "Reading `%s'...\n", disk->name);
/* First of all, check if the region is within the disk. */
- if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
+ if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
{
grub_error_push ();
grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n",
@@ -502,7 +502,7 @@ grub_disk_write (grub_disk_t disk, grub_
grub_dprintf ("disk", "Writing `%s'...\n", disk->name);
- if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
+ if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE)
return -1;
real_offset = offset;
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel