2009-05-05 Pavel Roskin <proski@gnu.org>
* include/grub/dl.h [GRUB_UTIL]: Provide inline implementations of grub_dl_ref() and grub_dl_unref(). * commands/parttool.c: Remove preprocessor conditionals around grub_dl_ref() and grub_dl_unref(). * fs/affs.c: Likewise. * fs/afs.c: Likewise. * fs/cpio.c: Likewise. * fs/ext2.c: Likewise. * fs/fat.c: Likewise. * fs/hfs.c: Likewise. * fs/hfsplus.c: Likewise. * fs/iso9660.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/ntfs.c: Likewise. * fs/reiserfs.c: Likewise. * fs/sfs.c: Likewise. * fs/udf.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * include/grub/dl.h: Likewise. * loader/xnu.c: Likewise.
This commit is contained in:
parent
de5fd76e95
commit
119494b506
20 changed files with 41 additions and 282 deletions
18
fs/hfs.c
18
fs/hfs.c
|
@ -159,9 +159,7 @@ struct grub_hfs_record
|
|||
int datalen;
|
||||
};
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
static grub_dl_t my_mod;
|
||||
#endif
|
||||
|
||||
static int grub_hfs_find_node (struct grub_hfs_data *, char *,
|
||||
grub_uint32_t, int, char *, int);
|
||||
|
@ -972,9 +970,7 @@ grub_hfs_dir (grub_device_t device, const char *path,
|
|||
struct grub_hfs_data *data;
|
||||
struct grub_hfs_filerec frec;
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
grub_dl_ref (my_mod);
|
||||
#endif
|
||||
|
||||
data = grub_hfs_mount (device->disk);
|
||||
if (!data)
|
||||
|
@ -995,9 +991,7 @@ grub_hfs_dir (grub_device_t device, const char *path,
|
|||
fail:
|
||||
grub_free (data);
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
grub_dl_unref (my_mod);
|
||||
#endif
|
||||
|
||||
return grub_errno;
|
||||
}
|
||||
|
@ -1010,18 +1004,14 @@ grub_hfs_open (struct grub_file *file, const char *name)
|
|||
struct grub_hfs_data *data;
|
||||
struct grub_hfs_filerec frec;
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
grub_dl_ref (my_mod);
|
||||
#endif
|
||||
|
||||
data = grub_hfs_mount (file->device->disk);
|
||||
|
||||
if (grub_hfs_find_dir (data, name, &frec, 0))
|
||||
{
|
||||
grub_free (data);
|
||||
#ifndef GRUB_UTIL
|
||||
grub_dl_unref (my_mod);
|
||||
#endif
|
||||
grub_dl_unref (my_mod);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
|
@ -1029,9 +1019,7 @@ grub_hfs_open (struct grub_file *file, const char *name)
|
|||
{
|
||||
grub_free (data);
|
||||
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a file");
|
||||
#ifndef GRUB_UTIL
|
||||
grub_dl_unref (my_mod);
|
||||
#endif
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
|
@ -1061,9 +1049,7 @@ grub_hfs_close (grub_file_t file)
|
|||
{
|
||||
grub_free (file->data);
|
||||
|
||||
#ifndef GRUB_UTIL
|
||||
grub_dl_unref (my_mod);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1102,9 +1088,7 @@ static struct grub_fs grub_hfs_fs =
|
|||
GRUB_MOD_INIT(hfs)
|
||||
{
|
||||
grub_fs_register (&grub_hfs_fs);
|
||||
#ifndef GRUB_UTIL
|
||||
my_mod = mod;
|
||||
#endif
|
||||
}
|
||||
|
||||
GRUB_MOD_FINI(hfs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue