2 * Sysctrl entries for Snapfs
7 #define DEBUG_SUBSYSTEM S_SNAP
9 #include <linux/module.h>
10 #include <linux/kmod.h>
11 #include <linux/init.h>
13 #include <linux/slab.h>
14 #include <linux/string.h>
15 #include <linux/sysctl.h>
16 #include <linux/proc_fs.h>
17 #include <linux/lustre_idl.h>
18 #include "smfs_internal.h"
22 static struct proc_dir_entry *proc_smfs_root;
28 static struct ctl_table_header *smfs_table_header = NULL;
29 /* 0x100 to avoid any chance of collisions at any point in the tree with
32 #define PSDEV_SMFS (0x130)
34 #define PSDEV_DEBUG 1 /* control debugging */
35 #define PSDEV_TRACE 2 /* control enter/leave pattern */
37 /* These are global control options */
40 int sm_print_entry = 1;
41 int sm_debug_level = 0;
43 /* XXX - doesn't seem to be working in 2.2.15 */
44 static struct ctl_table smfs_ctltable[] =
46 {PSDEV_DEBUG, "debug", &sm_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
47 {PSDEV_TRACE, "trace", &sm_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
51 static ctl_table smfs_table[2] = {
52 {PSDEV_SMFS, "smfs", NULL, 0, 0555, smfs_ctltable},
57 int __init init_smfs_proc_sys(void)
60 proc_smfs_root = proc_mkdir("smfs", proc_root_fs);
61 if (!proc_smfs_root) {
62 printk(KERN_ERR "SMFS: error registering /proc/fs/smfs\n");
65 proc_smfs_root->owner = THIS_MODULE;
69 if ( !smfs_table_header )
71 register_sysctl_table(smfs_table, 0);
76 void cleanup_smfs_proc_sys(void)
79 if ( smfs_table_header )
80 unregister_sysctl_table(smfs_table_header);
81 smfs_table_header = NULL;
84 remove_proc_entry("smfs", proc_root_fs);