diff options
Diffstat (limited to 'fs/reiserfs/procfs.c')
| -rw-r--r-- | fs/reiserfs/procfs.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index 731688e1cfe3..c533ec1bcaec 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | /* $Id: procfs.c,v 1.1.8.2 2001/07/15 17:08:42 god Exp $ */ | 11 | /* $Id: procfs.c,v 1.1.8.2 2001/07/15 17:08:42 god Exp $ */ |
| 12 | 12 | ||
| 13 | #include <linux/config.h> | ||
| 14 | #include <linux/module.h> | 13 | #include <linux/module.h> |
| 15 | #include <linux/time.h> | 14 | #include <linux/time.h> |
| 16 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
| @@ -493,9 +492,17 @@ static void add_file(struct super_block *sb, char *name, | |||
| 493 | 492 | ||
| 494 | int reiserfs_proc_info_init(struct super_block *sb) | 493 | int reiserfs_proc_info_init(struct super_block *sb) |
| 495 | { | 494 | { |
| 495 | char b[BDEVNAME_SIZE]; | ||
| 496 | char *s; | ||
| 497 | |||
| 498 | /* Some block devices use /'s */ | ||
| 499 | strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE); | ||
| 500 | s = strchr(b, '/'); | ||
| 501 | if (s) | ||
| 502 | *s = '!'; | ||
| 503 | |||
| 496 | spin_lock_init(&__PINFO(sb).lock); | 504 | spin_lock_init(&__PINFO(sb).lock); |
| 497 | REISERFS_SB(sb)->procdir = | 505 | REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root); |
| 498 | proc_mkdir(reiserfs_bdevname(sb), proc_info_root); | ||
| 499 | if (REISERFS_SB(sb)->procdir) { | 506 | if (REISERFS_SB(sb)->procdir) { |
| 500 | REISERFS_SB(sb)->procdir->owner = THIS_MODULE; | 507 | REISERFS_SB(sb)->procdir->owner = THIS_MODULE; |
| 501 | REISERFS_SB(sb)->procdir->data = sb; | 508 | REISERFS_SB(sb)->procdir->data = sb; |
| @@ -509,13 +516,22 @@ int reiserfs_proc_info_init(struct super_block *sb) | |||
| 509 | return 0; | 516 | return 0; |
| 510 | } | 517 | } |
| 511 | reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", | 518 | reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", |
| 512 | proc_info_root_name, reiserfs_bdevname(sb)); | 519 | proc_info_root_name, b); |
| 513 | return 1; | 520 | return 1; |
| 514 | } | 521 | } |
| 515 | 522 | ||
| 516 | int reiserfs_proc_info_done(struct super_block *sb) | 523 | int reiserfs_proc_info_done(struct super_block *sb) |
| 517 | { | 524 | { |
| 518 | struct proc_dir_entry *de = REISERFS_SB(sb)->procdir; | 525 | struct proc_dir_entry *de = REISERFS_SB(sb)->procdir; |
| 526 | char b[BDEVNAME_SIZE]; | ||
| 527 | char *s; | ||
| 528 | |||
| 529 | /* Some block devices use /'s */ | ||
| 530 | strlcpy(b, reiserfs_bdevname(sb), BDEVNAME_SIZE); | ||
| 531 | s = strchr(b, '/'); | ||
| 532 | if (s) | ||
| 533 | *s = '!'; | ||
| 534 | |||
| 519 | if (de) { | 535 | if (de) { |
| 520 | remove_proc_entry("journal", de); | 536 | remove_proc_entry("journal", de); |
| 521 | remove_proc_entry("oidmap", de); | 537 | remove_proc_entry("oidmap", de); |
| @@ -529,7 +545,7 @@ int reiserfs_proc_info_done(struct super_block *sb) | |||
| 529 | __PINFO(sb).exiting = 1; | 545 | __PINFO(sb).exiting = 1; |
| 530 | spin_unlock(&__PINFO(sb).lock); | 546 | spin_unlock(&__PINFO(sb).lock); |
| 531 | if (proc_info_root) { | 547 | if (proc_info_root) { |
| 532 | remove_proc_entry(reiserfs_bdevname(sb), proc_info_root); | 548 | remove_proc_entry(b, proc_info_root); |
| 533 | REISERFS_SB(sb)->procdir = NULL; | 549 | REISERFS_SB(sb)->procdir = NULL; |
| 534 | } | 550 | } |
| 535 | return 0; | 551 | return 0; |
