2 * Sysctrl entries for Snapfs
6 #include <linux/config.h> /* for CONFIG_PROC_FS */
7 #include <linux/module.h>
8 #include <linux/sched.h>
10 #include <linux/sysctl.h>
11 #include <linux/swapctl.h>
12 #include <linux/proc_fs.h>
13 #include <linux/malloc.h>
14 #include <linux/vmalloc.h>
15 #include <linux/stat.h>
16 #include <linux/ctype.h>
17 #include <linux/init.h>
18 #include <asm/bitops.h>
19 #include <asm/segment.h>
20 #include <asm/uaccess.h>
21 #include <linux/utsname.h>
22 #include <linux/blk.h>
24 #include <linux/filter.h>
25 #include <linux/snapfs.h>
26 #include <linux/snapsupport.h>
34 static void snapfs_proc_modcount(struct inode *inode, int fill)
42 struct proc_dir_entry proc_fs_snapfs = {
44 S_IFDIR | S_IRUGO | S_IXUGO, 2, 0, 0,
45 0, &proc_dir_inode_operations,
57 static struct ctl_table_header *snapfs_table_header = NULL;
58 /* 0x100 to avoid any chance of collisions at any point in the tree with
61 #define PSDEV_SNAPFS (0x120)
63 #define PSDEV_DEBUG 1 /* control debugging */
64 #define PSDEV_TRACE 2 /* control enter/leave pattern */
66 /* These are global control options */
69 /* XXX - doesn't seem to be working in 2.2.15 */
70 static struct ctl_table snapfs_ctltable[ENTRY_CNT] =
72 {PSDEV_DEBUG, "debug", &snap_debug_level, sizeof(int), 0644, NULL, &proc_dointvec},
73 {PSDEV_TRACE, "trace", &snap_print_entry, sizeof(int), 0644, NULL, &proc_dointvec},
77 static ctl_table snapfs_table[2] = {
78 {PSDEV_SNAPFS, "snapfs", NULL, 0, 0555, snapfs_ctltable},
83 int /* __init */ init_snapfs_proc_sys(void)
87 if ( !snapfs_table_header )
89 register_sysctl_table(snapfs_table, 0);
92 proc_register(&proc_root_fs, &proc_fs_snapfs);
93 proc_fs_snapfs.fill_inode = &snapfs_proc_modcount;
98 void cleanup_snapfs_proc_sys(void) {
101 if ( snapfs_table_header )
102 unregister_sysctl_table(snapfs_table_header);
103 snapfs_table_header = NULL;
107 proc_unregister(&proc_root_fs, proc_fs_snapfs.low_ino);