Lines Matching refs:header
43 dir->header.ctl_table[0].child = sysctl_mount_point; in set_empty_dir()
49 dir->header.ctl_table[0].child = NULL; in clear_empty_dir()
69 .default_set.dir.header = {
81 static void drop_sysctl_table(struct ctl_table_header *header);
85 static void put_links(struct ctl_table_header *header);
89 if (dir->header.parent) in sysctl_print_dir()
90 sysctl_print_dir(dir->header.parent); in sysctl_print_dir()
91 pr_cont("%s/", dir->header.ctl_table[0].procname); in sysctl_print_dir()
124 head = ctl_node->header; in find_entry()
158 parent_head = parent_node->header; in insert_entry()
205 node->header = head; in init_header()
216 static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) in insert_header() argument
222 if (is_empty_dir(&dir->header)) in insert_header()
226 if (header->ctl_table == sysctl_mount_point) { in insert_header()
232 dir->header.nreg++; in insert_header()
233 header->parent = dir; in insert_header()
234 err = insert_links(header); in insert_header()
237 for (entry = header->ctl_table; entry->procname; entry++) { in insert_header()
238 err = insert_entry(header, entry); in insert_header()
244 erase_header(header); in insert_header()
245 put_links(header); in insert_header()
247 if (header->ctl_table == sysctl_mount_point) in insert_header()
249 header->parent = NULL; in insert_header()
250 drop_sysctl_table(&dir->header); in insert_header()
391 if (use_table(ctl_node->header)) in first_usable_entry()
408 head = ctl_node->header; in first_entry()
428 head = ctl_node->header; in next_entry()
528 head = &sysctl_table_root.default_set.dir.header; in grab_header()
547 ctl_dir = container_of(head, struct ctl_dir, header); in proc_sys_lookup()
790 ctl_dir = container_of(head, struct ctl_dir, header); in proc_sys_readdir()
962 return container_of(head, struct ctl_dir, header); in find_subdir()
986 init_header(&new->header, set->dir.header.root, set, node, table); in new_dir()
1006 struct ctl_table_set *set = dir->header.set; in get_subdir()
1032 err = insert_header(dir, &new->header); in get_subdir()
1038 subdir->header.nreg++; in get_subdir()
1046 drop_sysctl_table(&dir->header); in get_subdir()
1048 drop_sysctl_table(&new->header); in get_subdir()
1057 if (!dir->header.parent) in xlate_dir()
1059 parent = xlate_dir(set, dir->header.parent); in xlate_dir()
1062 procname = dir->header.ctl_table[0].procname; in xlate_dir()
1200 init_header(links, dir->header.root, dir->header.set, node, link_table); in new_links()
1251 core_parent->header.nreg++; in insert_links()
1271 drop_sysctl_table(&core_parent->header); in insert_links()
1321 struct ctl_table_root *root = set->dir.header.root; in __register_sysctl_table()
1322 struct ctl_table_header *header; in __register_sysctl_table() local
1332 header = kzalloc(sizeof(struct ctl_table_header) + in __register_sysctl_table()
1334 if (!header) in __register_sysctl_table()
1337 node = (struct ctl_node *)(header + 1); in __register_sysctl_table()
1338 init_header(header, root, set, node, table); in __register_sysctl_table()
1345 dir->header.nreg++; in __register_sysctl_table()
1367 if (insert_header(dir, header)) in __register_sysctl_table()
1370 drop_sysctl_table(&dir->header); in __register_sysctl_table()
1373 return header; in __register_sysctl_table()
1376 drop_sysctl_table(&dir->header); in __register_sysctl_table()
1379 kfree(header); in __register_sysctl_table()
1502 struct ctl_table_header *header; in register_leaf_sysctl_tables() local
1503 header = __register_sysctl_table(set, path, files); in register_leaf_sysctl_tables()
1504 if (!header) { in register_leaf_sysctl_tables()
1510 header->ctl_table_arg = ctl_table_arg; in register_leaf_sysctl_tables()
1511 **subheader = header; in register_leaf_sysctl_tables()
1556 struct ctl_table_header *header = NULL, **subheaders, **subheader; in __register_sysctl_paths() local
1577 header = __register_sysctl_table(set, new_path, table); in __register_sysctl_paths()
1578 if (header) in __register_sysctl_paths()
1579 header->ctl_table_arg = ctl_table_arg; in __register_sysctl_paths()
1581 header = kzalloc(sizeof(*header) + in __register_sysctl_paths()
1583 if (!header) in __register_sysctl_paths()
1586 subheaders = (struct ctl_table_header **) (header + 1); in __register_sysctl_paths()
1588 header->ctl_table_arg = ctl_table_arg; in __register_sysctl_paths()
1597 return header; in __register_sysctl_paths()
1606 kfree(header); in __register_sysctl_paths()
1607 header = NULL; in __register_sysctl_paths()
1646 static void put_links(struct ctl_table_header *header) in put_links() argument
1649 struct ctl_table_root *root = header->root; in put_links()
1650 struct ctl_dir *parent = header->parent; in put_links()
1654 if (header->set == root_set) in put_links()
1661 for (entry = header->ctl_table; entry->procname; entry++) { in put_links()
1680 static void drop_sysctl_table(struct ctl_table_header *header) in drop_sysctl_table() argument
1682 struct ctl_dir *parent = header->parent; in drop_sysctl_table()
1684 if (--header->nreg) in drop_sysctl_table()
1688 put_links(header); in drop_sysctl_table()
1689 start_unregistering(header); in drop_sysctl_table()
1692 if (!--header->count) in drop_sysctl_table()
1693 kfree_rcu(header, rcu); in drop_sysctl_table()
1696 drop_sysctl_table(&parent->header); in drop_sysctl_table()
1706 void unregister_sysctl_table(struct ctl_table_header * header) in unregister_sysctl_table() argument
1711 if (header == NULL) in unregister_sysctl_table()
1714 nr_subheaders = count_subheaders(header->ctl_table_arg); in unregister_sysctl_table()
1719 subheaders = (struct ctl_table_header **)(header + 1); in unregister_sysctl_table()
1726 kfree(header); in unregister_sysctl_table()
1731 drop_sysctl_table(header); in unregister_sysctl_table()
1742 init_header(&set->dir.header, root, set, NULL, root_table); in setup_sysctl_set()