Lines Matching refs:item
34 static void config_item_init(struct config_item *item) in config_item_init() argument
36 kref_init(&item->ci_kref); in config_item_init()
37 INIT_LIST_HEAD(&item->ci_entry); in config_item_init()
49 int config_item_set_name(struct config_item *item, const char *fmt, ...) in config_item_set_name() argument
60 need = vsnprintf(item->ci_namebuf, limit, fmt, args); in config_item_set_name()
63 name = item->ci_namebuf; in config_item_set_name()
73 if (item->ci_name && item->ci_name != item->ci_namebuf) in config_item_set_name()
74 kfree(item->ci_name); in config_item_set_name()
77 item->ci_name = name; in config_item_set_name()
82 void config_item_init_type_name(struct config_item *item, in config_item_init_type_name() argument
86 config_item_set_name(item, "%s", name); in config_item_init_type_name()
87 item->ci_type = type; in config_item_init_type_name()
88 config_item_init(item); in config_item_init_type_name()
101 struct config_item *config_item_get(struct config_item *item) in config_item_get() argument
103 if (item) in config_item_get()
104 kref_get(&item->ci_kref); in config_item_get()
105 return item; in config_item_get()
109 struct config_item *config_item_get_unless_zero(struct config_item *item) in config_item_get_unless_zero() argument
111 if (item && kref_get_unless_zero(&item->ci_kref)) in config_item_get_unless_zero()
112 return item; in config_item_get_unless_zero()
117 static void config_item_cleanup(struct config_item *item) in config_item_cleanup() argument
119 const struct config_item_type *t = item->ci_type; in config_item_cleanup()
120 struct config_group *s = item->ci_group; in config_item_cleanup()
121 struct config_item *parent = item->ci_parent; in config_item_cleanup()
123 pr_debug("config_item %s: cleaning up\n", config_item_name(item)); in config_item_cleanup()
124 if (item->ci_name != item->ci_namebuf) in config_item_cleanup()
125 kfree(item->ci_name); in config_item_cleanup()
126 item->ci_name = NULL; in config_item_cleanup()
128 t->ct_item_ops->release(item); in config_item_cleanup()
146 void config_item_put(struct config_item *item) in config_item_put() argument
148 if (item) in config_item_put()
149 kref_put(&item->ci_kref, config_item_release); in config_item_put()
181 struct config_item *item = to_item(entry); in config_group_find_item() local
182 if (config_item_name(item) && in config_group_find_item()
183 !strcmp(config_item_name(item), name)) { in config_group_find_item()
184 ret = config_item_get(item); in config_group_find_item()