Lines Matching refs:dir

103 	struct tb_property_dir *dir;  in tb_property_parse()  local
119 dir = __tb_property_parse_dir(block, block_len, entry->value, in tb_property_parse()
121 if (!dir) { in tb_property_parse()
125 property->value.dir = dir; in tb_property_parse()
170 struct tb_property_dir *dir; in __tb_property_parse_dir() local
172 dir = kzalloc(sizeof(*dir), GFP_KERNEL); in __tb_property_parse_dir()
173 if (!dir) in __tb_property_parse_dir()
180 dir->uuid = kmemdup(&block[dir_offset], sizeof(*dir->uuid), in __tb_property_parse_dir()
189 INIT_LIST_HEAD(&dir->properties); in __tb_property_parse_dir()
196 tb_property_free_dir(dir); in __tb_property_parse_dir()
200 list_add_tail(&property->list, &dir->properties); in __tb_property_parse_dir()
203 return dir; in __tb_property_parse_dir()
243 struct tb_property_dir *dir; in tb_property_create_dir() local
245 dir = kzalloc(sizeof(*dir), GFP_KERNEL); in tb_property_create_dir()
246 if (!dir) in tb_property_create_dir()
249 INIT_LIST_HEAD(&dir->properties); in tb_property_create_dir()
251 dir->uuid = kmemdup(uuid, sizeof(*dir->uuid), GFP_KERNEL); in tb_property_create_dir()
252 if (!dir->uuid) { in tb_property_create_dir()
253 kfree(dir); in tb_property_create_dir()
258 return dir; in tb_property_create_dir()
266 tb_property_free_dir(property->value.dir); in tb_property_free()
292 void tb_property_free_dir(struct tb_property_dir *dir) in tb_property_free_dir() argument
296 if (!dir) in tb_property_free_dir()
299 list_for_each_entry_safe(property, tmp, &dir->properties, list) { in tb_property_free_dir()
303 kfree(dir->uuid); in tb_property_free_dir()
304 kfree(dir); in tb_property_free_dir()
308 static size_t tb_property_dir_length(const struct tb_property_dir *dir, in tb_property_dir_length() argument
314 if (dir->uuid) in tb_property_dir_length()
315 len += sizeof(*dir->uuid) / 4; in tb_property_dir_length()
319 list_for_each_entry(property, &dir->properties, list) { in tb_property_dir_length()
326 property->value.dir, recurse, data_len); in tb_property_dir_length()
347 static ssize_t __tb_property_format_dir(const struct tb_property_dir *dir, in __tb_property_format_dir() argument
401 dir_len = tb_property_dir_length(dir, false, &data_len); in __tb_property_format_dir()
411 if (dir->uuid) { in __tb_property_format_dir()
415 memcpy(pe->uuid, dir->uuid, sizeof(pe->uuid)); in __tb_property_format_dir()
426 list_for_each_entry(property, &dir->properties, list) { in __tb_property_format_dir()
434 child = property->value.dir; in __tb_property_format_dir()
487 ssize_t tb_property_format_dir(const struct tb_property_dir *dir, u32 *block, in tb_property_format_dir() argument
495 dir_len = tb_property_dir_length(dir, true, &data_len); in tb_property_format_dir()
499 ret = __tb_property_format_dir(dir, block, 0, block_len); in tb_property_format_dir()
599 struct tb_property_dir *dir) in tb_property_add_dir() argument
610 property->value.dir = dir; in tb_property_add_dir()
640 struct tb_property *tb_property_find(struct tb_property_dir *dir, in tb_property_find() argument
645 list_for_each_entry(property, &dir->properties, list) { in tb_property_find()
659 struct tb_property *tb_property_get_next(struct tb_property_dir *dir, in tb_property_get_next() argument
663 if (list_is_last(&prev->list, &dir->properties)) in tb_property_get_next()
667 return list_first_entry_or_null(&dir->properties, struct tb_property, in tb_property_get_next()