Lines Matching full:table

190 	struct ctl_node *node, struct ctl_table *table)  in init_header()  argument
192 head->ctl_table = table; in init_header()
193 head->ctl_table_arg = table; in init_header()
205 for (entry = table; entry->procname; entry++, node++) in init_header()
419 static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, int op) in sysctl_perm() argument
425 mode = root->permissions(head, table); in sysctl_perm()
427 mode = table->mode; in sysctl_perm()
433 struct ctl_table_header *head, struct ctl_table *table) in proc_sys_make_inode() argument
454 ei->sysctl_entry = table; in proc_sys_make_inode()
460 inode->i_mode = table->mode; in proc_sys_make_inode()
461 if (!S_ISDIR(table->mode)) { in proc_sys_make_inode()
474 root->set_ownership(head, table, &inode->i_uid, &inode->i_gid); in proc_sys_make_inode()
549 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_call_handler() local
562 if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ)) in proc_sys_call_handler()
567 if (!table->proc_handler) in proc_sys_call_handler()
585 error = BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, &kbuf, &count, in proc_sys_call_handler()
591 error = table->proc_handler(table, write, kbuf, &count, &iocb->ki_pos); in proc_sys_call_handler()
623 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_open() local
629 if (table->poll) in proc_sys_open()
630 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_open()
641 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_poll() local
649 if (!table->proc_handler) in proc_sys_poll()
652 if (!table->poll) in proc_sys_poll()
656 poll_wait(filp, &table->poll->wait, wait); in proc_sys_poll()
658 if (event != atomic_read(&table->poll->event)) { in proc_sys_poll()
659 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_poll()
672 struct ctl_table *table) in proc_sys_fill_cache() argument
680 qname.name = table->procname; in proc_sys_fill_cache()
681 qname.len = strlen(table->procname); in proc_sys_fill_cache()
692 inode = proc_sys_make_inode(dir->d_sb, head, table); in proc_sys_fill_cache()
721 struct ctl_table *table) in proc_sys_link_fill_cache() argument
730 if (sysctl_follow_link(&head, &table)) in proc_sys_link_fill_cache()
733 ret = proc_sys_fill_cache(file, ctx, head, table); in proc_sys_link_fill_cache()
739 static int scan(struct ctl_table_header *head, struct ctl_table *table, in scan() argument
748 if (unlikely(S_ISLNK(table->mode))) in scan()
749 res = proc_sys_link_fill_cache(file, ctx, head, table); in scan()
751 res = proc_sys_fill_cache(file, ctx, head, table); in scan()
795 struct ctl_table *table; in proc_sys_permission() local
806 table = PROC_I(inode)->sysctl_entry; in proc_sys_permission()
807 if (!table) /* global root - r-xr-xr-x */ in proc_sys_permission()
809 else /* Use the permissions on the sysctl table entry */ in proc_sys_permission()
810 error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK); in proc_sys_permission()
838 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_getattr() local
844 if (table) in proc_sys_getattr()
845 stat->mode = (stat->mode & S_IFMT) | table->mode; in proc_sys_getattr()
950 struct ctl_table *table; in new_dir() local
962 table = (struct ctl_table *)(node + 1); in new_dir()
963 new_name = (char *)(table + 2); in new_dir()
966 table[0].procname = new_name; in new_dir()
967 table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; in new_dir()
968 init_header(&new->header, set->dir.header.root, set, node, table); in new_dir()
1082 static int sysctl_err(const char *path, struct ctl_table *table, char *fmt, ...) in sysctl_err() argument
1091 pr_err("sysctl table check failed: %s/%s %pV\n", in sysctl_err()
1092 path, table->procname, &vaf); in sysctl_err()
1098 static int sysctl_check_table_array(const char *path, struct ctl_table *table) in sysctl_check_table_array() argument
1102 if ((table->proc_handler == proc_douintvec) || in sysctl_check_table_array()
1103 (table->proc_handler == proc_douintvec_minmax)) { in sysctl_check_table_array()
1104 if (table->maxlen != sizeof(unsigned int)) in sysctl_check_table_array()
1105 err |= sysctl_err(path, table, "array not allowed"); in sysctl_check_table_array()
1111 static int sysctl_check_table(const char *path, struct ctl_table *table) in sysctl_check_table() argument
1114 for (; table->procname; table++) { in sysctl_check_table()
1115 if (table->child) in sysctl_check_table()
1116 err |= sysctl_err(path, table, "Not a file"); in sysctl_check_table()
1118 if ((table->proc_handler == proc_dostring) || in sysctl_check_table()
1119 (table->proc_handler == proc_dointvec) || in sysctl_check_table()
1120 (table->proc_handler == proc_douintvec) || in sysctl_check_table()
1121 (table->proc_handler == proc_douintvec_minmax) || in sysctl_check_table()
1122 (table->proc_handler == proc_dointvec_minmax) || in sysctl_check_table()
1123 (table->proc_handler == proc_dointvec_jiffies) || in sysctl_check_table()
1124 (table->proc_handler == proc_dointvec_userhz_jiffies) || in sysctl_check_table()
1125 (table->proc_handler == proc_dointvec_ms_jiffies) || in sysctl_check_table()
1126 (table->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1127 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1128 if (!table->data) in sysctl_check_table()
1129 err |= sysctl_err(path, table, "No data"); in sysctl_check_table()
1130 if (!table->maxlen) in sysctl_check_table()
1131 err |= sysctl_err(path, table, "No maxlen"); in sysctl_check_table()
1133 err |= sysctl_check_table_array(path, table); in sysctl_check_table()
1135 if (!table->proc_handler) in sysctl_check_table()
1136 err |= sysctl_err(path, table, "No proc_handler"); in sysctl_check_table()
1138 if ((table->mode & (S_IRUGO|S_IWUGO)) != table->mode) in sysctl_check_table()
1139 err |= sysctl_err(path, table, "bogus .mode 0%o", in sysctl_check_table()
1140 table->mode); in sysctl_check_table()
1145 static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, in new_links() argument
1156 for (entry = table; entry->procname; entry++) { in new_links()
1174 for (link = link_table, entry = table; entry->procname; link++, entry++) { in new_links()
1189 struct ctl_table *table, struct ctl_table_root *link_root) in get_links() argument
1194 /* Are there links available for every entry in table? */ in get_links()
1195 for (entry = table; entry->procname; entry++) { in get_links()
1208 for (entry = table; entry->procname; entry++) { in get_links()
1258 * __register_sysctl_table - register a leaf sysctl table
1260 * @path: The path to the directory the sysctl table is in.
1261 * @table: the top-level table structure
1263 * Register a sysctl table hierarchy. @table should be a filled in ctl_table
1264 * array. A completely 0 filled entry terminates the table.
1297 * to the table header on success.
1301 const char *path, struct ctl_table *table) in __register_sysctl_table() argument
1311 for (entry = table; entry->procname; entry++) in __register_sysctl_table()
1320 init_header(header, root, set, node, table); in __register_sysctl_table()
1321 if (sysctl_check_table(path, table)) in __register_sysctl_table()
1367 * register_sysctl - register a sysctl table
1368 * @path: The path to the directory the sysctl table is in.
1369 * @table: the table structure
1371 * Register a sysctl table. @table should be a filled in ctl_table
1372 * array. A completely 0 filled entry terminates the table.
1376 struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table) in register_sysctl() argument
1379 path, table); in register_sysctl()
1396 static int count_subheaders(struct ctl_table *table) in count_subheaders() argument
1403 if (!table || !table->procname) in count_subheaders()
1406 for (entry = table; entry->procname; entry++) { in count_subheaders()
1417 struct ctl_table *table) in register_leaf_sysctl_tables() argument
1425 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1432 files = table; in register_leaf_sysctl_tables()
1433 /* If there are mixed files and directories we need a new table */ in register_leaf_sysctl_tables()
1442 for (new = files, entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1459 /* Remember if we need to free the file table */ in register_leaf_sysctl_tables()
1466 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1490 * __register_sysctl_paths - register a sysctl table hierarchy
1492 * @path: The path to the directory the sysctl table is in.
1493 * @table: the top-level table structure
1495 * Register a sysctl table hierarchy. @table should be a filled in ctl_table
1496 * array. A completely 0 filled entry terminates the table.
1502 const struct ctl_path *path, struct ctl_table *table) in __register_sysctl_paths() argument
1504 struct ctl_table *ctl_table_arg = table; in __register_sysctl_paths()
1505 int nr_subheaders = count_subheaders(table); in __register_sysctl_paths()
1520 while (table->procname && table->child && !table[1].procname) { in __register_sysctl_paths()
1521 pos = append_path(new_path, pos, table->procname); in __register_sysctl_paths()
1524 table = table->child; in __register_sysctl_paths()
1527 header = __register_sysctl_table(set, new_path, table); in __register_sysctl_paths()
1541 set, table)) in __register_sysctl_paths()
1552 struct ctl_table *table = subh->ctl_table_arg; in __register_sysctl_paths() local
1554 kfree(table); in __register_sysctl_paths()
1562 * register_sysctl_table_path - register a sysctl table hierarchy
1563 * @path: The path to the directory the sysctl table is in.
1564 * @table: the top-level table structure
1566 * Register a sysctl table hierarchy. @table should be a filled in ctl_table
1567 * array. A completely 0 filled entry terminates the table.
1572 struct ctl_table *table) in register_sysctl_paths() argument
1575 path, table); in register_sysctl_paths()
1580 * register_sysctl_table - register a sysctl table hierarchy
1581 * @table: the top-level table structure
1583 * Register a sysctl table hierarchy. @table should be a filled in ctl_table
1584 * array. A completely 0 filled entry terminates the table.
1588 struct ctl_table_header *register_sysctl_table(struct ctl_table *table) in register_sysctl_table() argument
1592 return register_sysctl_paths(null_path, table); in register_sysctl_table()
1650 * unregister_sysctl_table - unregister a sysctl table hierarchy
1653 * Unregisters the sysctl table and all children. proc entries may not
1672 struct ctl_table *table = subh->ctl_table_arg; in unregister_sysctl_table() local
1674 kfree(table); in unregister_sysctl_table()