diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/reiserfs/procfs.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/fs/reiserfs/procfs.c b/fs/reiserfs/procfs.c index 5d8a8cfebc70..c533ec1bcaec 100644 --- a/fs/reiserfs/procfs.c +++ b/fs/reiserfs/procfs.c | |||
@@ -492,9 +492,17 @@ static void add_file(struct super_block *sb, char *name, | |||
492 | 492 | ||
493 | int reiserfs_proc_info_init(struct super_block *sb) | 493 | int reiserfs_proc_info_init(struct super_block *sb) |
494 | { | 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 | |||
495 | spin_lock_init(&__PINFO(sb).lock); | 504 | spin_lock_init(&__PINFO(sb).lock); |
496 | REISERFS_SB(sb)->procdir = | 505 | REISERFS_SB(sb)->procdir = proc_mkdir(b, proc_info_root); |
497 | proc_mkdir(reiserfs_bdevname(sb), proc_info_root); | ||
498 | if (REISERFS_SB(sb)->procdir) { | 506 | if (REISERFS_SB(sb)->procdir) { |
499 | REISERFS_SB(sb)->procdir->owner = THIS_MODULE; | 507 | REISERFS_SB(sb)->procdir->owner = THIS_MODULE; |
500 | REISERFS_SB(sb)->procdir->data = sb; | 508 | REISERFS_SB(sb)->procdir->data = sb; |
@@ -508,13 +516,22 @@ int reiserfs_proc_info_init(struct super_block *sb) | |||
508 | return 0; | 516 | return 0; |
509 | } | 517 | } |
510 | reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", | 518 | reiserfs_warning(sb, "reiserfs: cannot create /proc/%s/%s", |
511 | proc_info_root_name, reiserfs_bdevname(sb)); | 519 | proc_info_root_name, b); |
512 | return 1; | 520 | return 1; |
513 | } | 521 | } |
514 | 522 | ||
515 | int reiserfs_proc_info_done(struct super_block *sb) | 523 | int reiserfs_proc_info_done(struct super_block *sb) |
516 | { | 524 | { |
517 | 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 | |||
518 | if (de) { | 535 | if (de) { |
519 | remove_proc_entry("journal", de); | 536 | remove_proc_entry("journal", de); |
520 | remove_proc_entry("oidmap", de); | 537 | remove_proc_entry("oidmap", de); |
@@ -528,7 +545,7 @@ int reiserfs_proc_info_done(struct super_block *sb) | |||
528 | __PINFO(sb).exiting = 1; | 545 | __PINFO(sb).exiting = 1; |
529 | spin_unlock(&__PINFO(sb).lock); | 546 | spin_unlock(&__PINFO(sb).lock); |
530 | if (proc_info_root) { | 547 | if (proc_info_root) { |
531 | remove_proc_entry(reiserfs_bdevname(sb), proc_info_root); | 548 | remove_proc_entry(b, proc_info_root); |
532 | REISERFS_SB(sb)->procdir = NULL; | 549 | REISERFS_SB(sb)->procdir = NULL; |
533 | } | 550 | } |
534 | return 0; | 551 | return 0; |