]> err.no Git - linux-2.6/blobdiff - fs/reiserfs/procfs.c
Pull esi-support into release branch
[linux-2.6] / fs / reiserfs / procfs.c
index fc2f43c75df411ee4b3037b723023b4a13f5ceef..c533ec1bcaec3461a8c7e7cee9d3451a12258d93 100644 (file)
@@ -10,7 +10,6 @@
 
 /* $Id: procfs.c,v 1.1.8.2 2001/07/15 17:08:42 god Exp $ */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/time.h>
 #include <linux/seq_file.h>
@@ -88,7 +87,6 @@ static int show_super(struct seq_file *m, struct super_block *sb)
        seq_printf(m, "state: \t%s\n"
                   "mount options: \t%s%s%s%s%s%s%s%s%s%s%s\n"
                   "gen. counter: \t%i\n"
-                  "s_kmallocs: \t%i\n"
                   "s_disk_reads: \t%i\n"
                   "s_disk_writes: \t%i\n"
                   "s_fix_nodes: \t%i\n"
@@ -128,7 +126,7 @@ static int show_super(struct seq_file *m, struct super_block *sb)
                   "SMALL_TAILS " : "NO_TAILS ",
                   replay_only(sb) ? "REPLAY_ONLY " : "",
                   convert_reiserfs(sb) ? "CONV " : "",
-                  atomic_read(&r->s_generation_counter), SF(s_kmallocs),
+                  atomic_read(&r->s_generation_counter),
                   SF(s_disk_reads), SF(s_disk_writes), SF(s_fix_nodes),
                   SF(s_do_balance), SF(s_unneeded_left_neighbor),
                   SF(s_good_search_by_key_reada), SF(s_bmaps),
@@ -471,7 +469,7 @@ static int r_open(struct inode *inode, struct file *file)
        return ret;
 }
 
-static struct file_operations r_file_operations = {
+static const struct file_operations r_file_operations = {
        .open = r_open,
        .read = seq_read,
        .llseek = seq_lseek,
@@ -494,9 +492,17 @@ static void add_file(struct super_block *sb, char *name,
 
 int reiserfs_proc_info_init(struct super_block *sb)
 {
+       char b[BDEVNAME_SIZE];
+       char *s;
+
+       /* Some block devices use /'s */
+       strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
+       s = strchr(b, '/');
+       if (s)
+               *s = '!';
+
        spin_lock_init(&__PINFO(sb).lock);
-       REISERFS_SB(sb)->procdir =
-           proc_mkdir(reiserfs_bdevname(sb), proc_info_root);
+       REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root);
        if (REISERFS_SB(sb)->procdir) {
                REISERFS_SB(sb)->procdir->owner = THIS_MODULE;
                REISERFS_SB(sb)->procdir->data = sb;
@@ -510,13 +516,22 @@ int reiserfs_proc_info_init(struct super_block *sb)
                return 0;
        }
        reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s",
-                        proc_info_root_name, reiserfs_bdevname(sb));
+                        proc_info_root_name, b);
        return 1;
 }
 
 int reiserfs_proc_info_done(struct super_block *sb)
 {
        struct proc_dir_entry *de = REISERFS_SB(sb)->procdir;
+       char b[BDEVNAME_SIZE];
+       char *s;
+
+       /* Some block devices use /'s */
+       strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE);
+       s = strchr(b, '/');
+       if (s)
+               *s = '!';
+
        if (de) {
                remove_proc_entry("journal", de);
                remove_proc_entry("oidmap", de);
@@ -530,7 +545,7 @@ int reiserfs_proc_info_done(struct super_block *sb)
        __PINFO(sb).exiting = 1;
        spin_unlock(&__PINFO(sb).lock);
        if (proc_info_root) {
-               remove_proc_entry(reiserfs_bdevname(sb), proc_info_root);
+               remove_proc_entry(b, proc_info_root);
                REISERFS_SB(sb)->procdir = NULL;
        }
        return 0;