Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32645
b: refs/heads/master
c: 6fbe82a
h: refs/heads/master
i:
  32643: a0c5a2c
v: v3
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed Jul 15, 2006
1 parent ad9cbba commit dcf931e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bca3bffec9f37d4cb60b80fd0067f9c7550b5d57
refs/heads/master: 6fbe82a952790c634ea6035c223a01a81377daf1
25 changes: 21 additions & 4 deletions trunk/fs/reiserfs/procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,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;
Expand All @@ -508,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);
Expand All @@ -528,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;
Expand Down

0 comments on commit dcf931e

Please sign in to comment.