-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
struct sysctl_oid_list *ss_link;
} libcfs_sysctl_sprite = { 0, NULL };
-static cfs_sysctl_table_header_t *libcfs_table_header = NULL;
+static struct ctl_table_header *libcfs_table_header = NULL;
extern unsigned int libcfs_debug;
extern unsigned int libcfs_subsystem_debug;
extern unsigned int libcfs_printk;
return error;
}
+static int proc_fail_loc SYSCTL_HANDLER_ARGS
+{
+ int error = 0;
+ long old_fail_loc = cfs_fail_loc;
+
+ error = sysctl_handle_long(oidp, oidp->oid_arg1, oidp->oid_arg2, req);
+ if (!error && req->newptr != USER_ADDR_NULL) {
+ if (old_fail_loc != cfs_fail_loc)
+ wake_up(&cfs_race_waitq);
+ } else if (req->newptr != USER_ADDR_NULL) {
+ /* Something was wrong with the write request */
+ printf ("sysctl fail loc fault: %d.\n", error);
+ } else {
+ /* Read request */
+ error = SYSCTL_OUT(req, &cfs_fail_loc, sizeof cfs_fail_loc);
+ }
+ return error;
+}
+
/*
* sysctl table for lnet
*/
SYSCTL_PROC(_lnet, OID_AUTO, debug_mb,
CTLTYPE_INT | CTLFLAG_RW, 0,
0, &sysctl_debug_mb, "L", "debug_mb");
+SYSCTL_PROC(_lnet, OID_AUTO, fail_loc,
+ CTLTYPE_INT | CTLFLAG_RW , &cfs_fail_loc,
+ 0, &proc_fail_loc, "I", "cfs_fail_loc");
-
-static cfs_sysctl_table_t top_table[] = {
+static struct ctl_table top_table[] = {
&sysctl__lnet,
&sysctl__lnet_debug,
&sysctl__lnet_subsystem_debug,
&sysctl__lnet_debug_kernel,
&sysctl__lnet_daemon_file,
&sysctl__lnet_debug_mb,
+ &sysctl__lnet_cfs_fail_loc
NULL
};
/*
* Register sysctl table
*/
-cfs_sysctl_table_header_t *
-cfs_register_sysctl_table (cfs_sysctl_table_t *table, int arg)
+struct ctl_table_header *
+register_sysctl_table(struct ctl_table *table, int arg)
{
- cfs_sysctl_table_t item;
- int i = 0;
+ struct ctl_table item;
+ int i = 0;
- while ((item = table[i++]) != NULL)
- sysctl_register_oid(item);
- return table;
+ while ((item = table[i++]) != NULL)
+ sysctl_register_oid(item);
+ return table;
}
/*
* Unregister sysctl table
*/
-void
-cfs_unregister_sysctl_table (cfs_sysctl_table_header_t *table) {
- int i = 0;
- cfs_sysctl_table_t item;
+void unregister_sysctl_table(struct ctl_table_header *table)
+{
+ int i = 0;
+ struct ctl_table item;
- while ((item = table[i++]) != NULL)
- sysctl_unregister_oid(item);
- return;
+ while ((item = table[i++]) != NULL)
+ sysctl_unregister_oid(item);
+ return;
}
/*
insert_proc(void)
{
#if 1
- if (!libcfs_table_header)
- libcfs_table_header = cfs_register_sysctl_table(top_table, 0);
+ if (!libcfs_table_header)
+ libcfs_table_header = register_sysctl_table(top_table);
#endif
return 0;
}
remove_proc(void)
{
#if 1
- if (libcfs_table_header != NULL)
- cfs_unregister_sysctl_table(libcfs_table_header);
- libcfs_table_header = NULL;
+ if (libcfs_table_header != NULL)
+ unregister_sysctl_table(libcfs_table_header);
+ libcfs_table_header = NULL;
#endif
return;
}