Lines Matching defs:table
194 struct ctl_node *node, const struct ctl_table *table, size_t table_size)
196 head->ctl_table = table;
198 head->ctl_table_arg = table;
216 if (table == sysctl_mount_point)
436 static int sysctl_perm(struct ctl_table_header *head, const struct ctl_table *table, int op)
442 mode = root->permissions(head, table);
444 mode = table->mode;
450 struct ctl_table_header *head, const struct ctl_table *table)
471 ei->sysctl_entry = table;
477 inode->i_mode = table->mode;
478 if (!S_ISDIR(table->mode)) {
558 const struct ctl_table *table = PROC_I(inode)->sysctl_entry;
571 if (sysctl_perm(head, table, write ? MAY_WRITE : MAY_READ))
576 if (!table->proc_handler)
594 error = BPF_CGROUP_RUN_PROG_SYSCTL(head, table, write, &kbuf, &count,
600 error = table->proc_handler(table, write, kbuf, &count, &iocb->ki_pos);
632 const struct ctl_table *table = PROC_I(inode)->sysctl_entry;
638 if (table->poll)
639 filp->private_data = proc_sys_poll_event(table->poll);
650 const struct ctl_table *table = PROC_I(inode)->sysctl_entry;
658 if (!table->proc_handler)
661 if (!table->poll)
665 poll_wait(filp, &table->poll->wait, wait);
667 if (event != atomic_read(&table->poll->event)) {
668 filp->private_data = proc_sys_poll_event(table->poll);
681 const struct ctl_table *table)
689 qname.name = table->procname;
690 qname.len = strlen(table->procname);
701 inode = proc_sys_make_inode(dir->d_sb, head, table);
725 const struct ctl_table *table)
734 if (sysctl_follow_link(&head, &table))
737 ret = proc_sys_fill_cache(file, ctx, head, table);
743 static int scan(struct ctl_table_header *head, const struct ctl_table *table,
752 if (unlikely(S_ISLNK(table->mode)))
753 res = proc_sys_link_fill_cache(file, ctx, head, table);
755 res = proc_sys_fill_cache(file, ctx, head, table);
800 const struct ctl_table *table;
811 table = PROC_I(inode)->sysctl_entry;
812 if (!table) /* global root - r-xr-xr-x */
814 else /* Use the permissions on the sysctl table entry */
815 error = sysctl_perm(head, table, mask & ~MAY_NOT_BLOCK);
844 const struct ctl_table *table = PROC_I(inode)->sysctl_entry;
850 if (table)
851 stat->mode = (stat->mode & S_IFMT) | table->mode;
961 struct ctl_table *table;
973 table = (struct ctl_table *)(node + 1);
974 new_name = (char *)(table + 1);
976 table[0].procname = new_name;
977 table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO;
978 init_header(&new->header, set->dir.header.root, set, node, table, 1);
1091 static int sysctl_err(const char *path, const struct ctl_table *table, char *fmt, ...)
1100 pr_err("sysctl table check failed: %s/%s %pV\n",
1101 path, table->procname, &vaf);
1107 static int sysctl_check_table_array(const char *path, const struct ctl_table *table)
1112 if ((table->proc_handler == proc_douintvec) ||
1113 (table->proc_handler == proc_douintvec_minmax)) {
1114 if (table->maxlen != sizeof(unsigned int))
1115 err |= sysctl_err(path, table, "array not allowed");
1118 if (table->proc_handler == proc_dou8vec_minmax) {
1119 if (table->maxlen != sizeof(u8))
1120 err |= sysctl_err(path, table, "array not allowed");
1122 if (table->extra1) {
1123 extra = *(unsigned int *) table->extra1;
1125 err |= sysctl_err(path, table,
1128 if (table->extra2) {
1129 extra = *(unsigned int *) table->extra2;
1131 err |= sysctl_err(path, table,
1136 if (table->proc_handler == proc_dobool) {
1137 if (table->maxlen != sizeof(bool))
1138 err |= sysctl_err(path, table, "array not allowed");
1235 /* Are there links available for every entry in table? */
1328 * __register_sysctl_table - register a leaf sysctl table
1330 * @path: The path to the directory the sysctl table is in.
1332 * @table: the top-level table structure. This table should not be free'd
1336 * @table_size : The number of elements in table
1338 * Register a sysctl table hierarchy. @table should be a filled in ctl_table
1368 * to the table header on success.
1372 const char *path, const struct ctl_table *table, size_t table_size)
1385 init_header(header, root, set, node, table, table_size);
1416 * register_sysctl_sz - register a sysctl table
1417 * @path: The path to the directory the sysctl table is in. If the path
1419 * @table: the table structure. The calller must ensure the life of the @table
1421 * until unregister_sysctl_table() is called with the given returned table
1426 * @table_size: The number of elements in table.
1428 * Register a sysctl table. @table should be a filled in ctl_table
1429 * array. A completely 0 filled entry terminates the table.
1433 struct ctl_table_header *register_sysctl_sz(const char *path, const struct ctl_table *table,
1437 path, table, table_size);
1442 * __register_sysctl_init() - register sysctl table to path
1445 * @table: This is the sysctl table that needs to be registered to the path.
1446 * The caller must ensure the life of the @table will be kept during the
1448 * @table_name: The name of sysctl table, only used for log printing when
1450 * @table_size: The number of elements in table
1462 void __init __register_sysctl_init(const char *path, const struct ctl_table *table,
1465 struct ctl_table_header *hdr = register_sysctl_sz(path, table, table_size);
1528 * unregister_sysctl_table - unregister a sysctl table hierarchy
1531 * Unregisters the sysctl table and all children. proc entries may not