diff options
Diffstat (limited to 'fs/configfs')
-rw-r--r-- | fs/configfs/item.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/configfs/item.c b/fs/configfs/item.c index b762bbeaa0be..76dc4c3e5d51 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c | |||
@@ -183,27 +183,25 @@ void config_group_init(struct config_group *group) | |||
183 | INIT_LIST_HEAD(&group->cg_children); | 183 | INIT_LIST_HEAD(&group->cg_children); |
184 | } | 184 | } |
185 | 185 | ||
186 | |||
187 | /** | 186 | /** |
188 | * config_group_find_obj - search for item in group. | 187 | * config_group_find_item - search for item in group. |
189 | * @group: group we're looking in. | 188 | * @group: group we're looking in. |
190 | * @name: item's name. | 189 | * @name: item's name. |
191 | * | 190 | * |
192 | * Lock group via @group->cg_subsys, and iterate over @group->cg_list, | 191 | * Iterate over @group->cg_list, looking for a matching config_item. |
193 | * looking for a matching config_item. If matching item is found | 192 | * If matching item is found take a reference and return the item. |
194 | * take a reference and return the item. | 193 | * Caller must have locked group via @group->cg_subsys->su_mtx. |
195 | */ | 194 | */ |
196 | struct config_item *config_group_find_obj(struct config_group *group, | 195 | struct config_item *config_group_find_item(struct config_group *group, |
197 | const char * name) | 196 | const char *name) |
198 | { | 197 | { |
199 | struct list_head * entry; | 198 | struct list_head * entry; |
200 | struct config_item * ret = NULL; | 199 | struct config_item * ret = NULL; |
201 | 200 | ||
202 | /* XXX LOCKING! */ | ||
203 | list_for_each(entry,&group->cg_children) { | 201 | list_for_each(entry,&group->cg_children) { |
204 | struct config_item * item = to_item(entry); | 202 | struct config_item * item = to_item(entry); |
205 | if (config_item_name(item) && | 203 | if (config_item_name(item) && |
206 | !strcmp(config_item_name(item), name)) { | 204 | !strcmp(config_item_name(item), name)) { |
207 | ret = config_item_get(item); | 205 | ret = config_item_get(item); |
208 | break; | 206 | break; |
209 | } | 207 | } |
@@ -215,4 +213,4 @@ EXPORT_SYMBOL(config_item_init); | |||
215 | EXPORT_SYMBOL(config_group_init); | 213 | EXPORT_SYMBOL(config_group_init); |
216 | EXPORT_SYMBOL(config_item_get); | 214 | EXPORT_SYMBOL(config_item_get); |
217 | EXPORT_SYMBOL(config_item_put); | 215 | EXPORT_SYMBOL(config_item_put); |
218 | EXPORT_SYMBOL(config_group_find_obj); | 216 | EXPORT_SYMBOL(config_group_find_item); |