Lines Matching +full:entry +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0
17 #include <linux/bpf-cgroup.h>
23 #define list_for_each_table_entry(entry, header) \ argument
24 entry = header->ctl_table; \
25 for (size_t i = 0 ; i < header->ctl_table_size; ++i, entry++)
35 * Must be non-empty to avoid sharing an address with other tables.
42 * register_sysctl_mount_point() - registers a sysctl mount point
56 (hptr->type == SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY)
58 (hptr->type = SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY)
60 (hptr->type = SYSCTL_TABLE_TYPE_DEFAULT)
67 atomic_inc(&poll->event); in proc_sys_poll_notify()
68 wake_up_interruptible(&poll->wait); in proc_sys_poll_notify()
98 if (dir->header.parent) in sysctl_print_dir()
99 sysctl_print_dir(dir->header.parent); in sysctl_print_dir()
100 pr_cont("%s/", dir->header.ctl_table[0].procname); in sysctl_print_dir()
109 cmp = len1 - len2; in namecmp()
114 struct ctl_dir *dir, const char *name, int namelen) in find_entry() argument
117 const struct ctl_table *entry; in find_entry() local
118 struct rb_node *node = dir->root.rb_node; in find_entry()
129 head = ctl_node->header; in find_entry()
130 entry = &head->ctl_table[ctl_node - head->node]; in find_entry()
131 procname = entry->procname; in find_entry()
133 cmp = namecmp(name, namelen, procname, strlen(procname)); in find_entry()
135 node = node->rb_left; in find_entry()
137 node = node->rb_right; in find_entry()
140 return entry; in find_entry()
146 static int insert_entry(struct ctl_table_header *head, const struct ctl_table *entry) in insert_entry() argument
148 struct rb_node *node = &head->node[entry - head->ctl_table].node; in insert_entry()
149 struct rb_node **p = &head->parent->root.rb_node; in insert_entry()
151 const char *name = entry->procname; in insert_entry() local
152 int namelen = strlen(name); in insert_entry()
163 parent_head = parent_node->header; in insert_entry()
164 parent_entry = &parent_head->ctl_table[parent_node - parent_head->node]; in insert_entry()
165 parent_name = parent_entry->procname; in insert_entry()
167 cmp = namecmp(name, namelen, parent_name, strlen(parent_name)); in insert_entry()
169 p = &(*p)->rb_left; in insert_entry()
171 p = &(*p)->rb_right; in insert_entry()
173 pr_err("sysctl duplicate entry: "); in insert_entry()
174 sysctl_print_dir(head->parent); in insert_entry()
175 pr_cont("%s\n", entry->procname); in insert_entry()
176 return -EEXIST; in insert_entry()
181 rb_insert_color(node, &head->parent->root); in insert_entry()
185 static void erase_entry(struct ctl_table_header *head, const struct ctl_table *entry) in erase_entry() argument
187 struct rb_node *node = &head->node[entry - head->ctl_table].node; in erase_entry()
189 rb_erase(node, &head->parent->root); in erase_entry()
196 head->ctl_table = table; in init_header()
197 head->ctl_table_size = table_size; in init_header()
198 head->ctl_table_arg = table; in init_header()
199 head->used = 0; in init_header()
200 head->count = 1; in init_header()
201 head->nreg = 1; in init_header()
202 head->unregistering = NULL; in init_header()
203 head->root = root; in init_header()
204 head->set = set; in init_header()
205 head->parent = NULL; in init_header()
206 head->node = node; in init_header()
207 INIT_HLIST_HEAD(&head->inodes); in init_header()
209 const struct ctl_table *entry; in init_header() local
211 list_for_each_table_entry(entry, head) { in init_header()
212 node->header = head; in init_header()
222 const struct ctl_table *entry; in erase_header() local
224 list_for_each_table_entry(entry, head) in erase_header()
225 erase_entry(head, entry); in erase_header()
230 const struct ctl_table *entry; in insert_header() local
231 struct ctl_table_header *dir_h = &dir->header; in insert_header()
237 return -EROFS; in insert_header()
241 if (!RB_EMPTY_ROOT(&dir->root)) in insert_header()
242 return -EINVAL; in insert_header()
246 dir_h->nreg++; in insert_header()
247 header->parent = dir; in insert_header()
251 list_for_each_table_entry(entry, header) { in insert_header()
252 err = insert_entry(header, entry); in insert_header()
261 if (header->ctl_table == sysctl_mount_point) in insert_header()
263 header->parent = NULL; in insert_header()
272 if (unlikely(p->unregistering)) in use_table()
274 p->used++; in use_table()
282 if (!--p->used) in unuse_table()
283 if (unlikely(p->unregistering)) in unuse_table()
284 complete(p->unregistering); in unuse_table()
289 proc_invalidate_siblings_dcache(&head->inodes, &sysctl_lock); in proc_sys_invalidate_dcache()
298 * if p->used is 0, nobody will ever touch that entry again; in start_unregistering()
301 if (unlikely(p->used)) { in start_unregistering()
304 p->unregistering = &wait; in start_unregistering()
308 /* anything non-NULL; we'll never dereference it */ in start_unregistering()
309 p->unregistering = ERR_PTR(-EINVAL); in start_unregistering()
330 head = ERR_PTR(-ENOENT); in sysctl_head_grab()
347 struct ctl_table_set *set = &root->default_set; in lookup_header_set()
348 if (root->lookup) in lookup_header_set()
349 set = root->lookup(root); in lookup_header_set()
355 const char *name, int namelen) in lookup_entry() argument
358 const struct ctl_table *entry; in lookup_entry() local
361 entry = find_entry(&head, dir, name, namelen); in lookup_entry()
362 if (entry && use_table(head)) in lookup_entry()
365 entry = NULL; in lookup_entry()
367 return entry; in lookup_entry()
376 if (use_table(ctl_node->header)) in first_usable_entry()
386 const struct ctl_table *entry = NULL; in first_entry() local
390 ctl_node = first_usable_entry(rb_first(&dir->root)); in first_entry()
393 head = ctl_node->header; in first_entry()
394 entry = &head->ctl_table[ctl_node - head->node]; in first_entry()
397 *pentry = entry; in first_entry()
403 const struct ctl_table *entry = *pentry; in next_entry() local
404 struct ctl_node *ctl_node = &head->node[entry - head->ctl_table]; in next_entry()
409 ctl_node = first_usable_entry(rb_next(&ctl_node->node)); in next_entry()
413 head = ctl_node->header; in next_entry()
414 entry = &head->ctl_table[ctl_node - head->node]; in next_entry()
417 *pentry = entry; in next_entry()
433 return -EACCES; in test_perm()
438 struct ctl_table_root *root = head->root; in sysctl_perm()
441 if (root->permissions) in sysctl_perm()
442 mode = root->permissions(head, table); in sysctl_perm()
444 mode = table->mode; in sysctl_perm()
452 struct ctl_table_root *root = head->root; in proc_sys_make_inode()
458 return ERR_PTR(-ENOMEM); in proc_sys_make_inode()
460 inode->i_ino = get_next_ino(); in proc_sys_make_inode()
465 if (unlikely(head->unregistering)) { in proc_sys_make_inode()
468 return ERR_PTR(-ENOENT); in proc_sys_make_inode()
470 ei->sysctl = head; in proc_sys_make_inode()
471 ei->sysctl_entry = table; in proc_sys_make_inode()
472 hlist_add_head_rcu(&ei->sibling_inodes, &head->inodes); in proc_sys_make_inode()
473 head->count++; in proc_sys_make_inode()
477 inode->i_mode = table->mode; in proc_sys_make_inode()
478 if (!S_ISDIR(table->mode)) { in proc_sys_make_inode()
479 inode->i_mode |= S_IFREG; in proc_sys_make_inode()
480 inode->i_op = &proc_sys_inode_operations; in proc_sys_make_inode()
481 inode->i_fop = &proc_sys_file_operations; in proc_sys_make_inode()
483 inode->i_mode |= S_IFDIR; in proc_sys_make_inode()
484 inode->i_op = &proc_sys_dir_operations; in proc_sys_make_inode()
485 inode->i_fop = &proc_sys_dir_file_operations; in proc_sys_make_inode()
490 inode->i_uid = GLOBAL_ROOT_UID; in proc_sys_make_inode()
491 inode->i_gid = GLOBAL_ROOT_GID; in proc_sys_make_inode()
492 if (root->set_ownership) in proc_sys_make_inode()
493 root->set_ownership(head, &inode->i_uid, &inode->i_gid); in proc_sys_make_inode()
501 hlist_del_init_rcu(&PROC_I(inode)->sibling_inodes); in proc_sys_evict_inode()
502 if (!--head->count) in proc_sys_evict_inode()
509 struct ctl_table_header *head = PROC_I(inode)->sysctl; in grab_header()
520 const struct qstr *name = &dentry->d_name; in proc_sys_lookup() local
523 struct dentry *err = ERR_PTR(-ENOENT); in proc_sys_lookup()
532 p = lookup_entry(&h, ctl_dir, name->name, name->len); in proc_sys_lookup()
536 if (S_ISLNK(p->mode)) { in proc_sys_lookup()
544 inode = proc_sys_make_inode(dir->i_sb, h ? h : head, p); in proc_sys_lookup()
557 struct inode *inode = file_inode(iocb->ki_filp); in proc_sys_call_handler()
559 const struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_call_handler()
571 error = -EPERM; in proc_sys_call_handler()
575 /* if that can happen at all, it should be -EINVAL, not -EISDIR */ in proc_sys_call_handler()
576 error = -EINVAL; in proc_sys_call_handler()
577 if (!table->proc_handler) in proc_sys_call_handler()
581 error = -ENOMEM; in proc_sys_call_handler()
589 error = -EFAULT; in proc_sys_call_handler()
596 &iocb->ki_pos); in proc_sys_call_handler()
601 error = table->proc_handler(table, write, kbuf, &count, &iocb->ki_pos); in proc_sys_call_handler()
606 error = -EFAULT; in proc_sys_call_handler()
633 const struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_open()
639 if (table->poll) in proc_sys_open()
640 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_open()
651 const struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_poll()
659 if (!table->proc_handler) in proc_sys_poll()
662 if (!table->poll) in proc_sys_poll()
665 event = (unsigned long)filp->private_data; in proc_sys_poll()
666 poll_wait(filp, &table->poll->wait, wait); in proc_sys_poll()
668 if (event != atomic_read(&table->poll->event)) { in proc_sys_poll()
669 filp->private_data = proc_sys_poll_event(table->poll); in proc_sys_poll()
684 struct dentry *child, *dir = file->f_path.dentry; in proc_sys_fill_cache()
690 qname.name = table->procname; in proc_sys_fill_cache()
691 qname.len = strlen(table->procname); in proc_sys_fill_cache()
692 qname.hash = full_name_hash(dir, qname.name, qname.len); in proc_sys_fill_cache()
703 inode = proc_sys_make_inode(dir->d_sb, head, table); in proc_sys_fill_cache()
717 ino = inode->i_ino; in proc_sys_fill_cache()
718 type = inode->i_mode >> 12; in proc_sys_fill_cache()
720 return dir_emit(ctx, qname.name, qname.len, ino, type); in proc_sys_fill_cache()
750 if ((*pos)++ < ctx->pos) in scan()
753 if (unlikely(S_ISLNK(table->mode))) in scan()
759 ctx->pos = *pos; in scan()
768 const struct ctl_table *entry; in proc_sys_readdir() local
782 for (first_entry(ctl_dir, &h, &entry); h; next_entry(&h, &entry)) { in proc_sys_readdir()
783 if (!scan(h, entry, &pos, file, ctx)) { in proc_sys_readdir()
805 if ((mask & MAY_EXEC) && S_ISREG(inode->i_mode)) in proc_sys_permission()
806 return -EACCES; in proc_sys_permission()
812 table = PROC_I(inode)->sysctl_entry; in proc_sys_permission()
813 if (!table) /* global root - r-xr-xr-x */ in proc_sys_permission()
814 error = mask & MAY_WRITE ? -EACCES : 0; in proc_sys_permission()
815 else /* Use the permissions on the sysctl table entry */ in proc_sys_permission()
828 if (attr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) in proc_sys_setattr()
829 return -EPERM; in proc_sys_setattr()
843 struct inode *inode = d_inode(path->dentry); in proc_sys_getattr()
845 const struct ctl_table *table = PROC_I(inode)->sysctl_entry; in proc_sys_getattr()
852 stat->mode = (stat->mode & S_IFMT) | table->mode; in proc_sys_getattr()
887 static int proc_sys_revalidate(struct inode *dir, const struct qstr *name, in proc_sys_revalidate() argument
891 return -ECHILD; in proc_sys_revalidate()
892 return !PROC_I(d_inode(dentry))->sysctl->unregistering; in proc_sys_revalidate()
897 return !!PROC_I(d_inode(dentry))->sysctl->unregistering; in proc_sys_delete()
902 struct ctl_table_set *set = p->set; in sysctl_is_seen()
905 if (p->unregistering) in sysctl_is_seen()
907 else if (!set->is_seen) in sysctl_is_seen()
910 res = set->is_seen(set); in sysctl_is_seen()
916 unsigned int len, const char *str, const struct qstr *name) in proc_sys_compare() argument
921 /* Although proc doesn't have negative dentries, rcu-walk means in proc_sys_compare()
927 if (name->len != len) in proc_sys_compare()
929 if (memcmp(name->name, str, len)) in proc_sys_compare()
931 head = rcu_dereference(PROC_I(inode)->sysctl); in proc_sys_compare()
942 const char *name, int namelen) in find_subdir() argument
945 const struct ctl_table *entry; in find_subdir() local
947 entry = find_entry(&head, dir, name, namelen); in find_subdir()
948 if (!entry) in find_subdir()
949 return ERR_PTR(-ENOENT); in find_subdir()
950 if (!S_ISDIR(entry->mode)) in find_subdir()
951 return ERR_PTR(-ENOTDIR); in find_subdir()
956 const char *name, int namelen) in new_dir() argument
972 memcpy(new_name, name, namelen); in new_dir()
975 init_header(&new->header, set->dir.header.root, set, node, table, 1); in new_dir()
981 * get_subdir - find or create a subdir with the specified name.
983 * @name: The name of the subdirectory to find or create
984 * @namelen: The length of name
993 const char *name, int namelen) in get_subdir() argument
995 struct ctl_table_set *set = dir->header.set; in get_subdir()
1000 subdir = find_subdir(dir, name, namelen); in get_subdir()
1003 if (PTR_ERR(subdir) != -ENOENT) in get_subdir()
1007 new = new_dir(set, name, namelen); in get_subdir()
1009 subdir = ERR_PTR(-ENOMEM); in get_subdir()
1014 subdir = find_subdir(dir, name, namelen); in get_subdir()
1017 if (PTR_ERR(subdir) != -ENOENT) in get_subdir()
1020 /* Nope. Use the our freshly made directory entry. */ in get_subdir()
1021 err = insert_header(dir, &new->header); in get_subdir()
1027 subdir->header.nreg++; in get_subdir()
1032 pr_cont("%*.*s %ld\n", namelen, namelen, name, in get_subdir()
1035 drop_sysctl_table(&dir->header); in get_subdir()
1037 drop_sysctl_table(&new->header); in get_subdir()
1046 if (!dir->header.parent) in xlate_dir()
1047 return &set->dir; in xlate_dir()
1048 parent = xlate_dir(set, dir->header.parent); in xlate_dir()
1051 procname = dir->header.ctl_table[0].procname; in xlate_dir()
1059 const struct ctl_table *entry; in sysctl_follow_link() local
1066 root = (*pentry)->data; in sysctl_follow_link()
1068 dir = xlate_dir(set, (*phead)->parent); in sysctl_follow_link()
1072 const char *procname = (*pentry)->procname; in sysctl_follow_link()
1074 entry = find_entry(&head, dir, procname, strlen(procname)); in sysctl_follow_link()
1075 ret = -ENOENT; in sysctl_follow_link()
1076 if (entry && use_table(head)) { in sysctl_follow_link()
1079 *pentry = entry; in sysctl_follow_link()
1098 path, table->procname, &vaf); in sysctl_err()
1101 return -EINVAL; in sysctl_err()
1109 if ((table->proc_handler == proc_douintvec) || in sysctl_check_table_array()
1110 (table->proc_handler == proc_douintvec_minmax)) { in sysctl_check_table_array()
1111 if (table->maxlen != sizeof(unsigned int)) in sysctl_check_table_array()
1115 if (table->proc_handler == proc_dou8vec_minmax) { in sysctl_check_table_array()
1116 if (table->maxlen != sizeof(u8)) in sysctl_check_table_array()
1119 if (table->extra1) { in sysctl_check_table_array()
1120 extra = *(unsigned int *) table->extra1; in sysctl_check_table_array()
1125 if (table->extra2) { in sysctl_check_table_array()
1126 extra = *(unsigned int *) table->extra2; in sysctl_check_table_array()
1133 if (table->proc_handler == proc_dobool) { in sysctl_check_table_array()
1134 if (table->maxlen != sizeof(bool)) in sysctl_check_table_array()
1143 const struct ctl_table *entry; in sysctl_check_table() local
1145 list_for_each_table_entry(entry, header) { in sysctl_check_table()
1146 if (!entry->procname) in sysctl_check_table()
1147 err |= sysctl_err(path, entry, "procname is null"); in sysctl_check_table()
1148 if ((entry->proc_handler == proc_dostring) || in sysctl_check_table()
1149 (entry->proc_handler == proc_dobool) || in sysctl_check_table()
1150 (entry->proc_handler == proc_dointvec) || in sysctl_check_table()
1151 (entry->proc_handler == proc_douintvec) || in sysctl_check_table()
1152 (entry->proc_handler == proc_douintvec_minmax) || in sysctl_check_table()
1153 (entry->proc_handler == proc_dointvec_minmax) || in sysctl_check_table()
1154 (entry->proc_handler == proc_dou8vec_minmax) || in sysctl_check_table()
1155 (entry->proc_handler == proc_dointvec_jiffies) || in sysctl_check_table()
1156 (entry->proc_handler == proc_dointvec_userhz_jiffies) || in sysctl_check_table()
1157 (entry->proc_handler == proc_dointvec_ms_jiffies) || in sysctl_check_table()
1158 (entry->proc_handler == proc_doulongvec_minmax) || in sysctl_check_table()
1159 (entry->proc_handler == proc_doulongvec_ms_jiffies_minmax)) { in sysctl_check_table()
1160 if (!entry->data) in sysctl_check_table()
1161 err |= sysctl_err(path, entry, "No data"); in sysctl_check_table()
1162 if (!entry->maxlen) in sysctl_check_table()
1163 err |= sysctl_err(path, entry, "No maxlen"); in sysctl_check_table()
1165 err |= sysctl_check_table_array(path, entry); in sysctl_check_table()
1167 if (!entry->proc_handler) in sysctl_check_table()
1168 err |= sysctl_err(path, entry, "No proc_handler"); in sysctl_check_table()
1170 if ((entry->mode & (S_IRUGO|S_IWUGO)) != entry->mode) in sysctl_check_table()
1171 err |= sysctl_err(path, entry, "bogus .mode 0%o", in sysctl_check_table()
1172 entry->mode); in sysctl_check_table()
1181 const struct ctl_table *entry; in new_links() local
1187 list_for_each_table_entry(entry, head) { in new_links()
1188 name_bytes += strlen(entry->procname) + 1; in new_links()
1192 sizeof(struct ctl_node)*head->ctl_table_size + in new_links()
1193 sizeof(struct ctl_table)*head->ctl_table_size + in new_links()
1201 link_table = (struct ctl_table *)(node + head->ctl_table_size); in new_links()
1202 link_name = (char *)(link_table + head->ctl_table_size); in new_links()
1205 list_for_each_table_entry(entry, head) { in new_links()
1206 int len = strlen(entry->procname) + 1; in new_links()
1207 memcpy(link_name, entry->procname, len); in new_links()
1208 link->procname = link_name; in new_links()
1209 link->mode = S_IFLNK|S_IRWXUGO; in new_links()
1210 link->data = head->root; in new_links()
1214 init_header(links, dir->header.root, dir->header.set, node, link_table, in new_links()
1215 head->ctl_table_size); in new_links()
1216 links->nreg = head->ctl_table_size; in new_links()
1226 const struct ctl_table *entry, *link; in get_links() local
1228 if (header->ctl_table_size == 0 || in get_links()
1232 /* Are there links available for every entry in table? */ in get_links()
1233 list_for_each_table_entry(entry, header) { in get_links()
1234 const char *procname = entry->procname; in get_links()
1238 if (S_ISDIR(link->mode) && S_ISDIR(entry->mode)) in get_links()
1240 if (S_ISLNK(link->mode) && (link->data == link_root)) in get_links()
1246 list_for_each_table_entry(entry, header) { in get_links()
1247 const char *procname = entry->procname; in get_links()
1249 tmp_head->nreg++; in get_links()
1261 if (head->set == root_set) in insert_links()
1264 core_parent = xlate_dir(root_set, head->parent); in insert_links()
1268 if (get_links(core_parent, head, head->root)) in insert_links()
1271 core_parent->header.nreg++; in insert_links()
1277 err = -ENOMEM; in insert_links()
1282 if (get_links(core_parent, head, head->root)) { in insert_links()
1291 drop_sysctl_table(&core_parent->header); in insert_links()
1298 const char *name, *nextname; in sysctl_mkdir_p() local
1300 for (name = path; name; name = nextname) { in sysctl_mkdir_p()
1302 nextname = strchr(name, '/'); in sysctl_mkdir_p()
1304 namelen = nextname - name; in sysctl_mkdir_p()
1307 namelen = strlen(name); in sysctl_mkdir_p()
1313 * namelen ensures if name is "foo/bar/yay" only foo is in sysctl_mkdir_p()
1314 * registered first. We traverse as if using mkdir -p and in sysctl_mkdir_p()
1315 * return a ctl_dir for the last directory entry. in sysctl_mkdir_p()
1317 dir = get_subdir(dir, name, namelen); in sysctl_mkdir_p()
1325 * __register_sysctl_table - register a leaf sysctl table
1329 * @table: the top-level table structure. This table should not be free'd
1339 * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not
1341 * data - a pointer to data for use by proc_handler
1342 * maxlen - the maximum size in bytes of the data
1343 * mode - the file permissions for the /proc/sys file
1344 * type - Defines the target type (described in struct definition)
1345 * proc_handler - the text handler routine (described below)
1347 * extra1, extra2 - extra pointers usable by the proc handler routines
1352 * under /proc; non-leaf nodes are not allowed.
1355 * Several default handlers are available to cover common cases -
1371 struct ctl_table_root *root = set->dir.header.root; in __register_sysctl_table()
1387 dir = &set->dir; in __register_sysctl_table()
1389 dir->header.nreg++; in __register_sysctl_table()
1399 drop_sysctl_table(&dir->header); in __register_sysctl_table()
1405 drop_sysctl_table(&dir->header); in __register_sysctl_table()
1413 * register_sysctl_sz - register a sysctl table
1426 * array. A completely 0 filled entry terminates the table.
1439 * __register_sysctl_init() - register sysctl table to path
1440 * @path: path name for sysctl base. If that path doesn't exist we will create
1445 * @table_name: The name of sysctl table, only used for log printing when
1451 * values pre-set. Code which depends on these variables will always work even
1474 struct ctl_table_root *root = header->root; in put_links()
1475 struct ctl_dir *parent = header->parent; in put_links()
1477 const struct ctl_table *entry; in put_links() local
1479 if (header->set == root_set) in put_links()
1486 list_for_each_table_entry(entry, header) { in put_links()
1489 const char *name = entry->procname; in put_links() local
1491 link = find_entry(&link_head, core_parent, name, strlen(name)); in put_links()
1493 ((S_ISDIR(link->mode) && S_ISDIR(entry->mode)) || in put_links()
1494 (S_ISLNK(link->mode) && (link->data == root)))) { in put_links()
1500 pr_cont("%s\n", name); in put_links()
1507 struct ctl_dir *parent = header->parent; in drop_sysctl_table()
1509 if (--header->nreg) in drop_sysctl_table()
1517 if (!--header->count) in drop_sysctl_table()
1521 drop_sysctl_table(&parent->header); in drop_sysctl_table()
1525 * unregister_sysctl_table - unregister a sysctl table hierarchy
1549 set->is_seen = is_seen; in setup_sysctl_set()
1550 init_header(&set->dir.header, root, set, NULL, root_table, 1); in setup_sysctl_set()
1555 WARN_ON(!RB_EMPTY_ROOT(&set->dir.root)); in retire_sysctl_set()
1563 proc_sys_root->proc_iops = &proc_sys_dir_operations; in proc_sys_init()
1564 proc_sys_root->proc_dir_ops = &proc_sys_dir_file_operations; in proc_sys_init()
1565 proc_sys_root->nlink = 0; in proc_sys_init()
1578 * place and only keep the historical name for compatibility. This is not meant
1596 for (alias = &sysctl_aliases[0]; alias->kernel_param != NULL; alias++) { in sysctl_find_alias()
1597 if (strcmp(alias->kernel_param, param) == 0) in sysctl_find_alias()
1598 return alias->sysctl_param; in sysctl_find_alias()
1624 if (strncmp(param, "sysctl", sizeof("sysctl") - 1) == 0) { in process_sysctl_arg()
1625 param += sizeof("sysctl") - 1; in process_sysctl_arg()
1638 return -EINVAL; in process_sysctl_arg()
1641 return -EINVAL; in process_sysctl_arg()
1673 if (err == -ENOENT) in process_sysctl_arg()
1676 else if (err == -EACCES) in process_sysctl_arg()
1677 pr_err("Failed to set sysctl parameter '%s=%s': permission denied (read-only?)\n", in process_sysctl_arg()
1687 if (err == -EINVAL) in process_sysctl_arg()
1717 NULL, 0, -1, -1, &proc_mnt, process_sysctl_arg); in do_sysctl_args()