/* proc_lustre.c manages /proc/lustre/obd.
*
+ * Copyright (c) 2001 Rumi Zahir <rumi.zahir@intel.com>
+ *
+ * This code is issued under the GNU General Public License.
+ * See the file COPYING in this distribution
+ *
* OBD devices materialize in /proc as a directory:
* /proc/lustre/obd/<number>
* when /dev/obd<number> is opened. When the device is closed, the
* proc_lustre_remove_obd_entry() removes a
* /proc/lustre/obd/<obdid>/ entry by name. This is the only
* function that is exported to other modules.
- *
- * Copyright (c) 2001 Rumi Zahir <rumi.zahir@intel.com>
*/
+#define EXPORT_SYMTAB
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/proc_fs.h>
+#define DEBUG_SUBSYSTEM S_CLASS
+
#include <linux/obd_support.h>
#include <linux/obd_class.h>
-
#ifdef CONFIG_PROC_FS
extern struct proc_dir_entry proc_root;
&proc_root);
#endif
if (!child_dir_entry)
- printk ("lustre: failed to create /proc entry %s\n", dname);
+ CERROR("lustre: failed to create /proc entry %s\n", dname);
return child_dir_entry;
}
if (obddev->obd_refcnt==0) {
/* obd is unused */
- p += sprintf(&page[p], "open but unused\n\0");
+ p += sprintf(&page[p], "open but unused\n");
}
else { /* obd in use */
p += sprintf(&page[p], "refcnt(%d)", obddev->obd_refcnt);
}
}
- p += sprintf(&page[p], "\n\0");
+ p += sprintf(&page[p], "\n");
}
/* Compute eof and return value */
obd_entry = obd_dir;
obd_dir = obd_dir->parent;
-
- /* If /proc/lustre/obd/XXX or /proc/lustre/obd or
- * /proc/lustre are being removed, then reset
+
+ /* If /proc/lustre/obd/foo or /proc/lustre/obd or
+ * /proc/lustre is being removed, then reset
* internal variables
*/
-
- if (obd_entry == obd->obd_proc_entry)
- obd->obd_proc_entry=0; /* /proc/lustre/obd/XXX */
+
+ if (obd_entry == obd->obd_proc_entry)
+ obd->obd_proc_entry=0; /* /proc/lustre/obd/foo */
else
if (obd_entry == proc_lustre_obd_dir_entry)
proc_lustre_obd_dir_entry=0;