本文整理汇总了C++中register_sysctl_table函数的典型用法代码示例。如果您正苦于以下问题:C++ register_sysctl_table函数的具体用法?C++ register_sysctl_table怎么用?C++ register_sysctl_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了register_sysctl_table函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: parport_device_proc_register
int parport_device_proc_register(struct pardevice *device)
{
struct parport_device_sysctl_table *t;
struct parport * port = device->port;
t = kmalloc(sizeof(*t), GFP_KERNEL);
if (t == NULL)
return -ENOMEM;
memcpy(t, &parport_device_sysctl_template, sizeof(*t));
t->dev_dir[0].child = t->parport_dir;
t->parport_dir[0].child = t->port_dir;
t->port_dir[0].procname = port->name;
t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */
t->port_dir[0].child = t->devices_root_dir;
t->devices_root_dir[0].child = t->device_dir;
#ifdef CONFIG_PARPORT_1284
t->device_dir[0].ctl_name =
parport_device_num(port->number, port->muxport,
device->daisy)
+ 1; /* nb 0 isn't legal here */
#else /* No IEEE 1284 support */
/* parport_device_num isn't available. */
t->device_dir[0].ctl_name = 1;
#endif /* IEEE 1284 support or not */
t->device_dir[0].procname = device->name;
t->device_dir[0].extra1 = device;
t->device_dir[0].child = t->vars;
t->vars[0].data = &device->timeslice;
t->sysctl_header = register_sysctl_table(t->dev_dir, 0);
if (t->sysctl_header == NULL) {
kfree(t);
t = NULL;
}
device->sysctl_table = t;
return 0;
}
开发者ID:wxlong,项目名称:Test,代码行数:44,代码来源:procfs.c
示例2: coda_sysctl_init
void coda_sysctl_init()
{
reset_coda_vfs_stats();
reset_coda_cache_inv_stats();
#ifdef CONFIG_PROC_FS
proc_fs_coda = proc_mkdir("coda", proc_root_fs);
if (proc_fs_coda) {
proc_fs_coda->owner = THIS_MODULE;
coda_proc_create("vfs_stats", coda_vfs_stats_get_info);
coda_proc_create("cache_inv_stats", coda_cache_inv_stats_get_info);
}
#endif
#ifdef CONFIG_SYSCTL
if ( !fs_table_header )
fs_table_header = register_sysctl_table(fs_table, 0);
#endif
}
开发者ID:xricson,项目名称:knoppix,代码行数:19,代码来源:sysctl.c
示例3: cmm_init
static int
cmm_init (void)
{
int rc = -ENOMEM;
#ifdef CONFIG_CMM_PROC
cmm_sysctl_header = register_sysctl_table(cmm_dir_table);
if (!cmm_sysctl_header)
goto out;
#endif
#ifdef CONFIG_CMM_IUCV
rc = smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
if (rc < 0)
goto out_smsg;
#endif
rc = register_oom_notifier(&cmm_oom_nb);
if (rc < 0)
goto out_oom_notify;
init_waitqueue_head(&cmm_thread_wait);
init_timer(&cmm_timer);
cmm_thread_ptr = kthread_run(cmm_thread, NULL, "cmmthread");
rc = IS_ERR(cmm_thread_ptr) ? PTR_ERR(cmm_thread_ptr) : 0;
if (!rc)
goto out;
/*
* kthread_create failed. undo all the stuff from above again.
*/
unregister_oom_notifier(&cmm_oom_nb);
out_oom_notify:
#ifdef CONFIG_CMM_IUCV
smsg_unregister_callback(SMSG_PREFIX, cmm_smsg_target);
out_smsg:
#endif
#ifdef CONFIG_CMM_PROC
unregister_sysctl_table(cmm_sysctl_header);
#endif
out:
return rc;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:40,代码来源:cmm.c
示例4: init_nlm
static int __init init_nlm(void)
{
int err;
#ifdef CONFIG_SYSCTL
err = -ENOMEM;
nlm_sysctl_table = register_sysctl_table(nlm_sysctl_root);
if (nlm_sysctl_table == NULL)
goto err_sysctl;
#endif
err = register_pernet_subsys(&lockd_net_ops);
if (err)
goto err_pernet;
return 0;
err_pernet:
#ifdef CONFIG_SYSCTL
unregister_sysctl_table(nlm_sysctl_table);
#endif
err_sysctl:
return err;
}
开发者ID:sagark,项目名称:linux-pf-profile,代码行数:22,代码来源:svc.c
示例5: cmm_init
static int
cmm_init (void)
{
int rc;
/* Prevent logical cpu 0 from being set offline. */
rc = smp_get_cpu(cpumask_of_cpu(0));
if (rc) {
printk(KERN_ERR "CMM: unable to reserve cpu 0\n");
return rc;
}
#ifdef CONFIG_CMM_PROC
cmm_sysctl_header = register_sysctl_table(cmm_dir_table, 1);
#endif
#ifdef CONFIG_CMM_IUCV
smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
#endif
INIT_WORK(&cmm_thread_starter, (void *) cmm_start_thread, 0);
init_waitqueue_head(&cmm_thread_wait);
init_timer(&cmm_timer);
return 0;
}
开发者ID:12019,项目名称:hg556a_source,代码行数:22,代码来源:cmm.c
示例6: h3600_stowaway_init_module
int __init h3600_stowaway_init_module( void )
{
/* register our character device */
SFDEBUG(0,"registering char device\n");
g_stowaway_major = devfs_register_chrdev(0, H3600_STOWAWAY_MODULE_NAME, &stowaway_fops);
if (g_stowaway_major < 0) {
printk(KERN_ALERT __FUNCTION__ ": can't get major number\n");
return g_stowaway_major;
}
devfs_stowaway = devfs_register( NULL, H3600_STOWAWAY_DEVICE_NAME,
DEVFS_FL_DEFAULT, g_stowaway_major,
0, S_IFCHR | S_IRUSR | S_IWUSR, &stowaway_fops, NULL );
/* Register in /proc filesystem */
create_proc_read_entry(H3600_STOWAWAY_PROC_STATS, 0, proc_dir,
h3600_stowaway_proc_stats_read, NULL );
h3600_stowaway_sysctl_header = register_sysctl_table(h3600_stowaway_dir_table, 0);
return 0;
}
开发者ID:zipangotes,项目名称:DSL-G624T_GPL_code,代码行数:23,代码来源:h3600_stowaway.c
示例7: parport_proc_register
int parport_proc_register(struct parport *port)
{
struct parport_sysctl_table *t;
int i;
t = kmalloc(sizeof(*t), GFP_KERNEL);
if (t == NULL)
return -ENOMEM;
memcpy(t, &parport_sysctl_template, sizeof(*t));
t->device_dir[0].extra1 = port;
for (i = 0; i < 8; i++)
t->vars[i].extra1 = port;
t->vars[0].data = &port->spintime;
t->vars[5].child = t->device_dir;
for (i = 0; i < 5; i++)
t->vars[6 + i].extra2 = &port->probe_info[i];
t->port_dir[0].procname = port->name;
t->port_dir[0].ctl_name = port->number + 1; /* nb 0 isn't legal here */
t->port_dir[0].child = t->vars;
t->parport_dir[0].child = t->port_dir;
t->dev_dir[0].child = t->parport_dir;
t->sysctl_header = register_sysctl_table(t->dev_dir, 0);
if (t->sysctl_header == NULL) {
kfree(t);
t = NULL;
}
port->sysctl_table = t;
return 0;
}
开发者ID:dmgerman,项目名称:original,代码行数:36,代码来源:procfs.c
示例8: xprt_rdma_init
int xprt_rdma_init(void)
{
int rc;
rc = rpcrdma_alloc_wq();
if (rc)
return rc;
rc = xprt_register_transport(&xprt_rdma);
if (rc) {
rpcrdma_destroy_wq();
return rc;
}
rc = xprt_register_transport(&xprt_rdma_bc);
if (rc) {
xprt_unregister_transport(&xprt_rdma);
rpcrdma_destroy_wq();
return rc;
}
dprintk("RPCRDMA Module Init, register RPC RDMA transport\n");
dprintk("Defaults:\n");
dprintk("\tSlots %d\n"
"\tMaxInlineRead %d\n\tMaxInlineWrite %d\n",
xprt_rdma_slot_table_entries,
xprt_rdma_max_inline_read, xprt_rdma_max_inline_write);
dprintk("\tPadding 0\n\tMemreg %d\n", xprt_rdma_memreg_strategy);
#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
if (!sunrpc_table_header)
sunrpc_table_header = register_sysctl_table(sunrpc_table);
#endif
return 0;
}
开发者ID:markus-oberhumer,项目名称:linux,代码行数:36,代码来源:transport.c
示例9: ethinit_module
int ethinit_module(void)
{
int res;
printk(KERN_INFO "init module called \n");
init_module2_2();
spin_lock_init(ð_lock);
schar_name = "schar2";
/* register device with kernel */
res = register_chrdev(SCHAR_MAJOR_2, schar_name, &schar_fops);
if (res) {
printk(KERN_INFO "can't register device with kernel\n");
return res;
}
/* register proc entry */
schar_root_header_2 = register_sysctl_table(schar_root_dir_2, 0);
return 0;
}
开发者ID:andrewpeck,项目名称:emu,代码行数:24,代码来源:eth_hook_2.c
示例10: init_intermezzo_sysctl
/* allocate the tables for the presto devices. We need
* sizeof(proto_channel_table)/sizeof(proto_channel_table[0])
* entries for each dev
*/
int /* __init */ init_intermezzo_sysctl(void)
{
int i;
int total_dev = MAX_CHANNEL;
int entries_per_dev = sizeof(proto_psdev_table) /
sizeof(proto_psdev_table[0]);
int total_entries = entries_per_dev * total_dev;
ctl_table *dev_ctl_table;
PRESTO_ALLOC(dev_ctl_table, sizeof(ctl_table) * total_entries);
if (! dev_ctl_table) {
CERROR("WARNING: presto couldn't allocate dev_ctl_table\n");
EXIT;
return -ENOMEM;
}
/* now fill in the entries ... we put the individual presto<x>
* entries at the end of the table, and the per-presto stuff
* starting at the front. We assume that the compiler makes
* this code more efficient, but really, who cares ... it
* happens once per reboot.
*/
for(i = 0; i < total_dev; i++) {
void *p;
/* entry for this /proc/sys/intermezzo/intermezzo"i" */
ctl_table *psdev = &presto_table[i + PRESTO_PRIMARY_CTLCNT];
/* entries for the individual "files" in this "directory" */
ctl_table *psdev_entries = &dev_ctl_table[i * entries_per_dev];
/* init the psdev and psdev_entries with the prototypes */
*psdev = proto_channel_entry;
memcpy(psdev_entries, proto_psdev_table,
sizeof(proto_psdev_table));
/* now specialize them ... */
/* the psdev has to point to psdev_entries, and fix the number */
psdev->ctl_name = psdev->ctl_name + i + 1; /* sorry */
PRESTO_ALLOC(p, PROCNAME_SIZE);
psdev->procname = p;
if (!psdev->procname) {
PRESTO_FREE(dev_ctl_table,
sizeof(ctl_table) * total_entries);
return -ENOMEM;
}
sprintf((char *) psdev->procname, "intermezzo%d", i);
/* hook presto into */
psdev->child = psdev_entries;
/* now for each psdev entry ... */
psdev_entries[0].data = &(izo_channels[i].uc_hard);
psdev_entries[1].data = &(izo_channels[i].uc_no_filter);
psdev_entries[2].data = &(izo_channels[i].uc_no_journal);
psdev_entries[3].data = &(izo_channels[i].uc_no_upcall);
psdev_entries[4].data = &(izo_channels[i].uc_timeout);
#ifdef PRESTO_DEBUG
psdev_entries[5].data = &(izo_channels[i].uc_errorval);
#endif
}
#ifdef CONFIG_SYSCTL
if ( !intermezzo_table_header )
intermezzo_table_header =
register_sysctl_table(intermezzo_table, 0);
#endif
#ifdef CONFIG_PROC_FS
proc_fs_intermezzo = proc_mkdir("intermezzo", proc_root_fs);
proc_fs_intermezzo->owner = THIS_MODULE;
create_proc_info_entry("mounts", 0, proc_fs_intermezzo,
intermezzo_mount_get_info);
#endif
return 0;
}
开发者ID:JBTech,项目名称:ralink_rt5350,代码行数:78,代码来源:sysctl.c
示例11: ipc_sysctl_init
static int __init ipc_sysctl_init(void)
{
register_sysctl_table(ipc_root_table);
return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:5,代码来源:ipc_sysctl.c
示例12: ipx_register_sysctl
void ipx_register_sysctl(void)
{
ipx_table_header = register_sysctl_table(ipx_root_table);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:4,代码来源:sysctl_net_ipx.c
示例13: abi_register_sysctl
static int __init
abi_register_sysctl(void)
{
register_sysctl_table(abi_root_table, 1);
return 0;
}
开发者ID:OS2World,项目名称:DRV-LXAPI32,代码行数:6,代码来源:lk_exec_domain.c
示例14: coda_sysctl_init
void coda_sysctl_init(void)
{
if ( !fs_table_header )
fs_table_header = register_sysctl_table(fs_table);
}
开发者ID:rrowicki,项目名称:Chrono_Kernel-1,代码行数:5,代码来源:sysctl.c
示例15: init_sysctl
static int __init init_sysctl(void)
{
sysctl_header = register_sysctl_table(dev_root);
return 0;
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:5,代码来源:rtc.c
示例16: fscache_init
/*
* initialise the fs caching module
*/
static int __init fscache_init(void)
{
unsigned int nr_cpus = num_possible_cpus();
unsigned int cpu;
int ret;
fscache_object_max_active =
clamp_val(nr_cpus,
fscache_object_max_active, WQ_UNBOUND_MAX_ACTIVE);
ret = -ENOMEM;
fscache_object_wq = alloc_workqueue("fscache_object", WQ_UNBOUND,
fscache_object_max_active);
if (!fscache_object_wq)
goto error_object_wq;
fscache_op_max_active =
clamp_val(fscache_object_max_active / 2,
fscache_op_max_active, WQ_UNBOUND_MAX_ACTIVE);
ret = -ENOMEM;
fscache_op_wq = alloc_workqueue("fscache_operation", WQ_UNBOUND,
fscache_op_max_active);
if (!fscache_op_wq)
goto error_op_wq;
for_each_possible_cpu(cpu)
init_waitqueue_head(&per_cpu(fscache_object_cong_wait, cpu));
ret = fscache_proc_init();
if (ret < 0)
goto error_proc;
#ifdef CONFIG_SYSCTL
ret = -ENOMEM;
fscache_sysctl_header = register_sysctl_table(fscache_sysctls_root);
if (!fscache_sysctl_header)
goto error_sysctl;
#endif
fscache_cookie_jar = kmem_cache_create("fscache_cookie_jar",
sizeof(struct fscache_cookie),
0,
0,
fscache_cookie_init_once);
if (!fscache_cookie_jar) {
printk(KERN_NOTICE
"FS-Cache: Failed to allocate a cookie jar\n");
ret = -ENOMEM;
goto error_cookie_jar;
}
fscache_root = kobject_create_and_add("fscache", kernel_kobj);
if (!fscache_root)
goto error_kobj;
printk(KERN_NOTICE "FS-Cache: Loaded\n");
return 0;
error_kobj:
kmem_cache_destroy(fscache_cookie_jar);
error_cookie_jar:
#ifdef CONFIG_SYSCTL
unregister_sysctl_table(fscache_sysctl_header);
error_sysctl:
#endif
fscache_proc_cleanup();
error_proc:
destroy_workqueue(fscache_op_wq);
error_op_wq:
destroy_workqueue(fscache_object_wq);
error_object_wq:
return ret;
}
开发者ID:7799,项目名称:linux,代码行数:77,代码来源:main.c
示例17: pm_init
/*
* Initialize power interface
*/
static int __init pm_init(void)
{
register_sysctl_table(pm_dir_table);
return 0;
}
开发者ID:01org,项目名称:thunderbolt-software-kernel-tree,代码行数:8,代码来源:pm.c
示例18: rpc_register_sysctl
void
rpc_register_sysctl(void)
{
if (!sunrpc_table_header)
sunrpc_table_header = register_sysctl_table(sunrpc_table);
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:6,代码来源:sysctl.c
示例19: xpc_init
int __init
xpc_init(void)
{
int ret;
struct task_struct *kthread;
dev_set_name(xpc_part, "part");
dev_set_name(xpc_chan, "chan");
if (is_shub()) {
/*
*/
if (xp_max_npartitions != 64) {
dev_err(xpc_part, "max #of partitions not set to 64\n");
ret = -EINVAL;
} else {
ret = xpc_init_sn2();
}
} else if (is_uv()) {
ret = xpc_init_uv();
} else {
ret = -ENODEV;
}
if (ret != 0)
return ret;
ret = xpc_setup_partitions();
if (ret != 0) {
dev_err(xpc_part, "can't get memory for partition structure\n");
goto out_1;
}
xpc_sysctl = register_sysctl_table(xpc_sys_dir);
/*
*/
ret = xpc_setup_rsvd_page();
if (ret != 0) {
dev_err(xpc_part, "can't setup our reserved page\n");
goto out_2;
}
/* */
ret = register_reboot_notifier(&xpc_reboot_notifier);
if (ret != 0)
dev_warn(xpc_part, "can't register reboot notifier\n");
/* */
ret = register_die_notifier(&xpc_die_notifier);
if (ret != 0)
dev_warn(xpc_part, "can't register die notifier\n");
/*
*/
kthread = kthread_run(xpc_hb_checker, NULL, XPC_HB_CHECK_THREAD_NAME);
if (IS_ERR(kthread)) {
dev_err(xpc_part, "failed while forking hb check thread\n");
ret = -EBUSY;
goto out_3;
}
/*
*/
kthread = kthread_run(xpc_initiate_discovery, NULL,
XPC_DISCOVERY_THREAD_NAME);
if (IS_ERR(kthread)) {
dev_err(xpc_part, "failed while forking discovery thread\n");
/* */
complete(&xpc_discovery_exited);
xpc_do_exit(xpUnloading);
return -EBUSY;
}
/* */
xpc_set_interface(xpc_initiate_connect, xpc_initiate_disconnect,
xpc_initiate_send, xpc_initiate_send_notify,
xpc_initiate_received, xpc_initiate_partid_to_nasids);
return 0;
/* */
out_3:
xpc_teardown_rsvd_page();
//.........这里部分代码省略.........
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:101,代码来源:xpc_main.c
示例20: register_sysctl_table
struct ctl_table_header *mq_register_sysctl_table(void)
{
return register_sysctl_table(mq_sysctl_root);
}
开发者ID:chunyenho,项目名称:RTS-hw2,代码行数:4,代码来源:mq_sysctl.c
注:本文中的register_sysctl_table函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论