Lines Matching refs:table

183 	struct ctl_node *node, struct ctl_table *table)  in init_header()  argument
185 head->ctl_table = table; in init_header()
186 head->ctl_table_arg = table; in init_header()
198 for (entry = table; entry->procname; entry++, node++) in init_header()
445 static int sysctl_perm(struct ctl_table_header *head, struct ctl_table *table, int op) in sysctl_perm() argument
451 mode = root->permissions(head, table); in sysctl_perm()
453 mode = table->mode; in sysctl_perm()
459 struct ctl_table_header *head, struct ctl_table *table) in proc_sys_make_inode() argument
481 ei->sysctl_entry = table; in proc_sys_make_inode()
487 inode->i_mode = table->mode; in proc_sys_make_inode()
488 if (!S_ISDIR(table->mode)) { in proc_sys_make_inode()
501 root->set_ownership(head, table, &inode->i_uid, &inode->i_gid); in proc_sys_make_inode()
572 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_call_handler() local
584 if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ)) in proc_sys_call_handler()
589 if (!table->proc_handler) in proc_sys_call_handler()
594 error = table->proc_handler(table, write, buf, &res, ppos); in proc_sys_call_handler()
618 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_open() local
624 if (table->poll) in proc_sys_open()
625 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_open()
636 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_poll() local
644 if (!table->proc_handler) in proc_sys_poll()
647 if (!table->poll) in proc_sys_poll()
651 poll_wait(filp, &table->poll->wait, wait); in proc_sys_poll()
653 if (event != atomic_read(&table->poll->event)) { in proc_sys_poll()
654 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_poll()
667 struct ctl_table *table) in proc_sys_fill_cache() argument
675 qname.name = table->procname; in proc_sys_fill_cache()
676 qname.len = strlen(table->procname); in proc_sys_fill_cache()
687 inode = proc_sys_make_inode(dir->d_sb, head, table); in proc_sys_fill_cache()
716 struct ctl_table *table) in proc_sys_link_fill_cache() argument
725 if (sysctl_follow_link(&head, &table)) in proc_sys_link_fill_cache()
728 ret = proc_sys_fill_cache(file, ctx, head, table); in proc_sys_link_fill_cache()
734 static int scan(struct ctl_table_header *head, struct ctl_table *table, in scan() argument
743 if (unlikely(S_ISLNK(table->mode))) in scan()
744 res = proc_sys_link_fill_cache(file, ctx, head, table); in scan()
746 res = proc_sys_fill_cache(file, ctx, head, table); in scan()
790 struct ctl_table *table; in proc_sys_permission() local
801 table = PROC_I(inode)->sysctl_entry; in proc_sys_permission()
802 if (!table) /* global root - r-xr-xr-x */ in proc_sys_permission()
805 error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK); in proc_sys_permission()
833 struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_getattr() local
839 if (table) in proc_sys_getattr()
840 stat->mode = (stat->mode & S_IFMT) | table->mode; in proc_sys_getattr()
943 struct ctl_table *table; in new_dir() local
955 table = (struct ctl_table *)(node + 1); in new_dir()
956 new_name = (char *)(table + 2); in new_dir()
959 table[0].procname = new_name; in new_dir()
960 table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; in new_dir()
961 init_header(&new->header, set->dir.header.root, set, node, table); in new_dir()
1075 static int sysctl_err(const char *path, struct ctl_table *table, char *fmt, ...) in sysctl_err() argument
1085 path, table->procname, &vaf); in sysctl_err()
1091 static int sysctl_check_table_array(const char *path, struct ctl_table *table) in sysctl_check_table_array() argument
1095 if ((table->proc_handler == proc_douintvec) || in sysctl_check_table_array()
1096 (table->proc_handler == proc_douintvec_minmax)) { in sysctl_check_table_array()
1097 if (table->maxlen != sizeof(unsigned int)) in sysctl_check_table_array()
1098 err |= sysctl_err(path, table, "array not allowed"); in sysctl_check_table_array()
1104 static int sysctl_check_table(const char *path, struct ctl_table *table) in sysctl_check_table() argument
1107 for (; table->procname; table++) { in sysctl_check_table()
1108 if (table->child) in sysctl_check_table()
1109 err |= sysctl_err(path, table, "Not a file"); in sysctl_check_table()
1111 if ((table->proc_handler == proc_dostring) || in sysctl_check_table()
1112 (table->proc_handler == proc_dointvec) || in sysctl_check_table()
1113 (table->proc_handler == proc_douintvec) || in sysctl_check_table()
1114 (table->proc_handler == proc_douintvec_minmax) || in sysctl_check_table()
1115 (table->proc_handler == proc_dointvec_minmax) || in sysctl_check_table()
1116 (table->proc_handler == proc_dointvec_jiffies) || in sysctl_check_table()
1117 (table->proc_handler == proc_dointvec_userhz_jiffies) || in sysctl_check_table()
1118 (table->proc_handler == proc_dointvec_ms_jiffies) || in sysctl_check_table()
1119 (table->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1120 (table->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1121 if (!table->data) in sysctl_check_table()
1122 err |= sysctl_err(path, table, "No data"); in sysctl_check_table()
1123 if (!table->maxlen) in sysctl_check_table()
1124 err |= sysctl_err(path, table, "No maxlen"); in sysctl_check_table()
1126 err |= sysctl_check_table_array(path, table); in sysctl_check_table()
1128 if (!table->proc_handler) in sysctl_check_table()
1129 err |= sysctl_err(path, table, "No proc_handler"); in sysctl_check_table()
1131 if ((table->mode & (S_IRUGO|S_IWUGO)) != table->mode) in sysctl_check_table()
1132 err |= sysctl_err(path, table, "bogus .mode 0%o", in sysctl_check_table()
1133 table->mode); in sysctl_check_table()
1138 static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table *table, in new_links() argument
1149 for (entry = table; entry->procname; entry++) { in new_links()
1167 for (link = link_table, entry = table; entry->procname; link++, entry++) { in new_links()
1182 struct ctl_table *table, struct ctl_table_root *link_root) in get_links() argument
1188 for (entry = table; entry->procname; entry++) { in get_links()
1201 for (entry = table; entry->procname; entry++) { in get_links()
1294 const char *path, struct ctl_table *table) in __register_sysctl_table() argument
1304 for (entry = table; entry->procname; entry++) in __register_sysctl_table()
1313 init_header(header, root, set, node, table); in __register_sysctl_table()
1314 if (sysctl_check_table(path, table)) in __register_sysctl_table()
1369 struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table) in register_sysctl() argument
1372 path, table); in register_sysctl()
1389 static int count_subheaders(struct ctl_table *table) in count_subheaders() argument
1396 if (!table || !table->procname) in count_subheaders()
1399 for (entry = table; entry->procname; entry++) { in count_subheaders()
1410 struct ctl_table *table) in register_leaf_sysctl_tables() argument
1418 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1425 files = table; in register_leaf_sysctl_tables()
1435 for (new = files, entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1459 for (entry = table; entry->procname; entry++) { in register_leaf_sysctl_tables()
1495 const struct ctl_path *path, struct ctl_table *table) in __register_sysctl_paths() argument
1497 struct ctl_table *ctl_table_arg = table; in __register_sysctl_paths()
1498 int nr_subheaders = count_subheaders(table); in __register_sysctl_paths()
1513 while (table->procname && table->child && !table[1].procname) { in __register_sysctl_paths()
1514 pos = append_path(new_path, pos, table->procname); in __register_sysctl_paths()
1517 table = table->child; in __register_sysctl_paths()
1520 header = __register_sysctl_table(set, new_path, table); in __register_sysctl_paths()
1534 set, table)) in __register_sysctl_paths()
1545 struct ctl_table *table = subh->ctl_table_arg; in __register_sysctl_paths() local
1547 kfree(table); in __register_sysctl_paths()
1565 struct ctl_table *table) in register_sysctl_paths() argument
1568 path, table); in register_sysctl_paths()
1581 struct ctl_table_header *register_sysctl_table(struct ctl_table *table) in register_sysctl_table() argument
1585 return register_sysctl_paths(null_path, table); in register_sysctl_table()
1662 struct ctl_table *table = subh->ctl_table_arg; in unregister_sysctl_table() local
1664 kfree(table); in unregister_sysctl_table()