diff options
Diffstat (limited to 'include/part.h')
-rw-r--r-- | include/part.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h index fac36364bd..815515aa80 100644 --- a/include/part.h +++ b/include/part.h @@ -9,6 +9,7 @@ #include <blk.h> #include <ide.h> #include <uuid.h> +#include <linker_lists.h> #include <linux/list.h> struct block_drvr { @@ -481,5 +482,33 @@ int layout_mbr_partitions(struct disk_partition *p, int count, #endif +#ifdef CONFIG_PARTITIONS +/** + * part_driver_get_count() - get partition driver count + * + * @return - number of partition drivers + */ +static inline int part_driver_get_count(void) +{ + return ll_entry_count(struct part_driver, part_driver); +} + +/** + * part_driver_get_first() - get first partition driver + * + * @return - pointer to first partition driver on success, otherwise NULL + */ +static inline struct part_driver *part_driver_get_first(void) +{ + return ll_entry_start(struct part_driver, part_driver); +} + +#else +static inline int part_driver_get_count(void) +{ return 0; } + +static inline struct part_driver *part_driver_get_first(void) +{ return NULL; } +#endif /* CONFIG_PARTITIONS */ #endif /* _PART_H */ |