Lines Matching refs:table
181 struct ctl_node *node, struct ctl_table *table) in init_header() argument
183 head->ctl_table = table; in init_header()
184 head->ctl_table_arg = table; in init_header()
195 for (entry = table; entry->procname; entry++, node++) in init_header()
417 static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, int op) in sysctl_perm() argument
423 mode = root->permissions(head, table); in sysctl_perm()
425 mode = table->mode; in sysctl_perm()
431 struct ctl_table_header *head, struct ctl_table *table) in proc_sys_make_inode() argument
445 ei->sysctl_entry = table; in proc_sys_make_inode()
448 inode->i_mode = table->mode; in proc_sys_make_inode()
449 if (!S_ISDIR(table->mode)) { in proc_sys_make_inode()
521 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_call_handler() local
533 if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ)) in proc_sys_call_handler()
538 if (!table->proc_handler) in proc_sys_call_handler()
543 error = table->proc_handler(table, write, buf, &res, ppos); in proc_sys_call_handler()
567 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_open() local
573 if (table->poll) in proc_sys_open()
574 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_open()
585 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_poll() local
593 if (!table->proc_handler) in proc_sys_poll()
596 if (!table->poll) in proc_sys_poll()
600 poll_wait(filp, &table->poll->wait, wait); in proc_sys_poll()
602 if (event != atomic_read(&table->poll->event)) { in proc_sys_poll()
603 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_poll()
616 struct ctl_table *table) in proc_sys_fill_cache() argument
624 qname.name = table->procname; in proc_sys_fill_cache()
625 qname.len = strlen(table->procname); in proc_sys_fill_cache()
632 inode = proc_sys_make_inode(dir->d_sb, head, table); in proc_sys_fill_cache()
654 struct ctl_table *table) in proc_sys_link_fill_cache() argument
659 if (S_ISLNK(table->mode)) { in proc_sys_link_fill_cache()
661 int err = sysctl_follow_link(&head, &table, current->nsproxy); in proc_sys_link_fill_cache()
666 ret = proc_sys_fill_cache(file, ctx, head, table); in proc_sys_link_fill_cache()
672 static int scan(struct ctl_table_header *head, struct ctl_table *table, in scan() argument
681 if (unlikely(S_ISLNK(table->mode))) in scan()
682 res = proc_sys_link_fill_cache(file, ctx, head, table); in scan()
684 res = proc_sys_fill_cache(file, ctx, head, table); in scan()
727 struct ctl_table *table; in proc_sys_permission() local
738 table = PROC_I(inode)->sysctl_entry; in proc_sys_permission()
739 if (!table) /* global root - r-xr-xr-x */ in proc_sys_permission()
742 error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK); in proc_sys_permission()
769 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_getattr() local
775 if (table) in proc_sys_getattr()
776 stat->mode = (stat->mode & S_IFMT) | table->mode; in proc_sys_getattr()
879 struct ctl_table *table; in new_dir() local
891 table = (struct ctl_table *)(node + 1); in new_dir()
892 new_name = (char *)(table + 2); in new_dir()
895 table[0].procname = new_name; in new_dir()
896 table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; in new_dir()
897 init_header(&new->header, set->dir.header.root, set, node, table); in new_dir()
1011 static int sysctl_err(const char *path, struct ctl_table *table, char *fmt, ...) in sysctl_err() argument
1021 path, table->procname, &vaf); in sysctl_err()
1027 static int sysctl_check_table(const char *path, struct ctl_table *table) in sysctl_check_table() argument
1030 for (; table->procname; table++) { in sysctl_check_table()
1031 if (table->child) in sysctl_check_table()
1032 err = sysctl_err(path, table, "Not a file"); in sysctl_check_table()
1034 if ((table->proc_handler == proc_dostring) || in sysctl_check_table()
1035 (table->proc_handler == proc_dointvec) || in sysctl_check_table()
1036 (table->proc_handler == proc_dointvec_minmax) || in sysctl_check_table()
1037 (table->proc_handler == proc_dointvec_jiffies) || in sysctl_check_table()
1038 (table->proc_handler == proc_dointvec_userhz_jiffies) || in sysctl_check_table()
1039 (table->proc_handler == proc_dointvec_ms_jiffies) || in sysctl_check_table()
1040 (table->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1041 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1042 if (!table->data) in sysctl_check_table()
1043 err = sysctl_err(path, table, "No data"); in sysctl_check_table()
1044 if (!table->maxlen) in sysctl_check_table()
1045 err = sysctl_err(path, table, "No maxlen"); in sysctl_check_table()
1047 if (!table->proc_handler) in sysctl_check_table()
1048 err = sysctl_err(path, table, "No proc_handler"); in sysctl_check_table()
1050 if ((table->mode & (S_IRUGO|S_IWUGO)) != table->mode) in sysctl_check_table()
1051 err = sysctl_err(path, table, "bogus .mode 0%o", in sysctl_check_table()
1052 table->mode); in sysctl_check_table()
1057 static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, in new_links() argument
1068 for (entry = table; entry->procname; entry++) { in new_links()
1086 for (link = link_table, entry = table; entry->procname; link++, entry++) { in new_links()
1101 struct ctl_table *table, struct ctl_table_root *link_root) in get_links() argument
1107 for (entry = table; entry->procname; entry++) { in get_links()
1120 for (entry = table; entry->procname; entry++) { in get_links()
1213 const char *path, struct ctl_table *table) in __register_sysctl_table() argument
1223 for (entry = table; entry->procname; entry++) in __register_sysctl_table()
1232 init_header(header, root, set, node, table); in __register_sysctl_table()
1233 if (sysctl_check_table(path, table)) in __register_sysctl_table()
1288 struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table) in register_sysctl() argument
1291 path, table); in register_sysctl()
1308 static int count_subheaders(struct ctl_table *table) in count_subheaders() argument
1315 if (!table || !table->procname) in count_subheaders()
1318 for (entry = table; entry->procname; entry++) { in count_subheaders()
1329 struct ctl_table *table) in register_leaf_sysctl_tables() argument
1337 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1344 files = table; in register_leaf_sysctl_tables()
1354 for (new = files, entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1378 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1414 const struct ctl_path *path, struct ctl_table *table) in __register_sysctl_paths() argument
1416 struct ctl_table *ctl_table_arg = table; in __register_sysctl_paths()
1417 int nr_subheaders = count_subheaders(table); in __register_sysctl_paths()
1432 while (table->procname && table->child && !table[1].procname) { in __register_sysctl_paths()
1433 pos = append_path(new_path, pos, table->procname); in __register_sysctl_paths()
1436 table = table->child; in __register_sysctl_paths()
1439 header = __register_sysctl_table(set, new_path, table); in __register_sysctl_paths()
1453 set, table)) in __register_sysctl_paths()
1464 struct ctl_table *table = subh->ctl_table_arg; in __register_sysctl_paths() local
1466 kfree(table); in __register_sysctl_paths()
1484 struct ctl_table *table) in register_sysctl_paths() argument
1487 path, table); in register_sysctl_paths()
1500 struct ctl_table_header *register_sysctl_table(struct ctl_table *table) in register_sysctl_table() argument
1504 return register_sysctl_paths(null_path, table); in register_sysctl_table()
1581 struct ctl_table *table = subh->ctl_table_arg; in unregister_sysctl_table() local
1583 kfree(table); in unregister_sysctl_table()