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/jbd.h>
18 #include <linux/ext3_fs.h>
19 #include <linux/snap.h>
21 #include "snapfs_internal.h"
25 static struct proc_dir_entry *proc_snapfs_root;
31 static struct ctl_table_header *snapfs_table_header = NULL;
32 /* 0x100 to avoid any chance of collisions at any point in the tree with
35 #define PSDEV_SNAPFS (0x120)
37 #define PSDEV_DEBUG 1 /* control debugging */
38 #define PSDEV_TRACE 2 /* control enter/leave pattern */
40 /* These are global control options */
43 int snap_print_entry = 1;
44 int snap_debug_level = 0;
46 /* XXX - doesn't seem to be working in 2.2.15 */
47 static struct ctl_table snapfs_ctltable[] =
49 {PSDEV_DEBUG, "debug", &snap_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
50 {PSDEV_TRACE, "trace", &snap_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
54 static ctl_table snapfs_table[2] = {
55 {PSDEV_SNAPFS, "snapfs", NULL, 0, 0555, snapfs_ctltable},
60 int __init init_snapfs_proc_sys(void)
63 proc_snapfs_root = proc_mkdir("snapfs", proc_root_fs);
64 if (!proc_snapfs_root) {
65 printk(KERN_ERR "SNAPFS: error registering /proc/fs/snapfs\n");
68 proc_snapfs_root->owner = THIS_MODULE;
72 if ( !snapfs_table_header )
74 register_sysctl_table(snapfs_table, 0);
79 void cleanup_snapfs_proc_sys(void)
82 if ( snapfs_table_header )
83 unregister_sysctl_table(snapfs_table_header);
84 snapfs_table_header = NULL;
87 remove_proc_entry("snapfs", proc_root_fs);