Rename grub_disk members

Otherwise it horribly clashes with gnulib when it's
replacing open/write/read/close

Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
This commit is contained in:
Vladimir Serbinenko 2019-03-22 17:07:00 +01:00 committed by Vincent Batts
parent 4745ee216c
commit f762850a1c
23 changed files with 135 additions and 135 deletions

View file

@ -296,11 +296,11 @@ static struct grub_disk_dev grub_arcdisk_dev =
{
.name = "arcdisk",
.id = GRUB_DISK_DEVICE_ARCDISK_ID,
.iterate = grub_arcdisk_iterate,
.open = grub_arcdisk_open,
.close = grub_arcdisk_close,
.read = grub_arcdisk_read,
.write = grub_arcdisk_write,
.disk_iterate = grub_arcdisk_iterate,
.disk_open = grub_arcdisk_open,
.disk_close = grub_arcdisk_close,
.disk_read = grub_arcdisk_read,
.disk_write = grub_arcdisk_write,
.next = 0
};

View file

@ -510,11 +510,11 @@ static struct grub_disk_dev grub_atadisk_dev =
{
.name = "ATA",
.id = GRUB_DISK_DEVICE_ATA_ID,
.iterate = grub_ata_iterate,
.open = grub_ata_open,
.close = grub_ata_close,
.read = grub_ata_read,
.write = grub_ata_write,
.disk_iterate = grub_ata_iterate,
.disk_open = grub_ata_open,
.disk_close = grub_ata_close,
.disk_read = grub_ata_read,
.disk_write = grub_ata_write,
.next = 0
};

View file

@ -1015,13 +1015,13 @@ grub_cmd_cryptomount (grub_extcmd_context_t ctxt, int argc, char **args)
static struct grub_disk_dev grub_cryptodisk_dev = {
.name = "cryptodisk",
.id = GRUB_DISK_DEVICE_CRYPTODISK_ID,
.iterate = grub_cryptodisk_iterate,
.open = grub_cryptodisk_open,
.close = grub_cryptodisk_close,
.read = grub_cryptodisk_read,
.write = grub_cryptodisk_write,
.disk_iterate = grub_cryptodisk_iterate,
.disk_open = grub_cryptodisk_open,
.disk_close = grub_cryptodisk_close,
.disk_read = grub_cryptodisk_read,
.disk_write = grub_cryptodisk_write,
#ifdef GRUB_UTIL
.memberlist = grub_cryptodisk_memberlist,
.disk_memberlist = grub_cryptodisk_memberlist,
#endif
.next = 0
};

View file

@ -228,9 +228,9 @@ scan_devices (const char *arname)
for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
for (p = grub_disk_dev_list; p; p = p->next)
if (p->id != GRUB_DISK_DEVICE_DISKFILTER_ID
&& p->iterate)
&& p->disk_iterate)
{
if ((p->iterate) (scan_disk_hook, NULL, pull))
if ((p->disk_iterate) (scan_disk_hook, NULL, pull))
return;
if (arname && is_lv_readable (find_lv (arname), 1))
return;
@ -311,9 +311,9 @@ grub_diskfilter_memberlist (grub_disk_t disk)
for (pull = 0; pv && pull < GRUB_DISK_PULL_MAX; pull++)
for (p = grub_disk_dev_list; pv && p; p = p->next)
if (p->id != GRUB_DISK_DEVICE_DISKFILTER_ID
&& p->iterate)
&& p->disk_iterate)
{
(p->iterate) (scan_disk_hook, NULL, pull);
(p->disk_iterate) (scan_disk_hook, NULL, pull);
while (pv && pv->disk)
pv = pv->next;
}
@ -1325,14 +1325,14 @@ static struct grub_disk_dev grub_diskfilter_dev =
{
.name = "diskfilter",
.id = GRUB_DISK_DEVICE_DISKFILTER_ID,
.iterate = grub_diskfilter_iterate,
.open = grub_diskfilter_open,
.close = grub_diskfilter_close,
.read = grub_diskfilter_read,
.write = grub_diskfilter_write,
.disk_iterate = grub_diskfilter_iterate,
.disk_open = grub_diskfilter_open,
.disk_close = grub_diskfilter_close,
.disk_read = grub_diskfilter_read,
.disk_write = grub_diskfilter_write,
#ifdef GRUB_UTIL
.memberlist = grub_diskfilter_memberlist,
.raidname = grub_diskfilter_getname,
.disk_memberlist = grub_diskfilter_memberlist,
.disk_raidname = grub_diskfilter_getname,
#endif
.next = 0
};

View file

@ -627,11 +627,11 @@ static struct grub_disk_dev grub_efidisk_dev =
{
.name = "efidisk",
.id = GRUB_DISK_DEVICE_EFIDISK_ID,
.iterate = grub_efidisk_iterate,
.open = grub_efidisk_open,
.close = grub_efidisk_close,
.read = grub_efidisk_read,
.write = grub_efidisk_write,
.disk_iterate = grub_efidisk_iterate,
.disk_open = grub_efidisk_open,
.disk_close = grub_efidisk_close,
.disk_read = grub_efidisk_read,
.disk_write = grub_efidisk_write,
.next = 0
};

View file

@ -84,11 +84,11 @@ static struct grub_disk_dev grub_host_dev =
/* The only important line in this file :-) */
.name = "host",
.id = GRUB_DISK_DEVICE_HOST_ID,
.iterate = grub_host_iterate,
.open = grub_host_open,
.close = grub_host_close,
.read = grub_host_read,
.write = grub_host_write,
.disk_iterate = grub_host_iterate,
.disk_open = grub_host_open,
.disk_close = grub_host_close,
.disk_read = grub_host_read,
.disk_write = grub_host_write,
.next = 0
};

View file

@ -660,11 +660,11 @@ static struct grub_disk_dev grub_biosdisk_dev =
{
.name = "biosdisk",
.id = GRUB_DISK_DEVICE_BIOSDISK_ID,
.iterate = grub_biosdisk_iterate,
.open = grub_biosdisk_open,
.close = grub_biosdisk_close,
.read = grub_biosdisk_read,
.write = grub_biosdisk_write,
.disk_iterate = grub_biosdisk_iterate,
.disk_open = grub_biosdisk_open,
.disk_close = grub_biosdisk_close,
.disk_read = grub_biosdisk_read,
.disk_write = grub_biosdisk_write,
.next = 0
};

View file

@ -223,11 +223,11 @@ static struct grub_disk_dev grub_nand_dev =
{
.name = "nand",
.id = GRUB_DISK_DEVICE_NAND_ID,
.iterate = grub_nand_iterate,
.open = grub_nand_open,
.close = grub_nand_close,
.read = grub_nand_read,
.write = grub_nand_write,
.disk_iterate = grub_nand_iterate,
.disk_open = grub_nand_open,
.disk_close = grub_nand_close,
.disk_read = grub_nand_read,
.disk_write = grub_nand_write,
.next = 0
};

View file

@ -1047,10 +1047,10 @@ static struct grub_disk_dev grub_obdisk_dev =
{
.name = "obdisk",
.id = GRUB_DISK_DEVICE_OBDISK_ID,
.iterate = grub_obdisk_iterate,
.open = grub_obdisk_open,
.close = grub_obdisk_close,
.read = grub_obdisk_read,
.disk_iterate = grub_obdisk_iterate,
.disk_open = grub_obdisk_open,
.disk_close = grub_obdisk_close,
.disk_read = grub_obdisk_read,
};
void

View file

@ -615,11 +615,11 @@ static struct grub_disk_dev grub_ofdisk_dev =
{
.name = "ofdisk",
.id = GRUB_DISK_DEVICE_OFDISK_ID,
.iterate = grub_ofdisk_iterate,
.open = grub_ofdisk_open,
.close = grub_ofdisk_close,
.read = grub_ofdisk_read,
.write = grub_ofdisk_write,
.disk_iterate = grub_ofdisk_iterate,
.disk_open = grub_ofdisk_open,
.disk_close = grub_ofdisk_close,
.disk_read = grub_ofdisk_read,
.disk_write = grub_ofdisk_write,
.next = 0
};

View file

@ -222,10 +222,10 @@ static struct grub_disk_dev grub_loopback_dev =
{
.name = "loopback",
.id = GRUB_DISK_DEVICE_LOOPBACK_ID,
.iterate = grub_loopback_iterate,
.open = grub_loopback_open,
.read = grub_loopback_read,
.write = grub_loopback_write,
.disk_iterate = grub_loopback_iterate,
.disk_open = grub_loopback_open,
.disk_read = grub_loopback_read,
.disk_write = grub_loopback_write,
.next = 0
};

View file

@ -77,11 +77,11 @@ static struct grub_disk_dev grub_memdisk_dev =
{
.name = "memdisk",
.id = GRUB_DISK_DEVICE_MEMDISK_ID,
.iterate = grub_memdisk_iterate,
.open = grub_memdisk_open,
.close = grub_memdisk_close,
.read = grub_memdisk_read,
.write = grub_memdisk_write,
.disk_iterate = grub_memdisk_iterate,
.disk_open = grub_memdisk_open,
.disk_close = grub_memdisk_close,
.disk_read = grub_memdisk_read,
.disk_write = grub_memdisk_write,
.next = 0
};

View file

@ -747,11 +747,11 @@ static struct grub_disk_dev grub_scsi_dev =
{
.name = "scsi",
.id = GRUB_DISK_DEVICE_SCSI_ID,
.iterate = grub_scsi_iterate,
.open = grub_scsi_open,
.close = grub_scsi_close,
.read = grub_scsi_read,
.write = grub_scsi_write,
.disk_iterate = grub_scsi_iterate,
.disk_open = grub_scsi_open,
.disk_close = grub_scsi_close,
.disk_read = grub_scsi_read,
.disk_write = grub_scsi_write,
.next = 0
};

View file

@ -286,11 +286,11 @@ uboot_disk_write (struct grub_disk *disk,
static struct grub_disk_dev grub_ubootdisk_dev = {
.name = "ubootdisk",
.id = GRUB_DISK_DEVICE_UBOOTDISK_ID,
.iterate = uboot_disk_iterate,
.open = uboot_disk_open,
.close = uboot_disk_close,
.read = uboot_disk_read,
.write = uboot_disk_write,
.disk_iterate = uboot_disk_iterate,
.disk_open = uboot_disk_open,
.disk_close = uboot_disk_close,
.disk_read = uboot_disk_read,
.disk_write = uboot_disk_write,
.next = 0
};

View file

@ -249,11 +249,11 @@ grub_virtdisk_write (grub_disk_t disk, grub_disk_addr_t sector,
static struct grub_disk_dev grub_virtdisk_dev = {
.name = "xen",
.id = GRUB_DISK_DEVICE_XEN,
.iterate = grub_virtdisk_iterate,
.open = grub_virtdisk_open,
.close = grub_virtdisk_close,
.read = grub_virtdisk_read,
.write = grub_virtdisk_write,
.disk_iterate = grub_virtdisk_iterate,
.disk_open = grub_virtdisk_open,
.disk_close = grub_virtdisk_close,
.disk_read = grub_virtdisk_read,
.disk_write = grub_virtdisk_write,
.next = 0
};

View file

@ -328,11 +328,11 @@ static struct grub_disk_dev grub_cbfsdisk_dev =
{
.name = "cbfsdisk",
.id = GRUB_DISK_DEVICE_CBFSDISK_ID,
.iterate = grub_cbfsdisk_iterate,
.open = grub_cbfsdisk_open,
.close = grub_cbfsdisk_close,
.read = grub_cbfsdisk_read,
.write = grub_cbfsdisk_write,
.disk_iterate = grub_cbfsdisk_iterate,
.disk_open = grub_cbfsdisk_open,
.disk_close = grub_cbfsdisk_close,
.disk_read = grub_cbfsdisk_read,
.disk_write = grub_cbfsdisk_write,
.next = 0
};

View file

@ -172,11 +172,11 @@ grub_procfs_open (struct grub_file *file, const char *path)
static struct grub_disk_dev grub_procfs_dev = {
.name = "proc",
.id = GRUB_DISK_DEVICE_PROCFS_ID,
.iterate = grub_procdev_iterate,
.open = grub_procdev_open,
.close = grub_procdev_close,
.read = grub_procdev_read,
.write = grub_procdev_write,
.disk_iterate = grub_procdev_iterate,
.disk_open = grub_procdev_open,
.disk_close = grub_procdev_close,
.disk_read = grub_procdev_read,
.disk_write = grub_procdev_write,
.next = 0
};

View file

@ -223,7 +223,7 @@ grub_disk_open (const char *name)
for (dev = grub_disk_dev_list; dev; dev = dev->next)
{
if ((dev->open) (raw, disk) == GRUB_ERR_NONE)
if ((dev->disk_open) (raw, disk) == GRUB_ERR_NONE)
break;
else if (grub_errno == GRUB_ERR_UNKNOWN_DEVICE)
grub_errno = GRUB_ERR_NONE;
@ -294,8 +294,8 @@ grub_disk_close (grub_disk_t disk)
grub_partition_t part;
grub_dprintf ("disk", "Closing `%s'.\n", disk->name);
if (disk->dev && disk->dev->close)
(disk->dev->close) (disk);
if (disk->dev && disk->dev->disk_close)
(disk->dev->disk_close) (disk);
/* Reset the timer. */
grub_last_time = grub_get_time_ms ();
@ -341,10 +341,10 @@ grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector,
< (disk->total_sectors << (disk->log_sector_size - GRUB_DISK_SECTOR_BITS)))
{
grub_err_t err;
err = (disk->dev->read) (disk, transform_sector (disk, sector),
1U << (GRUB_DISK_CACHE_BITS
+ GRUB_DISK_SECTOR_BITS
- disk->log_sector_size), tmp_buf);
err = (disk->dev->disk_read) (disk, transform_sector (disk, sector),
1U << (GRUB_DISK_CACHE_BITS
+ GRUB_DISK_SECTOR_BITS
- disk->log_sector_size), tmp_buf);
if (!err)
{
/* Copy it and store it in the disk cache. */
@ -377,8 +377,8 @@ grub_disk_read_small_real (grub_disk_t disk, grub_disk_addr_t sector,
if (!tmp_buf)
return grub_errno;
if ((disk->dev->read) (disk, transform_sector (disk, aligned_sector),
num, tmp_buf))
if ((disk->dev->disk_read) (disk, transform_sector (disk, aligned_sector),
num, tmp_buf))
{
grub_error_push ();
grub_dprintf ("disk", "%s read failed\n", disk->name);
@ -483,11 +483,11 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
{
grub_disk_addr_t i;
err = (disk->dev->read) (disk, transform_sector (disk, sector),
agglomerate << (GRUB_DISK_CACHE_BITS
+ GRUB_DISK_SECTOR_BITS
- disk->log_sector_size),
buf);
err = (disk->dev->disk_read) (disk, transform_sector (disk, sector),
agglomerate << (GRUB_DISK_CACHE_BITS
+ GRUB_DISK_SECTOR_BITS
- disk->log_sector_size),
buf);
if (err)
return err;

View file

@ -388,11 +388,11 @@ static struct grub_disk_dev grub_util_biosdisk_dev =
{
.name = "hostdisk",
.id = GRUB_DISK_DEVICE_HOSTDISK_ID,
.iterate = grub_util_biosdisk_iterate,
.open = grub_util_biosdisk_open,
.close = grub_util_biosdisk_close,
.read = grub_util_biosdisk_read,
.write = grub_util_biosdisk_write,
.disk_iterate = grub_util_biosdisk_iterate,
.disk_open = grub_util_biosdisk_open,
.disk_close = grub_util_biosdisk_close,
.disk_read = grub_util_biosdisk_read,
.disk_write = grub_util_biosdisk_write,
.next = 0
};

View file

@ -101,8 +101,8 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
grub_disk_cache_invalidate (disk->dev->id, disk->id, sector);
if ((disk->dev->write) (disk, transform_sector (disk, sector),
1, tmp_buf) != GRUB_ERR_NONE)
if ((disk->dev->disk_write) (disk, transform_sector (disk, sector),
1, tmp_buf) != GRUB_ERR_NONE)
{
grub_free (tmp_buf);
goto finish;
@ -130,8 +130,8 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector,
<< (GRUB_DISK_CACHE_BITS + GRUB_DISK_SECTOR_BITS
- disk->log_sector_size));
if ((disk->dev->write) (disk, transform_sector (disk, sector),
n, buf) != GRUB_ERR_NONE)
if ((disk->dev->disk_write) (disk, transform_sector (disk, sector),
n, buf) != GRUB_ERR_NONE)
goto finish;
while (n--)

View file

@ -77,26 +77,26 @@ struct grub_disk_dev
enum grub_disk_dev_id id;
/* Call HOOK with each device name, until HOOK returns non-zero. */
int (*iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
int (*disk_iterate) (grub_disk_dev_iterate_hook_t hook, void *hook_data,
grub_disk_pull_t pull);
/* Open the device named NAME, and set up DISK. */
grub_err_t (*open) (const char *name, struct grub_disk *disk);
grub_err_t (*disk_open) (const char *name, struct grub_disk *disk);
/* Close the disk DISK. */
void (*close) (struct grub_disk *disk);
void (*disk_close) (struct grub_disk *disk);
/* Read SIZE sectors from the sector SECTOR of the disk DISK into BUF. */
grub_err_t (*read) (struct grub_disk *disk, grub_disk_addr_t sector,
grub_err_t (*disk_read) (struct grub_disk *disk, grub_disk_addr_t sector,
grub_size_t size, char *buf);
/* Write SIZE sectors from BUF into the sector SECTOR of the disk DISK. */
grub_err_t (*write) (struct grub_disk *disk, grub_disk_addr_t sector,
grub_err_t (*disk_write) (struct grub_disk *disk, grub_disk_addr_t sector,
grub_size_t size, const char *buf);
#ifdef GRUB_UTIL
struct grub_disk_memberlist *(*memberlist) (struct grub_disk *disk);
const char * (*raidname) (struct grub_disk *disk);
struct grub_disk_memberlist *(*disk_memberlist) (struct grub_disk *disk);
const char * (*disk_raidname) (struct grub_disk *disk);
#endif
/* The next disk device. */
@ -187,7 +187,7 @@ grub_disk_dev_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data)
for (pull = 0; pull < GRUB_DISK_PULL_MAX; pull++)
for (p = grub_disk_dev_list; p; p = p->next)
if (p->iterate && (p->iterate) (hook, hook_data, pull))
if (p->disk_iterate && (p->disk_iterate) (hook, hook_data, pull))
return 1;
return 0;

View file

@ -446,8 +446,8 @@ probe_mods (grub_disk_t disk)
if (raid_level >= 0)
{
grub_install_push_module ("diskfilter");
if (disk->dev->raidname)
grub_install_push_module (disk->dev->raidname (disk));
if (disk->dev->disk_raidname)
grub_install_push_module (disk->dev->disk_raidname (disk));
}
if (raid_level == 5)
grub_install_push_module ("raid5rec");
@ -455,8 +455,8 @@ probe_mods (grub_disk_t disk)
grub_install_push_module ("raid6rec");
/* In case of LVM/RAID, check the member devices as well. */
if (disk->dev->memberlist)
list = disk->dev->memberlist (disk);
if (disk->dev->disk_memberlist)
list = disk->dev->disk_memberlist (disk);
while (list)
{
probe_mods (list->disk);
@ -514,9 +514,9 @@ probe_cryptodisk_uuid (grub_disk_t disk)
grub_disk_memberlist_t list = NULL, tmp;
/* In case of LVM/RAID, check the member devices as well. */
if (disk->dev->memberlist)
if (disk->dev->disk_memberlist)
{
list = disk->dev->memberlist (disk);
list = disk->dev->disk_memberlist (disk);
}
while (list)
{

View file

@ -171,9 +171,9 @@ probe_partmap (grub_disk_t disk, char delim)
grub_diskfilter_get_partmap (disk, do_print, &delim);
/* In case of LVM/RAID, check the member devices as well. */
if (disk->dev->memberlist)
if (disk->dev->disk_memberlist)
{
list = disk->dev->memberlist (disk);
list = disk->dev->disk_memberlist (disk);
}
while (list)
{
@ -229,9 +229,9 @@ probe_cryptodisk_uuid (grub_disk_t disk, char delim)
grub_disk_memberlist_t list = NULL, tmp;
/* In case of LVM/RAID, check the member devices as well. */
if (disk->dev->memberlist)
if (disk->dev->disk_memberlist)
{
list = disk->dev->memberlist (disk);
list = disk->dev->disk_memberlist (disk);
}
while (list)
{
@ -272,8 +272,8 @@ probe_abstraction (grub_disk_t disk, char delim)
grub_disk_memberlist_t list = NULL, tmp;
int raid_level;
if (disk->dev->memberlist)
list = disk->dev->memberlist (disk);
if (disk->dev->disk_memberlist)
list = disk->dev->disk_memberlist (disk);
while (list)
{
probe_abstraction (list->disk, delim);
@ -299,8 +299,8 @@ probe_abstraction (grub_disk_t disk, char delim)
if (raid_level >= 0)
{
printf ("diskfilter%c", delim);
if (disk->dev->raidname)
printf ("%s%c", disk->dev->raidname (disk), delim);
if (disk->dev->disk_raidname)
printf ("%s%c", disk->dev->disk_raidname (disk), delim);
}
if (raid_level == 5)
printf ("raid5rec%c", delim);