1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
5 * Lustre filesystem abstraction routines
7 * Copyright (C) 2002, 2003 Cluster File Systems, Inc.
9 * This file is part of Lustre, http://www.lustre.org.
11 * Lustre is free software; you can redistribute it and/or
12 * modify it under the terms of version 2 of the GNU General Public
13 * License as published by the Free Software Foundation.
15 * Lustre is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with Lustre; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #define DEBUG_SUBSYSTEM S_SM
27 #include <linux/module.h>
28 #include <linux/kmod.h>
29 #include <linux/init.h>
31 #include <linux/slab.h>
32 #include <linux/string.h>
33 #include <linux/sysctl.h>
34 #include <linux/proc_fs.h>
35 #include <linux/obd_class.h>
36 #include <linux/obd_support.h>
37 #include <linux/lustre_lib.h>
38 #include <linux/lustre_idl.h>
39 #include <linux/lustre_fsfilt.h>
40 #include <linux/lustre_smfs.h>
42 #include "smfs_internal.h"
46 static struct proc_dir_entry *proc_smfs_root;
51 static struct ctl_table_header *smfs_table_header = NULL;
52 /* 0x100 to avoid any chance of collisions at any point in the tree with
55 #define PSDEV_SMFS (0x130)
57 #define PSDEV_DEBUG 1 /* control debugging */
58 #define PSDEV_TRACE 2 /* control enter/leave pattern */
60 /* These are global control options */
63 int sm_print_entry = 1;
64 int sm_debug_level = 0;
66 /* XXX - doesn't seem to be working in 2.2.15 */
67 static struct ctl_table smfs_ctltable[] =
69 {PSDEV_DEBUG, "debug", &sm_debug_level, sizeof(int), 0644, NULL,
71 {PSDEV_TRACE, "trace", &sm_print_entry, sizeof(int), 0644, NULL,
76 static ctl_table smfs_table[2] = {
77 {PSDEV_SMFS, "smfs", NULL, 0, 0555, smfs_ctltable},
82 int __init init_smfs_proc_sys(void)
85 proc_smfs_root = proc_mkdir("smfs", proc_root_fs);
86 if (!proc_smfs_root) {
87 printk(KERN_ERR "SMFS: error registering /proc/fs/smfs\n");
90 proc_smfs_root->owner = THIS_MODULE;
94 if ( !smfs_table_header )
96 register_sysctl_table(smfs_table, 0);
101 void cleanup_smfs_proc_sys(void)
104 if ( smfs_table_header )
105 unregister_sysctl_table(smfs_table_header);
106 smfs_table_header = NULL;
109 remove_proc_entry("smfs", proc_root_fs);