sysctl.c (ae836810263509ff7a3c2c021754ce6f66b3fab6) | sysctl.c (0b4d414714f0d2f922d39424b0c5c82ad900a381) |
---|---|
1/* 2 * sysctl.c: General linux system control interface 3 * 4 * Begun 24 March 1995, Stephen Tweedie 5 * Added /proc support, Dec 1995 6 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas. 7 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver. 8 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver. --- 1230 unchanged lines hidden (view full) --- 1239 } 1240 return 0; 1241} 1242#endif /* CONFIG_SYSCTL_SYSCALL */ 1243 1244/** 1245 * register_sysctl_table - register a sysctl hierarchy 1246 * @table: the top-level table structure | 1/* 2 * sysctl.c: General linux system control interface 3 * 4 * Begun 24 March 1995, Stephen Tweedie 5 * Added /proc support, Dec 1995 6 * Added bdflush entry and intvec min/max checking, 2/23/96, Tom Dyas. 7 * Added hooks for /proc/sys/net (minor, minor patch), 96/4/1, Mike Shaver. 8 * Added kernel/java-{interpreter,appletviewer}, 96/5/10, Mike Shaver. --- 1230 unchanged lines hidden (view full) --- 1239 } 1240 return 0; 1241} 1242#endif /* CONFIG_SYSCTL_SYSCALL */ 1243 1244/** 1245 * register_sysctl_table - register a sysctl hierarchy 1246 * @table: the top-level table structure |
1247 * @insert_at_head: whether the entry should be inserted in front or at the end | |
1248 * 1249 * Register a sysctl table hierarchy. @table should be a filled in ctl_table 1250 * array. An entry with a ctl_name of 0 terminates the table. 1251 * 1252 * The members of the &ctl_table structure are used as follows: 1253 * 1254 * ctl_name - This is the numeric sysctl value used by sysctl(2). The number 1255 * must be unique within that level of sysctl --- 49 unchanged lines hidden (view full) --- 1305 * proc_doulongvec_ms_jiffies_minmax(), proc_doulongvec_minmax() 1306 * 1307 * It is the handler's job to read the input buffer from user memory 1308 * and process it. The handler should return 0 on success. 1309 * 1310 * This routine returns %NULL on a failure to register, and a pointer 1311 * to the table header on success. 1312 */ | 1247 * 1248 * Register a sysctl table hierarchy. @table should be a filled in ctl_table 1249 * array. An entry with a ctl_name of 0 terminates the table. 1250 * 1251 * The members of the &ctl_table structure are used as follows: 1252 * 1253 * ctl_name - This is the numeric sysctl value used by sysctl(2). The number 1254 * must be unique within that level of sysctl --- 49 unchanged lines hidden (view full) --- 1304 * proc_doulongvec_ms_jiffies_minmax(), proc_doulongvec_minmax() 1305 * 1306 * It is the handler's job to read the input buffer from user memory 1307 * and process it. The handler should return 0 on success. 1308 * 1309 * This routine returns %NULL on a failure to register, and a pointer 1310 * to the table header on success. 1311 */ |
1313struct ctl_table_header *register_sysctl_table(ctl_table * table, 1314 int insert_at_head) | 1312struct ctl_table_header *register_sysctl_table(ctl_table * table) |
1315{ 1316 struct ctl_table_header *tmp; 1317 tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); 1318 if (!tmp) 1319 return NULL; 1320 tmp->ctl_table = table; 1321 INIT_LIST_HEAD(&tmp->ctl_entry); 1322 tmp->used = 0; 1323 tmp->unregistering = NULL; 1324 spin_lock(&sysctl_lock); | 1313{ 1314 struct ctl_table_header *tmp; 1315 tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); 1316 if (!tmp) 1317 return NULL; 1318 tmp->ctl_table = table; 1319 INIT_LIST_HEAD(&tmp->ctl_entry); 1320 tmp->used = 0; 1321 tmp->unregistering = NULL; 1322 spin_lock(&sysctl_lock); |
1325 if (insert_at_head) 1326 list_add(&tmp->ctl_entry, &root_table_header.ctl_entry); 1327 else 1328 list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); | 1323 list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); |
1329 spin_unlock(&sysctl_lock); 1330#ifdef CONFIG_PROC_SYSCTL 1331 register_proc_table(table, proc_sys_root, tmp); 1332#endif 1333 return tmp; 1334} 1335 1336/** --- 1179 unchanged lines hidden --- | 1324 spin_unlock(&sysctl_lock); 1325#ifdef CONFIG_PROC_SYSCTL 1326 register_proc_table(table, proc_sys_root, tmp); 1327#endif 1328 return tmp; 1329} 1330 1331/** --- 1179 unchanged lines hidden --- |