mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
configfs: switch ->default groups to a linked list
Replace the current NULL-terminated array of default groups with a linked list. This gets rid of lots of nasty code to size and/or dynamically allocate the array. While we're at it also provide a conveniant helper to remove the default groups. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Felipe Balbi <balbi@kernel.org> [drivers/usb/gadget] Acked-by: Joel Becker <jlbec@evilplan.org> Acked-by: Nicholas Bellinger <nab@linux-iscsi.org> Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
This commit is contained in:
parent
b1f1a29d8f
commit
1ae1602de0
17 changed files with 281 additions and 629 deletions
|
@ -96,7 +96,8 @@ struct config_group {
|
|||
struct config_item cg_item;
|
||||
struct list_head cg_children;
|
||||
struct configfs_subsystem *cg_subsys;
|
||||
struct config_group **default_groups;
|
||||
struct list_head default_groups;
|
||||
struct list_head group_entry;
|
||||
};
|
||||
|
||||
extern void config_group_init(struct config_group *group);
|
||||
|
@ -123,6 +124,12 @@ extern struct config_item *config_group_find_item(struct config_group *,
|
|||
const char *);
|
||||
|
||||
|
||||
static inline void configfs_add_default_group(struct config_group *new_group,
|
||||
struct config_group *group)
|
||||
{
|
||||
list_add_tail(&new_group->group_entry, &group->default_groups);
|
||||
}
|
||||
|
||||
struct configfs_attribute {
|
||||
const char *ca_name;
|
||||
struct module *ca_owner;
|
||||
|
@ -251,6 +258,8 @@ int configfs_register_group(struct config_group *parent_group,
|
|||
struct config_group *group);
|
||||
void configfs_unregister_group(struct config_group *group);
|
||||
|
||||
void configfs_remove_default_groups(struct config_group *group);
|
||||
|
||||
struct config_group *
|
||||
configfs_register_default_group(struct config_group *parent_group,
|
||||
const char *name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue