* grub-core/kern/disk.c (grub_disk_write): Fix sector number on 4K
sector devices.
This commit is contained in:
parent
f8861eaf9f
commit
4dedb13f51
2 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2013-01-10 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/kern/disk.c (grub_disk_write): Fix sector number on 4K
|
||||||
|
sector devices.
|
||||||
|
|
||||||
2013-01-07 Colin Watson <cjwatson@ubuntu.com>
|
2013-01-07 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
* grub-core/io/bufio.c (grub_bufio_open): Use grub_zalloc instead of
|
* grub-core/io/bufio.c (grub_bufio_open): Use grub_zalloc instead of
|
||||||
|
|
|
@ -658,7 +658,8 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
|
|
||||||
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
|
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
|
||||||
|
|
||||||
if ((disk->dev->write) (disk, sector, 1, tmp_buf) != GRUB_ERR_NONE)
|
if ((disk->dev->write) (disk, transform_sector (disk, sector),
|
||||||
|
1, tmp_buf) != GRUB_ERR_NONE)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
sector += (1 << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
sector += (1 << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
||||||
|
@ -674,11 +675,15 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
|
||||||
len = size & ~((1 << disk->log_sector_size) - 1);
|
len = size & ~((1 << disk->log_sector_size) - 1);
|
||||||
n = size >> disk->log_sector_size;
|
n = size >> disk->log_sector_size;
|
||||||
|
|
||||||
if ((disk->dev->write) (disk, sector, n, buf) != GRUB_ERR_NONE)
|
if ((disk->dev->write) (disk, transform_sector (disk, sector),
|
||||||
|
n, buf) != GRUB_ERR_NONE)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
while (n--)
|
while (n--)
|
||||||
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector++);
|
{
|
||||||
|
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
|
||||||
|
sector += (1 << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS));
|
||||||
|
}
|
||||||
|
|
||||||
buf = (const char *) buf + len;
|
buf = (const char *) buf + len;
|
||||||
size -= len;
|
size -= len;
|
||||||
|
|
Loading…
Reference in a new issue