Lines Matching refs:table
186 struct ctl_node *node, struct ctl_table *table) in init_header() argument
188 head->ctl_table = table; in init_header()
189 head->ctl_table_arg = table; in init_header()
201 for (entry = table; entry->procname; entry++, node++) in init_header()
415 static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, int op) in sysctl_perm() argument
421 mode = root->permissions(head, table); in sysctl_perm()
423 mode = table->mode; in sysctl_perm()
429 struct ctl_table_header *head, struct ctl_table *table) in proc_sys_make_inode() argument
450 ei->sysctl_entry = table; in proc_sys_make_inode()
456 inode->i_mode = table->mode; in proc_sys_make_inode()
457 if (!S_ISDIR(table->mode)) { in proc_sys_make_inode()
470 root->set_ownership(head, table, &inode->i_uid, &inode->i_gid); in proc_sys_make_inode()
545 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_call_handler() local
558 if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ)) in proc_sys_call_handler()
563 if (!table->proc_handler) in proc_sys_call_handler()
581 error = BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, &kbuf, &count, in proc_sys_call_handler()
587 error = table->proc_handler(table, write, kbuf, &count, &iocb->ki_pos); in proc_sys_call_handler()
619 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_open() local
625 if (table->poll) in proc_sys_open()
626 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_open()
637 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_poll() local
645 if (!table->proc_handler) in proc_sys_poll()
648 if (!table->poll) in proc_sys_poll()
652 poll_wait(filp, &table->poll->wait, wait); in proc_sys_poll()
654 if (event != atomic_read(&table->poll->event)) { in proc_sys_poll()
655 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_poll()
668 struct ctl_table *table) in proc_sys_fill_cache() argument
676 qname.name = table->procname; in proc_sys_fill_cache()
677 qname.len = strlen(table->procname); in proc_sys_fill_cache()
688 inode = proc_sys_make_inode(dir->d_sb, head, table); in proc_sys_fill_cache()
717 struct ctl_table *table) in proc_sys_link_fill_cache() argument
726 if (sysctl_follow_link(&head, &table)) in proc_sys_link_fill_cache()
729 ret = proc_sys_fill_cache(file, ctx, head, table); in proc_sys_link_fill_cache()
735 static int scan(struct ctl_table_header *head, struct ctl_table *table, in scan() argument
744 if (unlikely(S_ISLNK(table->mode))) in scan()
745 res = proc_sys_link_fill_cache(file, ctx, head, table); in scan()
747 res = proc_sys_fill_cache(file, ctx, head, table); in scan()
792 struct ctl_table *table; in proc_sys_permission() local
803 table = PROC_I(inode)->sysctl_entry; in proc_sys_permission()
804 if (!table) /* global root - r-xr-xr-x */ in proc_sys_permission()
807 error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK); in proc_sys_permission()
837 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_getattr() local
843 if (table) in proc_sys_getattr()
844 stat->mode = (stat->mode & S_IFMT) | table->mode; in proc_sys_getattr()
949 struct ctl_table *table; in new_dir() local
961 table = (struct ctl_table *)(node + 1); in new_dir()
962 new_name = (char *)(table + 2); in new_dir()
965 table[0].procname = new_name; in new_dir()
966 table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; in new_dir()
967 init_header(&new->header, set->dir.header.root, set, node, table); in new_dir()
1081 static int sysctl_err(const char *path, struct ctl_table *table, char *fmt, ...) in sysctl_err() argument
1091 path, table->procname, &vaf); in sysctl_err()
1097 static int sysctl_check_table_array(const char *path, struct ctl_table *table) in sysctl_check_table_array() argument
1101 if ((table->proc_handler == proc_douintvec) || in sysctl_check_table_array()
1102 (table->proc_handler == proc_douintvec_minmax)) { in sysctl_check_table_array()
1103 if (table->maxlen != sizeof(unsigned int)) in sysctl_check_table_array()
1104 err |= sysctl_err(path, table, "array not allowed"); in sysctl_check_table_array()
1107 if (table->proc_handler == proc_dou8vec_minmax) { in sysctl_check_table_array()
1108 if (table->maxlen != sizeof(u8)) in sysctl_check_table_array()
1109 err |= sysctl_err(path, table, "array not allowed"); in sysctl_check_table_array()
1115 static int sysctl_check_table(const char *path, struct ctl_table *table) in sysctl_check_table() argument
1118 for (; table->procname; table++) { in sysctl_check_table()
1119 if (table->child) in sysctl_check_table()
1120 err |= sysctl_err(path, table, "Not a file"); in sysctl_check_table()
1122 if ((table->proc_handler == proc_dostring) || in sysctl_check_table()
1123 (table->proc_handler == proc_dointvec) || in sysctl_check_table()
1124 (table->proc_handler == proc_douintvec) || in sysctl_check_table()
1125 (table->proc_handler == proc_douintvec_minmax) || in sysctl_check_table()
1126 (table->proc_handler == proc_dointvec_minmax) || in sysctl_check_table()
1127 (table->proc_handler == proc_dou8vec_minmax) || in sysctl_check_table()
1128 (table->proc_handler == proc_dointvec_jiffies) || in sysctl_check_table()
1129 (table->proc_handler == proc_dointvec_userhz_jiffies) || in sysctl_check_table()
1130 (table->proc_handler == proc_dointvec_ms_jiffies) || in sysctl_check_table()
1131 (table->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1132 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1133 if (!table->data) in sysctl_check_table()
1134 err |= sysctl_err(path, table, "No data"); in sysctl_check_table()
1135 if (!table->maxlen) in sysctl_check_table()
1136 err |= sysctl_err(path, table, "No maxlen"); in sysctl_check_table()
1138 err |= sysctl_check_table_array(path, table); in sysctl_check_table()
1140 if (!table->proc_handler) in sysctl_check_table()
1141 err |= sysctl_err(path, table, "No proc_handler"); in sysctl_check_table()
1143 if ((table->mode & (S_IRUGO|S_IWUGO)) != table->mode) in sysctl_check_table()
1144 err |= sysctl_err(path, table, "bogus .mode 0%o", in sysctl_check_table()
1145 table->mode); in sysctl_check_table()
1150 static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, in new_links() argument
1161 for (entry = table; entry->procname; entry++) { in new_links()
1179 for (link = link_table, entry = table; entry->procname; link++, entry++) { in new_links()
1194 struct ctl_table *table, struct ctl_table_root *link_root) in get_links() argument
1200 for (entry = table; entry->procname; entry++) { in get_links()
1213 for (entry = table; entry->procname; entry++) { in get_links()
1306 const char *path, struct ctl_table *table) in __register_sysctl_table() argument
1316 for (entry = table; entry->procname; entry++) in __register_sysctl_table()
1325 init_header(header, root, set, node, table); in __register_sysctl_table()
1326 if (sysctl_check_table(path, table)) in __register_sysctl_table()
1381 struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table) in register_sysctl() argument
1384 path, table); in register_sysctl()
1408 void __init __register_sysctl_init(const char *path, struct ctl_table *table, in __register_sysctl_init() argument
1411 struct ctl_table_header *hdr = register_sysctl(path, table); in __register_sysctl_init()
1433 static int count_subheaders(struct ctl_table *table) in count_subheaders() argument
1440 if (!table || !table->procname) in count_subheaders()
1443 for (entry = table; entry->procname; entry++) { in count_subheaders()
1454 struct ctl_table *table) in register_leaf_sysctl_tables() argument
1462 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1469 files = table; in register_leaf_sysctl_tables()
1479 for (new = files, entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1503 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1539 const struct ctl_path *path, struct ctl_table *table) in __register_sysctl_paths() argument
1541 struct ctl_table *ctl_table_arg = table; in __register_sysctl_paths()
1542 int nr_subheaders = count_subheaders(table); in __register_sysctl_paths()
1557 while (table->procname && table->child && !table[1].procname) { in __register_sysctl_paths()
1558 pos = append_path(new_path, pos, table->procname); in __register_sysctl_paths()
1561 table = table->child; in __register_sysctl_paths()
1564 header = __register_sysctl_table(set, new_path, table); in __register_sysctl_paths()
1578 set, table)) in __register_sysctl_paths()
1589 struct ctl_table *table = subh->ctl_table_arg; in __register_sysctl_paths() local
1591 kfree(table); in __register_sysctl_paths()
1609 struct ctl_table *table) in register_sysctl_paths() argument
1612 path, table); in register_sysctl_paths()
1625 struct ctl_table_header *register_sysctl_table(struct ctl_table *table) in register_sysctl_table() argument
1629 return register_sysctl_paths(null_path, table); in register_sysctl_table()
1709 struct ctl_table *table = subh->ctl_table_arg; in unregister_sysctl_table() local
1711 kfree(table); in unregister_sysctl_table()