Change fs functions to add fs_ prefix

This avoid conflict with gnulib

Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Vladimir Serbinenko 2019-04-08 07:24:24 +02:00 committed by Vladimir Serbinenko
parent c6725996a9
commit ad4bfeec5c
55 changed files with 247 additions and 246 deletions

View file

@ -221,9 +221,9 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human)
};
if (longlist)
(fs->dir) (dev, path, print_files_long, &ctx);
(fs->fs_dir) (dev, path, print_files_long, &ctx);
else
(fs->dir) (dev, path, print_files, &ctx);
(fs->fs_dir) (dev, path, print_files, &ctx);
if (grub_errno == GRUB_ERR_BAD_FILE_TYPE
&& path[grub_strlen (path) - 1] != '/')

View file

@ -159,12 +159,12 @@ grub_mac_bless_file (grub_device_t dev, const char *path_in, int intel)
*tail = 0;
ctx.dirname = tail + 1;
(fs->dir) (dev, *path == 0 ? "/" : path, find_inode, &ctx);
(fs->fs_dir) (dev, *path == 0 ? "/" : path, find_inode, &ctx);
}
else
{
ctx.dirname = path + 1;
(fs->dir) (dev, "/", find_inode, &ctx);
(fs->fs_dir) (dev, "/", find_inode, &ctx);
}
if (!ctx.found)
{

View file

@ -109,7 +109,7 @@ get_uuid (const char *name, char **uuid, int getnative)
grub_device_close (dev);
return grub_errno;
}
if (!fs->uuid || fs->uuid (dev, uuid) || !*uuid)
if (!fs->fs_uuid || fs->fs_uuid (dev, uuid) || !*uuid)
{
grub_device_close (dev);

View file

@ -934,7 +934,7 @@ pseudo_read (struct grub_file *file, char *buf, grub_size_t len)
struct grub_fs pseudo_fs =
{
.name = "pseudo",
.read = pseudo_read
.fs_read = pseudo_read
};
struct grub_file_verifier grub_pubkey_verifier =

View file

@ -113,10 +113,10 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
if (state[4].set)
{
char *uuid;
if (! fs->uuid)
if (! fs->fs_uuid)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
N_("%s does not support UUIDs"), fs->name);
err = fs->uuid (dev, &uuid);
err = fs->fs_uuid (dev, &uuid);
if (err)
return err;
if (! uuid)
@ -134,11 +134,11 @@ grub_cmd_probe (grub_extcmd_context_t ctxt, int argc, char **args)
if (state[5].set)
{
char *label;
if (! fs->label)
if (! fs->fs_label)
return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
N_("filesystem `%s' does not support labels"),
fs->name);
err = fs->label (dev, &label);
err = fs->fs_label (dev, &label);
if (err)
return err;
if (! label)

View file

@ -103,9 +103,9 @@ iterate_device (const char *name, void *data)
fs = grub_fs_probe (dev);
#ifdef DO_SEARCH_FS_UUID
#define read_fn uuid
#define read_fn fs_uuid
#else
#define read_fn label
#define read_fn fs_label
#endif
if (fs && fs->read_fn)

View file

@ -133,15 +133,15 @@ get_fileinfo (char *path, struct test_parse_ctx *ctx)
/* Fetch writing time. */
ctx->file_info.mtimeset = 0;
if (fs->mtime)
if (fs->fs_mtime)
{
if (! fs->mtime (dev, &ctx->file_info.mtime))
if (! fs->fs_mtime (dev, &ctx->file_info.mtime))
ctx->file_info.mtimeset = 1;
grub_errno = GRUB_ERR_NONE;
}
}
else
(fs->dir) (dev, path, find_file, ctx);
(fs->fs_dir) (dev, path, find_file, ctx);
grub_device_close (dev);
grub_free (path);

View file

@ -71,8 +71,8 @@ verified_close (struct grub_file *file)
struct grub_fs verified_fs =
{
.name = "verified_read",
.read = verified_read,
.close = verified_close
.fs_read = verified_read,
.fs_close = verified_close
};
static grub_file_t

View file

@ -370,7 +370,7 @@ match_files (const char *prefix, const char *suffix, const char *end,
else
path = ctx.dir;
if (fs->dir (dev, path, match_files_iter, &ctx))
if (fs->fs_dir (dev, path, match_files_iter, &ctx))
goto fail;
grub_free (ctx.dir);
@ -452,7 +452,7 @@ check_file (const char *dir, const char *basename)
else
path = dir;
fs->dir (dev, path[0] ? path : "/", check_file_iter, &ctx);
fs->fs_dir (dev, path[0] ? path : "/", check_file_iter, &ctx);
if (grub_errno == 0 && basename[0] == 0)
ctx.found = 1;

View file

@ -685,12 +685,12 @@ grub_affs_mtime (grub_device_t device, grub_int32_t *t)
static struct grub_fs grub_affs_fs =
{
.name = "affs",
.dir = grub_affs_dir,
.open = grub_affs_open,
.read = grub_affs_read,
.close = grub_affs_close,
.label = grub_affs_label,
.mtime = grub_affs_mtime,
.fs_dir = grub_affs_dir,
.fs_open = grub_affs_open,
.fs_read = grub_affs_read,
.fs_close = grub_affs_close,
.fs_label = grub_affs_label,
.fs_mtime = grub_affs_mtime,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,

View file

@ -1082,13 +1082,13 @@ static struct grub_fs grub_bfs_fs = {
#else
.name = "bfs",
#endif
.dir = grub_bfs_dir,
.open = grub_bfs_open,
.read = grub_bfs_read,
.close = grub_bfs_close,
.label = grub_bfs_label,
.fs_dir = grub_bfs_dir,
.fs_open = grub_bfs_open,
.fs_read = grub_bfs_read,
.fs_close = grub_bfs_close,
.fs_label = grub_bfs_label,
#ifndef MODE_AFS
.uuid = grub_bfs_uuid,
.fs_uuid = grub_bfs_uuid,
#endif
#ifdef GRUB_UTIL
.reserved_first_sector = 1,

View file

@ -2172,14 +2172,14 @@ grub_btrfs_embed (grub_device_t device __attribute__ ((unused)),
static struct grub_fs grub_btrfs_fs = {
.name = "btrfs",
.dir = grub_btrfs_dir,
.open = grub_btrfs_open,
.read = grub_btrfs_read,
.close = grub_btrfs_close,
.uuid = grub_btrfs_uuid,
.label = grub_btrfs_label,
.fs_dir = grub_btrfs_dir,
.fs_open = grub_btrfs_open,
.fs_read = grub_btrfs_read,
.fs_close = grub_btrfs_close,
.fs_uuid = grub_btrfs_uuid,
.fs_label = grub_btrfs_label,
#ifdef GRUB_UTIL
.embed = grub_btrfs_embed,
.fs_embed = grub_btrfs_embed,
.reserved_first_sector = 1,
.blocklist_install = 0,
#endif

View file

@ -375,10 +375,10 @@ fini_cbfsdisk (void)
static struct grub_fs grub_cbfs_fs = {
.name = "cbfs",
.dir = grub_cbfs_dir,
.open = grub_cbfs_open,
.read = grub_cbfs_read,
.close = grub_cbfs_close,
.fs_dir = grub_cbfs_dir,
.fs_open = grub_cbfs_open,
.fs_read = grub_cbfs_read,
.fs_close = grub_cbfs_close,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 0,

View file

@ -233,10 +233,10 @@ grub_cpio_close (grub_file_t file)
static struct grub_fs grub_cpio_fs = {
.name = FSNAME,
.dir = grub_cpio_dir,
.open = grub_cpio_open,
.read = grub_cpio_read,
.close = grub_cpio_close,
.fs_dir = grub_cpio_dir,
.fs_open = grub_cpio_open,
.fs_read = grub_cpio_read,
.fs_close = grub_cpio_close,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 0,

View file

@ -1072,13 +1072,13 @@ grub_ext2_mtime (grub_device_t device, grub_int32_t *tm)
static struct grub_fs grub_ext2_fs =
{
.name = "ext2",
.dir = grub_ext2_dir,
.open = grub_ext2_open,
.read = grub_ext2_read,
.close = grub_ext2_close,
.label = grub_ext2_label,
.uuid = grub_ext2_uuid,
.mtime = grub_ext2_mtime,
.fs_dir = grub_ext2_dir,
.fs_open = grub_ext2_open,
.fs_read = grub_ext2_read,
.fs_close = grub_ext2_close,
.fs_label = grub_ext2_label,
.fs_uuid = grub_ext2_uuid,
.fs_mtime = grub_ext2_mtime,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -1289,12 +1289,12 @@ grub_f2fs_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_f2fs_fs = {
.name = "f2fs",
.dir = grub_f2fs_dir,
.open = grub_f2fs_open,
.read = grub_f2fs_read,
.close = grub_f2fs_close,
.label = grub_f2fs_label,
.uuid = grub_f2fs_uuid,
.fs_dir = grub_f2fs_dir,
.fs_open = grub_f2fs_open,
.fs_read = grub_f2fs_read,
.fs_close = grub_f2fs_close,
.fs_label = grub_f2fs_label,
.fs_uuid = grub_f2fs_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 0,

View file

@ -1229,12 +1229,12 @@ static struct grub_fs grub_fat_fs =
#else
.name = "fat",
#endif
.dir = grub_fat_dir,
.open = grub_fat_open,
.read = grub_fat_read,
.close = grub_fat_close,
.label = grub_fat_label,
.uuid = grub_fat_uuid,
.fs_dir = grub_fat_dir,
.fs_open = grub_fat_open,
.fs_read = grub_fat_read,
.fs_close = grub_fat_close,
.fs_label = grub_fat_label,
.fs_uuid = grub_fat_uuid,
#ifdef GRUB_UTIL
#ifdef MODE_EXFAT
/* ExFAT BPB is 30 larger than FAT32 one. */

View file

@ -1417,13 +1417,13 @@ grub_hfs_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_hfs_fs =
{
.name = "hfs",
.dir = grub_hfs_dir,
.open = grub_hfs_open,
.read = grub_hfs_read,
.close = grub_hfs_close,
.label = grub_hfs_label,
.uuid = grub_hfs_uuid,
.mtime = grub_hfs_mtime,
.fs_dir = grub_hfs_dir,
.fs_open = grub_hfs_open,
.fs_read = grub_hfs_read,
.fs_close = grub_hfs_close,
.fs_label = grub_hfs_label,
.fs_uuid = grub_hfs_uuid,
.fs_mtime = grub_hfs_mtime,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -1078,13 +1078,13 @@ grub_hfsplus_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_hfsplus_fs =
{
.name = "hfsplus",
.dir = grub_hfsplus_dir,
.open = grub_hfsplus_open,
.read = grub_hfsplus_read,
.close = grub_hfsplus_close,
.label = grub_hfsplus_label,
.mtime = grub_hfsplus_mtime,
.uuid = grub_hfsplus_uuid,
.fs_dir = grub_hfsplus_dir,
.fs_open = grub_hfsplus_open,
.fs_read = grub_hfsplus_read,
.fs_close = grub_hfsplus_close,
.fs_label = grub_hfsplus_label,
.fs_mtime = grub_hfsplus_mtime,
.fs_uuid = grub_hfsplus_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -1099,13 +1099,13 @@ grub_iso9660_mtime (grub_device_t device, grub_int32_t *timebuf)
static struct grub_fs grub_iso9660_fs =
{
.name = "iso9660",
.dir = grub_iso9660_dir,
.open = grub_iso9660_open,
.read = grub_iso9660_read,
.close = grub_iso9660_close,
.label = grub_iso9660_label,
.uuid = grub_iso9660_uuid,
.mtime = grub_iso9660_mtime,
.fs_dir = grub_iso9660_dir,
.fs_open = grub_iso9660_open,
.fs_read = grub_iso9660_read,
.fs_close = grub_iso9660_close,
.fs_label = grub_iso9660_label,
.fs_uuid = grub_iso9660_uuid,
.fs_mtime = grub_iso9660_mtime,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -930,12 +930,12 @@ grub_jfs_label (grub_device_t device, char **label)
static struct grub_fs grub_jfs_fs =
{
.name = "jfs",
.dir = grub_jfs_dir,
.open = grub_jfs_open,
.read = grub_jfs_read,
.close = grub_jfs_close,
.label = grub_jfs_label,
.uuid = grub_jfs_uuid,
.fs_dir = grub_jfs_dir,
.fs_open = grub_jfs_open,
.fs_read = grub_jfs_read,
.fs_close = grub_jfs_close,
.fs_label = grub_jfs_label,
.fs_uuid = grub_jfs_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -687,10 +687,10 @@ static struct grub_fs grub_minix_fs =
.name = "minix",
#endif
#endif
.dir = grub_minix_dir,
.open = grub_minix_open,
.read = grub_minix_read,
.close = grub_minix_close,
.fs_dir = grub_minix_dir,
.fs_open = grub_minix_open,
.fs_read = grub_minix_read,
.fs_close = grub_minix_close,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -1192,13 +1192,13 @@ grub_nilfs2_mtime (grub_device_t device, grub_int32_t * tm)
static struct grub_fs grub_nilfs2_fs = {
.name = "nilfs2",
.dir = grub_nilfs2_dir,
.open = grub_nilfs2_open,
.read = grub_nilfs2_read,
.close = grub_nilfs2_close,
.label = grub_nilfs2_label,
.uuid = grub_nilfs2_uuid,
.mtime = grub_nilfs2_mtime,
.fs_dir = grub_nilfs2_dir,
.fs_open = grub_nilfs2_open,
.fs_read = grub_nilfs2_read,
.fs_close = grub_nilfs2_close,
.fs_label = grub_nilfs2_label,
.fs_uuid = grub_nilfs2_uuid,
.fs_mtime = grub_nilfs2_mtime,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 0,

View file

@ -1212,12 +1212,12 @@ grub_ntfs_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_ntfs_fs =
{
.name = "ntfs",
.dir = grub_ntfs_dir,
.open = grub_ntfs_open,
.read = grub_ntfs_read,
.close = grub_ntfs_close,
.label = grub_ntfs_label,
.uuid = grub_ntfs_uuid,
.fs_dir = grub_ntfs_dir,
.fs_open = grub_ntfs_open,
.fs_read = grub_ntfs_read,
.fs_close = grub_ntfs_close,
.fs_label = grub_ntfs_label,
.fs_uuid = grub_ntfs_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -183,10 +183,10 @@ static struct grub_disk_dev grub_procfs_dev = {
static struct grub_fs grub_procfs_fs =
{
.name = "procfs",
.dir = grub_procfs_dir,
.open = grub_procfs_open,
.read = grub_procfs_read,
.close = grub_procfs_close,
.fs_dir = grub_procfs_dir,
.fs_open = grub_procfs_open,
.fs_read = grub_procfs_read,
.fs_close = grub_procfs_close,
.next = 0
};

View file

@ -1402,12 +1402,12 @@ grub_reiserfs_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_reiserfs_fs =
{
.name = "reiserfs",
.dir = grub_reiserfs_dir,
.open = grub_reiserfs_open,
.read = grub_reiserfs_read,
.close = grub_reiserfs_close,
.label = grub_reiserfs_label,
.uuid = grub_reiserfs_uuid,
.fs_dir = grub_reiserfs_dir,
.fs_open = grub_reiserfs_open,
.fs_read = grub_reiserfs_read,
.fs_close = grub_reiserfs_close,
.fs_label = grub_reiserfs_label,
.fs_uuid = grub_reiserfs_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -461,11 +461,11 @@ grub_romfs_label (grub_device_t device, char **label)
static struct grub_fs grub_romfs_fs =
{
.name = "romfs",
.dir = grub_romfs_dir,
.open = grub_romfs_open,
.read = grub_romfs_read,
.close = grub_romfs_close,
.label = grub_romfs_label,
.fs_dir = grub_romfs_dir,
.fs_open = grub_romfs_open,
.fs_read = grub_romfs_read,
.fs_close = grub_romfs_close,
.fs_label = grub_romfs_label,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 0,

View file

@ -741,11 +741,11 @@ grub_sfs_label (grub_device_t device, char **label)
static struct grub_fs grub_sfs_fs =
{
.name = "sfs",
.dir = grub_sfs_dir,
.open = grub_sfs_open,
.read = grub_sfs_read,
.close = grub_sfs_close,
.label = grub_sfs_label,
.fs_dir = grub_sfs_dir,
.fs_open = grub_sfs_open,
.fs_read = grub_sfs_read,
.fs_close = grub_sfs_close,
.fs_label = grub_sfs_label,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 1,

View file

@ -995,11 +995,11 @@ grub_squash_mtime (grub_device_t dev, grub_int32_t *tm)
static struct grub_fs grub_squash_fs =
{
.name = "squash4",
.dir = grub_squash_dir,
.open = grub_squash_open,
.read = grub_squash_read,
.close = grub_squash_close,
.mtime = grub_squash_mtime,
.fs_dir = grub_squash_dir,
.fs_open = grub_squash_open,
.fs_read = grub_squash_read,
.fs_close = grub_squash_close,
.fs_mtime = grub_squash_mtime,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 0,

View file

@ -324,10 +324,10 @@ grub_cpio_close (grub_file_t file)
static struct grub_fs grub_cpio_fs = {
.name = "tarfs",
.dir = grub_cpio_dir,
.open = grub_cpio_open,
.read = grub_cpio_read,
.close = grub_cpio_close,
.fs_dir = grub_cpio_dir,
.fs_open = grub_cpio_open,
.fs_read = grub_cpio_read,
.fs_close = grub_cpio_close,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 0,

View file

@ -1345,12 +1345,12 @@ grub_udf_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_udf_fs = {
.name = "udf",
.dir = grub_udf_dir,
.open = grub_udf_open,
.read = grub_udf_read,
.close = grub_udf_close,
.label = grub_udf_label,
.uuid = grub_udf_uuid,
.fs_dir = grub_udf_dir,
.fs_open = grub_udf_open,
.fs_read = grub_udf_read,
.fs_close = grub_udf_close,
.fs_label = grub_udf_label,
.fs_uuid = grub_udf_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 1,
.blocklist_install = 1,

View file

@ -875,13 +875,13 @@ static struct grub_fs grub_ufs_fs =
.name = "ufs1",
#endif
#endif
.dir = grub_ufs_dir,
.open = grub_ufs_open,
.read = grub_ufs_read,
.close = grub_ufs_close,
.label = grub_ufs_label,
.uuid = grub_ufs_uuid,
.mtime = grub_ufs_mtime,
.fs_dir = grub_ufs_dir,
.fs_open = grub_ufs_open,
.fs_read = grub_ufs_read,
.fs_close = grub_ufs_close,
.fs_label = grub_ufs_label,
.fs_uuid = grub_ufs_uuid,
.fs_mtime = grub_ufs_mtime,
/* FIXME: set reserved_first_sector. */
#ifdef GRUB_UTIL
.blocklist_install = 1,

View file

@ -1137,12 +1137,12 @@ grub_xfs_uuid (grub_device_t device, char **uuid)
static struct grub_fs grub_xfs_fs =
{
.name = "xfs",
.dir = grub_xfs_dir,
.open = grub_xfs_open,
.read = grub_xfs_read,
.close = grub_xfs_close,
.label = grub_xfs_label,
.uuid = grub_xfs_uuid,
.fs_dir = grub_xfs_dir,
.fs_open = grub_xfs_open,
.fs_read = grub_xfs_read,
.fs_close = grub_xfs_close,
.fs_label = grub_xfs_label,
.fs_uuid = grub_xfs_uuid,
#ifdef GRUB_UTIL
.reserved_first_sector = 0,
.blocklist_install = 1,

View file

@ -4348,15 +4348,15 @@ grub_zfs_embed (grub_device_t device __attribute__ ((unused)),
static struct grub_fs grub_zfs_fs = {
.name = "zfs",
.dir = grub_zfs_dir,
.open = grub_zfs_open,
.read = grub_zfs_read,
.close = grub_zfs_close,
.label = zfs_label,
.uuid = zfs_uuid,
.mtime = zfs_mtime,
.fs_dir = grub_zfs_dir,
.fs_open = grub_zfs_open,
.fs_read = grub_zfs_read,
.fs_close = grub_zfs_close,
.fs_label = zfs_label,
.fs_uuid = zfs_uuid,
.fs_mtime = zfs_mtime,
#ifdef GRUB_UTIL
.embed = grub_zfs_embed,
.fs_embed = grub_zfs_embed,
.reserved_first_sector = 1,
.blocklist_install = 0,
#endif

View file

@ -205,10 +205,10 @@ grub_bufio_close (grub_file_t file)
static struct grub_fs grub_bufio_fs =
{
.name = "bufio",
.dir = 0,
.open = 0,
.read = grub_bufio_read,
.close = grub_bufio_close,
.label = 0,
.fs_dir = 0,
.fs_open = 0,
.fs_read = grub_bufio_read,
.fs_close = grub_bufio_close,
.fs_label = 0,
.next = 0
};

View file

@ -1389,11 +1389,11 @@ grub_deflate_decompress (char *inbuf, grub_size_t insize, grub_off_t off,
static struct grub_fs grub_gzio_fs =
{
.name = "gzio",
.dir = 0,
.open = 0,
.read = grub_gzio_read,
.close = grub_gzio_close,
.label = 0,
.fs_dir = 0,
.fs_open = 0,
.fs_read = grub_gzio_read,
.fs_close = grub_gzio_close,
.fs_label = 0,
.next = 0
};

View file

@ -531,11 +531,11 @@ grub_lzopio_close (grub_file_t file)
static struct grub_fs grub_lzopio_fs = {
.name = "lzopio",
.dir = 0,
.open = 0,
.read = grub_lzopio_read,
.close = grub_lzopio_close,
.label = 0,
.fs_dir = 0,
.fs_open = 0,
.fs_read = grub_lzopio_read,
.fs_close = grub_lzopio_close,
.fs_label = 0,
.next = 0
};

View file

@ -52,11 +52,11 @@ grub_offset_close (grub_file_t file)
static struct grub_fs grub_offset_fs = {
.name = "offset",
.dir = 0,
.open = 0,
.read = grub_offset_read,
.close = grub_offset_close,
.label = 0,
.fs_dir = 0,
.fs_open = 0,
.fs_read = grub_offset_read,
.fs_close = grub_offset_close,
.fs_label = 0,
.next = 0
};

View file

@ -327,11 +327,11 @@ grub_xzio_close (grub_file_t file)
static struct grub_fs grub_xzio_fs = {
.name = "xzio",
.dir = 0,
.open = 0,
.read = grub_xzio_read,
.close = grub_xzio_close,
.label = 0,
.fs_dir = 0,
.fs_open = 0,
.fs_read = grub_xzio_read,
.fs_close = grub_xzio_close,
.fs_label = 0,
.next = 0
};

View file

@ -155,7 +155,7 @@ grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)),
}
else if (fs)
{
(fs->dir) (dev, path, grub_mini_print_files, NULL);
(fs->fs_dir) (dev, path, grub_mini_print_files, NULL);
grub_xputs ("\n");
grub_refresh ();
}

View file

@ -176,11 +176,11 @@ grub_hostfs_label (grub_device_t device __attribute ((unused)),
static struct grub_fs grub_hostfs_fs =
{
.name = "hostfs",
.dir = grub_hostfs_dir,
.open = grub_hostfs_open,
.read = grub_hostfs_read,
.close = grub_hostfs_close,
.label = grub_hostfs_label,
.fs_dir = grub_hostfs_dir,
.fs_open = grub_hostfs_open,
.fs_read = grub_hostfs_read,
.fs_close = grub_hostfs_close,
.fs_label = grub_hostfs_label,
.next = 0
};

View file

@ -107,7 +107,7 @@ grub_file_open (const char *name, enum grub_file_type type)
goto fail;
}
if ((file->fs->open) (file, file_name) != GRUB_ERR_NONE)
if ((file->fs->fs_open) (file, file_name) != GRUB_ERR_NONE)
goto fail;
file->name = grub_strdup (name);
@ -177,7 +177,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len)
file->read_hook_data = file;
file->progress_offset = file->offset;
}
res = (file->fs->read) (file, buf, len);
res = (file->fs->fs_read) (file, buf, len);
file->read_hook = read_hook;
file->read_hook_data = read_hook_data;
if (res > 0)
@ -189,8 +189,8 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len)
grub_err_t
grub_file_close (grub_file_t file)
{
if (file->fs->close)
(file->fs->close) (file);
if (file->fs->fs_close)
(file->fs->fs_close) (file);
if (file->device)
grub_device_close (file->device);

View file

@ -64,13 +64,13 @@ grub_fs_probe (grub_device_t device)
if (grub_strcmp (p->name, "btrfs") == 0)
{
char *label = 0;
p->uuid (device, &label);
p->fs_uuid (device, &label);
if (label)
grub_free (label);
}
else
#endif
(p->dir) (device, "/", probe_dummy_iter, NULL);
(p->fs_dir) (device, "/", probe_dummy_iter, NULL);
if (grub_errno == GRUB_ERR_NONE)
return p;
@ -94,7 +94,7 @@ grub_fs_probe (grub_device_t device)
{
p = grub_fs_list;
(p->dir) (device, "/", probe_dummy_iter, NULL);
(p->fs_dir) (device, "/", probe_dummy_iter, NULL);
if (grub_errno == GRUB_ERR_NONE)
{
count--;
@ -243,9 +243,9 @@ grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len)
struct grub_fs grub_fs_blocklist =
{
.name = "blocklist",
.dir = 0,
.open = grub_fs_blocklist_open,
.read = grub_fs_blocklist_read,
.close = 0,
.fs_dir = 0,
.fs_open = grub_fs_blocklist_open,
.fs_read = grub_fs_blocklist_read,
.fs_close = 0,
.next = 0
};

View file

@ -24,6 +24,7 @@
#ifndef XZ_H
#define XZ_H
#include <config.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>

View file

@ -580,9 +580,9 @@ freebsd_get_zfs (void)
fs = grub_fs_probe (dev);
if (!fs)
return;
if (!fs->uuid || grub_strcmp (fs->name, "zfs") != 0)
if (!fs->fs_uuid || grub_strcmp (fs->name, "zfs") != 0)
return;
err = fs->uuid (dev, &uuid);
err = fs->fs_uuid (dev, &uuid);
if (err)
return;
if (!uuid)

View file

@ -1102,7 +1102,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, const char *osbundlerequired,
path++;
if (fs)
(fs->dir) (dev, path, grub_xnu_scan_dir_for_kexts_load, &ctx);
(fs->fs_dir) (dev, path, grub_xnu_scan_dir_for_kexts_load, &ctx);
grub_device_close (dev);
}
grub_free (device_name);
@ -1201,7 +1201,7 @@ grub_xnu_load_kext_from_dir (char *dirname, const char *osbundlerequired,
/* Look at the directory. */
if (fs)
(fs->dir) (dev, path, grub_xnu_load_kext_from_dir_load, &ctx);
(fs->fs_dir) (dev, path, grub_xnu_load_kext_from_dir_load, &ctx);
if (ctx.plistname && grub_xnu_check_os_bundle_required
(ctx.plistname, osbundlerequired, &binsuffix))

View file

@ -1706,13 +1706,13 @@ grub_net_fs_read (grub_file_t file, char *buf, grub_size_t len)
static struct grub_fs grub_net_fs =
{
.name = "netfs",
.dir = grub_net_fs_dir,
.open = grub_net_fs_open,
.read = grub_net_fs_read,
.close = grub_net_fs_close,
.label = NULL,
.uuid = NULL,
.mtime = NULL,
.fs_dir = grub_net_fs_dir,
.fs_open = grub_net_fs_open,
.fs_read = grub_net_fs_read,
.fs_close = grub_net_fs_close,
.fs_label = NULL,
.fs_uuid = NULL,
.fs_mtime = NULL,
};
static grub_err_t

View file

@ -287,7 +287,7 @@ complete_file (void)
dirfile[1] = '\0';
/* Iterate the directory. */
(fs->dir) (dev, dir, iterate_dir, NULL);
(fs->fs_dir) (dev, dir, iterate_dir, NULL);
grub_free (dir);

View file

@ -119,10 +119,10 @@ grub_normal_print_device_info (const char *name)
if (grub_strcmp (fsname, "ext2") == 0)
fsname = "ext*";
grub_printf_ (N_("Filesystem type %s"), fsname);
if (fs->label)
if (fs->fs_label)
{
char *label;
(fs->label) (dev, &label);
(fs->fs_label) (dev, &label);
if (grub_errno == GRUB_ERR_NONE)
{
if (label && grub_strlen (label))
@ -134,11 +134,11 @@ grub_normal_print_device_info (const char *name)
}
grub_errno = GRUB_ERR_NONE;
}
if (fs->mtime)
if (fs->fs_mtime)
{
grub_int32_t tm;
struct grub_datetime datetime;
(fs->mtime) (dev, &tm);
(fs->fs_mtime) (dev, &tm);
if (grub_errno == GRUB_ERR_NONE)
{
grub_unixtime2datetime (tm, &datetime);
@ -154,10 +154,10 @@ grub_normal_print_device_info (const char *name)
}
grub_errno = GRUB_ERR_NONE;
}
if (fs->uuid)
if (fs->fs_uuid)
{
char *uuid;
(fs->uuid) (dev, &uuid);
(fs->fs_uuid) (dev, &uuid);
if (grub_errno == GRUB_ERR_NONE)
{
if (uuid && grub_strlen (uuid))

View file

@ -58,34 +58,34 @@ struct grub_fs
const char *name;
/* Call HOOK with each file under DIR. */
grub_err_t (*dir) (grub_device_t device, const char *path,
grub_err_t (*fs_dir) (grub_device_t device, const char *path,
grub_fs_dir_hook_t hook, void *hook_data);
/* Open a file named NAME and initialize FILE. */
grub_err_t (*open) (struct grub_file *file, const char *name);
grub_err_t (*fs_open) (struct grub_file *file, const char *name);
/* Read LEN bytes data from FILE into BUF. */
grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_size_t len);
grub_ssize_t (*fs_read) (struct grub_file *file, char *buf, grub_size_t len);
/* Close the file FILE. */
grub_err_t (*close) (struct grub_file *file);
grub_err_t (*fs_close) (struct grub_file *file);
/* Return the label of the device DEVICE in LABEL. The label is
returned in a grub_malloc'ed buffer and should be freed by the
caller. */
grub_err_t (*label) (grub_device_t device, char **label);
grub_err_t (*fs_label) (grub_device_t device, char **label);
/* Return the uuid of the device DEVICE in UUID. The uuid is
returned in a grub_malloc'ed buffer and should be freed by the
caller. */
grub_err_t (*uuid) (grub_device_t device, char **uuid);
grub_err_t (*fs_uuid) (grub_device_t device, char **uuid);
/* Get writing time of filesystem. */
grub_err_t (*mtime) (grub_device_t device, grub_int32_t *timebuf);
grub_err_t (*fs_mtime) (grub_device_t device, grub_int32_t *timebuf);
#ifdef GRUB_UTIL
/* Determine sectors available for embedding. */
grub_err_t (*embed) (grub_device_t device, unsigned int *nsectors,
grub_err_t (*fs_embed) (grub_device_t device, unsigned int *nsectors,
unsigned int max_nsectors,
grub_embed_type_t embed_type,
grub_disk_addr_t **sectors);

View file

@ -470,9 +470,9 @@ fstest (int n)
fs = grub_fs_probe (dev);
if (!fs)
grub_util_error ("%s", grub_errmsg);
if (!fs->uuid)
if (!fs->fs_uuid)
grub_util_error ("%s", _("couldn't retrieve UUID"));
if (fs->uuid (dev, &uuid))
if (fs->fs_uuid (dev, &uuid))
grub_util_error ("%s", grub_errmsg);
if (!uuid)
grub_util_error ("%s", _("couldn't retrieve UUID"));

View file

@ -1378,8 +1378,8 @@ main (int argc, char *argv[])
{
char *uuid = NULL;
/* generic method (used on coreboot and ata mod). */
if (!force_file_id && grub_fs->uuid && grub_fs->uuid (grub_dev,
&uuid))
if (!force_file_id
&& grub_fs->fs_uuid && grub_fs->fs_uuid (grub_dev, &uuid))
{
grub_print_error ();
grub_errno = 0;

View file

@ -190,7 +190,7 @@ fuse_getattr (const char *path, struct stat *st)
}
/* It's the whole device. */
(fs->dir) (dev, path2, fuse_getattr_find_file, &ctx);
(fs->fs_dir) (dev, path2, fuse_getattr_find_file, &ctx);
grub_free (path2);
if (!ctx.file_exists)
@ -352,7 +352,7 @@ fuse_readdir (const char *path, void *buf,
&& pathname[grub_strlen (pathname) - 1] == '/')
pathname[grub_strlen (pathname) - 1] = 0;
(fs->dir) (dev, pathname, fuse_readdir_call_fill, &ctx);
(fs->fs_dir) (dev, pathname, fuse_readdir_call_fill, &ctx);
free (pathname);
grub_errno = GRUB_ERR_NONE;
return 0;

View file

@ -446,10 +446,10 @@ probe (const char *path, char **device_names, char delim)
else if (print == PRINT_FS_UUID)
{
char *uuid;
if (! fs->uuid)
if (! fs->fs_uuid)
grub_util_error (_("%s does not support UUIDs"), fs->name);
if (fs->uuid (dev, &uuid) != GRUB_ERR_NONE)
if (fs->fs_uuid (dev, &uuid) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
printf ("%s", uuid);
@ -458,11 +458,11 @@ probe (const char *path, char **device_names, char delim)
else if (print == PRINT_FS_LABEL)
{
char *label;
if (! fs->label)
if (! fs->fs_label)
grub_util_error (_("filesystem `%s' does not support labels"),
fs->name);
if (fs->label (dev, &label) != GRUB_ERR_NONE)
if (fs->fs_label (dev, &label) != GRUB_ERR_NONE)
grub_util_error ("%s", grub_errmsg);
printf ("%s", label);

View file

@ -491,7 +491,7 @@ SETUP (const char *dir,
goto unable_to_embed;
}
if (fs && !fs->embed)
if (fs && !fs->fs_embed)
{
grub_util_warn (_("File system `%s' doesn't support embedding"),
fs->name);
@ -529,7 +529,7 @@ SETUP (const char *dir,
err = ctx.dest_partmap->embed (dest_dev->disk, &nsec, maxsec,
GRUB_EMBED_PCBIOS, &sectors);
else
err = fs->embed (dest_dev, &nsec, maxsec,
err = fs->fs_embed (dest_dev, &nsec, maxsec,
GRUB_EMBED_PCBIOS, &sectors);
if (!err && nsec < core_sectors)
{