aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2006-07-14 03:24:22 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-15 00:53:54 -0400
commit6fbe82a952790c634ea6035c223a01a81377daf1 (patch)
tree103df2f56088e8b1d2467a0e33e82de699afa790 /fs/reiserfs
parentbca3bffec9f37d4cb60b80fd0067f9c7550b5d57 (diff)
[PATCH] reiserfs: fix handling of device names with /'s in them
On systems with block devices containing a slash (virtual dasd, cciss, etc), reiserfs will fail to initialize /proc/fs/reiserfs/<dev> due to it being interpreted as a subdirectory. The generic block device code changes the / to ! for use in the sysfs tree. This patch uses that convention. Tested by making dm devices use dm/<number> rather than dm-<number> [akpm@osdl.org: name variables consistently] Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/procfs.c25
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
493int reiserfs_proc_info_init(struct super_block *sb) 493int 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
515int reiserfs_proc_info_done(struct super_block *sb) 523int 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;