diff options
Diffstat (limited to 'common/bbu.c')
-rw-r--r-- | common/bbu.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/common/bbu.c b/common/bbu.c index ee9f78ecc9..1a1edda96b 100644 --- a/common/bbu.c +++ b/common/bbu.c @@ -16,22 +16,28 @@ #include <malloc.h> #include <linux/stat.h> #include <image-metadata.h> +#include <file-list.h> static LIST_HEAD(bbu_image_handlers); -int bbu_handlers_iterate(int (*fn)(struct bbu_handler *, void *), void *ctx) +static void append_bbu_entry(struct bbu_handler *handler, struct file_list *files) { - struct bbu_handler *handler; + char *name; - list_for_each_entry(handler, &bbu_image_handlers, list) { - int ret; + name = basprintf("bbu-%s", handler->name); - ret = fn(handler, ctx); - if (ret) - return ret; - } + if (file_list_add_entry(files, name, handler->devicefile, 0)) + pr_warn("duplicate partition name %s\n", name); - return 0; + free(name); +} + +void bbu_append_handlers_to_file_list(struct file_list *files) +{ + struct bbu_handler *handler; + + list_for_each_entry(handler, &bbu_image_handlers, list) + append_bbu_entry(handler, files); } int bbu_force(struct bbu_data *data, const char *fmt, ...) |