Scan mdraid before LVM.

* include/grub/diskfilter.h (grub_diskfilter_register): Renamed to ..
	(grub_diskfilter_register_front): ... this.
	(grub_diskfilter_register_back): New function.
	All users of grub_diskfilter_register updated.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-04-18 23:11:33 +02:00
parent 33d918b85f
commit b72d44a11a
7 changed files with 25 additions and 6 deletions

View file

@ -1,3 +1,12 @@
2012-04-18 Vladimir Serbinenko <phcoder@gmail.com>
Scan mdraid before LVM.
* include/grub/diskfilter.h (grub_diskfilter_register): Renamed to ..
(grub_diskfilter_register_front): ... this.
(grub_diskfilter_register_back): New function.
All users of grub_diskfilter_register updated.
2012-04-18 Vladimir Serbinenko <phcoder@gmail.com> 2012-04-18 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-install.in: Fix an automatic target detection bug. * util/grub-install.in: Fix an automatic target detection bug.

View file

@ -177,7 +177,7 @@ static struct grub_diskfilter grub_dmraid_nv_dev =
GRUB_MOD_INIT(dm_nv) GRUB_MOD_INIT(dm_nv)
{ {
grub_diskfilter_register (&grub_dmraid_nv_dev); grub_diskfilter_register_front (&grub_dmraid_nv_dev);
} }
GRUB_MOD_FINI(dm_nv) GRUB_MOD_FINI(dm_nv)

View file

@ -1001,7 +1001,7 @@ static struct grub_diskfilter grub_ldm_dev = {
GRUB_MOD_INIT (ldm) GRUB_MOD_INIT (ldm)
{ {
grub_diskfilter_register (&grub_ldm_dev); grub_diskfilter_register_back (&grub_ldm_dev);
} }
GRUB_MOD_FINI (ldm) GRUB_MOD_FINI (ldm)

View file

@ -756,7 +756,7 @@ static struct grub_diskfilter grub_lvm_dev = {
GRUB_MOD_INIT (lvm) GRUB_MOD_INIT (lvm)
{ {
grub_diskfilter_register (&grub_lvm_dev); grub_diskfilter_register_back (&grub_lvm_dev);
} }
GRUB_MOD_FINI (lvm) GRUB_MOD_FINI (lvm)

View file

@ -224,7 +224,7 @@ static struct grub_diskfilter grub_mdraid_dev = {
GRUB_MOD_INIT (mdraid1x) GRUB_MOD_INIT (mdraid1x)
{ {
grub_diskfilter_register (&grub_mdraid_dev); grub_diskfilter_register_front (&grub_mdraid_dev);
} }
GRUB_MOD_FINI (mdraid1x) GRUB_MOD_FINI (mdraid1x)

View file

@ -274,7 +274,7 @@ GRUB_MOD_INIT (mdraid09_be)
GRUB_MOD_INIT (mdraid09) GRUB_MOD_INIT (mdraid09)
#endif #endif
{ {
grub_diskfilter_register (&grub_mdraid_dev); grub_diskfilter_register_front (&grub_mdraid_dev);
} }
#ifdef MODE_BIGENDIAN #ifdef MODE_BIGENDIAN

View file

@ -148,11 +148,21 @@ typedef struct grub_diskfilter *grub_diskfilter_t;
extern grub_diskfilter_t grub_diskfilter_list; extern grub_diskfilter_t grub_diskfilter_list;
static inline void static inline void
grub_diskfilter_register (grub_diskfilter_t diskfilter) grub_diskfilter_register_front (grub_diskfilter_t diskfilter)
{ {
grub_list_push (GRUB_AS_LIST_P (&grub_diskfilter_list), grub_list_push (GRUB_AS_LIST_P (&grub_diskfilter_list),
GRUB_AS_LIST (diskfilter)); GRUB_AS_LIST (diskfilter));
} }
static inline void
grub_diskfilter_register_back (grub_diskfilter_t diskfilter)
{
grub_diskfilter_t p, *q;
for (q = &grub_diskfilter_list, p = *q; p; q = &p->next, p = *q);
diskfilter->next = NULL;
diskfilter->prev = q;
*q = diskfilter;
}
static inline void static inline void
grub_diskfilter_unregister (grub_diskfilter_t diskfilter) grub_diskfilter_unregister (grub_diskfilter_t diskfilter)
{ {