From f71aa21695d058f37490cd6d0d7b50298214771c Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 10 May 2002 23:44:07 +0000 Subject: [PATCH] Initial revision --- src/afs/LINUX/osi_sysctl.c | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/afs/LINUX/osi_sysctl.c diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c new file mode 100644 index 000000000..f8c338346 --- /dev/null +++ b/src/afs/LINUX/osi_sysctl.c @@ -0,0 +1,62 @@ +/* + * osi_sysctl.c: Linux sysctl interface to OpenAFS + * + * $Id: osi_sysctl.c,v 1.1 2002/05/10 23:44:08 hartmans Exp $ + * + * Written Jan 30, 2002 by Kris Van Hees (Sine Nomine Associates) + */ + +#include +#include "../afs/param.h" + +#include "../afs/sysincludes.h" /* Standard vendor system headers */ +#include "../afs/afsincludes.h" /* Afs-based standard headers */ +#include "../afs/afs_stats.h" /* afs statistics */ + +#include +#include + +/* From afs_analyze.c */ +extern afs_int32 hm_retry_RO; +extern afs_int32 hm_retry_RW; +extern afs_int32 hm_retry_int; + +#ifdef CONFIG_SYSCTL +static struct ctl_table_header *afs_sysctl = NULL; + +static ctl_table afs_sysctl_table[] = { + {1, "hm_retry_RO", + &hm_retry_RO, sizeof(afs_int32), 0644, NULL, + &proc_dointvec}, + {2, "hm_retry_RW", + &hm_retry_RW, sizeof(afs_int32), 0644, NULL, + &proc_dointvec}, + {3, "hm_retry_int", + &hm_retry_int, sizeof(afs_int32), 0644, NULL, + &proc_dointvec}, + {0} +}; + +static ctl_table fs_sysctl_table[] = { + {1, "afs", NULL, 0, 0555, afs_sysctl_table}, + {0} +}; + +int osi_sysctl_init() +{ + afs_sysctl = register_sysctl_table(fs_sysctl_table, 0); + if (!afs_sysctl) + return -1; + + return 0; +} + +void osi_sysctl_clean() +{ + if (afs_sysctl) { + unregister_sysctl_table(afs_sysctl); + afs_sysctl = NULL; + } +} + +#endif /* CONFIG_SYSCTL */ -- 2.39.5