From: Vladimir 'phcoder' Serbinenko Date: Thu, 23 Jun 2011 14:45:52 +0000 (+0200) Subject: Support non-512B sectors and agglomerate reads. X-Git-Tag: 2.00~1217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7db6f4a55b6af61b7a1123e8298b913c43c80d1;p=thirdparty%2Fgrub.git Support non-512B sectors and agglomerate reads. * Makefile.util.def (libgrubmods.a): Add grub-core/commands/testload.c. * grub-core/disk/efi/efidisk.c (grub_efidisk_data): Remove disk_io. (disk_io_guid): Removed. (make_devices): Locate solely by BlockIO. (grub_efidisk_open): Fill log_sector_size and total_sectors. (grub_efidisk_read): Use read_blocks. (grub_efidisk_write): Use write_blocks. * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Fill log_sector_size. (get_safe_sectors): Handle non-512B sectors. (grub_biosdisk_read): Remove special CDROM handling. Handle non-512B sectors. (grub_biosdisk_write): Handle non-512B sectors. * grub-core/disk/scsi.c (grub_scsi_open): Fill log_sector_size. (grub_scsi_read): Remove special non-512B block handling (now handled one level up). * grub-core/kern/disk.c (grub_disk_open): Fill default log_sector_size and do sanity checks. (grub_disk_adjust_range): Handle non-512B sectors. (transform_sector): New function. (grub_disk_read_small): Likewise. (grub_disk_read): Rewritten. (grub_disk_write): Handle non-512B sectors. * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Fill log_sector_size. (open_device): Use log_sector_size. (grub_util_biosdisk_read): Likewise. (grub_util_biosdisk_write): Likewise. * grub-core/partmap/msdos.c (grub_partition_msdos_iterate): Handle non-512B sectors. (pc_partition_map_embed): Likewise. * include/grub/disk.h (grub_disk): New field log_sector_size. (GRUB_DISK_CACHE_SIZE): Redefined from GRUB_DISK_CACHE_BITS. (GRUB_DISK_CACHE_BITS): Increased to 6. * util/grub-fstest.c (fstest): New command testload. (argp_parser): Likewise. --- f7db6f4a55b6af61b7a1123e8298b913c43c80d1 diff --cc ChangeLog index 043b858a5,043b858a5..e3ed5d13a --- a/ChangeLog +++ b/ChangeLog @@@ -1,3 -1,3 +1,44 @@@ ++2011-06-23 Vladimir Serbinenko ++ ++ Support non-512B sectors and agglomerate reads. ++ ++ * Makefile.util.def (libgrubmods.a): Add grub-core/commands/testload.c. ++ * grub-core/disk/efi/efidisk.c (grub_efidisk_data): Remove disk_io. ++ (disk_io_guid): Removed. ++ (make_devices): Locate solely by BlockIO. ++ (grub_efidisk_open): Fill log_sector_size and total_sectors. ++ (grub_efidisk_read): Use read_blocks. ++ (grub_efidisk_write): Use write_blocks. ++ * grub-core/disk/i386/pc/biosdisk.c (grub_biosdisk_open): Fill ++ log_sector_size. ++ (get_safe_sectors): Handle non-512B sectors. ++ (grub_biosdisk_read): Remove special CDROM handling. Handle non-512B ++ sectors. ++ (grub_biosdisk_write): Handle non-512B sectors. ++ * grub-core/disk/scsi.c (grub_scsi_open): Fill log_sector_size. ++ (grub_scsi_read): Remove special non-512B block handling (now handled ++ one level up). ++ * grub-core/kern/disk.c (grub_disk_open): Fill default log_sector_size ++ and do sanity checks. ++ (grub_disk_adjust_range): Handle non-512B sectors. ++ (transform_sector): New function. ++ (grub_disk_read_small): Likewise. ++ (grub_disk_read): Rewritten. ++ (grub_disk_write): Handle non-512B sectors. ++ * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Fill ++ log_sector_size. ++ (open_device): Use log_sector_size. ++ (grub_util_biosdisk_read): Likewise. ++ (grub_util_biosdisk_write): Likewise. ++ * grub-core/partmap/msdos.c (grub_partition_msdos_iterate): Handle ++ non-512B sectors. ++ (pc_partition_map_embed): Likewise. ++ * include/grub/disk.h (grub_disk): New field log_sector_size. ++ (GRUB_DISK_CACHE_SIZE): Redefined from GRUB_DISK_CACHE_BITS. ++ (GRUB_DISK_CACHE_BITS): Increased to 6. ++ * util/grub-fstest.c (fstest): New command testload. ++ (argp_parser): Likewise. ++ 2011-06-16 Robert Millan Detect `ataraid' devices on GNU/kFreeBSD. Fix for ATA devices using