diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-09-23 09:18:24 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-09-23 09:18:24 -0400 |
commit | 9f6200bbfc962d8f926278cf5d5ddb90a228c322 (patch) | |
tree | 86cf42e4f1fff753a38c64d49971efd04bfdd5f9 /fs/ext4/super.c | |
parent | f702ba0fd7d50b5f5f5aea5317875a10d40b869f (diff) |
ext4: move /proc setup and teardown out of mballoc.c
...and into the core setup/teardown code in fs/ext4/super.c so that
other parts of ext4 can define tuning parameters.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index fb5766e2bffe..7feeec6f7c39 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -34,6 +34,7 @@ #include <linux/namei.h> #include <linux/quotaops.h> #include <linux/seq_file.h> +#include <linux/proc_fs.h> #include <linux/log2.h> #include <linux/crc16.h> #include <asm/uaccess.h> @@ -45,6 +46,8 @@ #include "namei.h" #include "group.h" +struct proc_dir_entry *ext4_proc_root; + static int ext4_load_journal(struct super_block *, struct ext4_super_block *, unsigned long journal_devnum); static int ext4_create_journal(struct super_block *, struct ext4_super_block *, @@ -512,6 +515,8 @@ static void ext4_put_super(struct super_block *sb) mark_buffer_dirty(sbi->s_sbh); ext4_commit_super(sb, es, 1); } + if (sbi->s_proc) + remove_proc_entry(sb->s_id, ext4_proc_root); for (i = 0; i < sbi->s_gdb_count; i++) brelse(sbi->s_group_desc[i]); @@ -1916,6 +1921,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) unsigned long journal_devnum = 0; unsigned long def_mount_opts; struct inode *root; + char *cp; int ret = -EINVAL; int blocksize; int db_count; @@ -1936,6 +1942,10 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) unlock_kernel(); + /* Cleanup superblock name */ + for (cp = sb->s_id; (cp = strchr(cp, '/'));) + *cp = '!'; + blocksize = sb_min_blocksize(sb, EXT4_MIN_BLOCK_SIZE); if (!blocksize) { printk(KERN_ERR "EXT4-fs: unable to set blocksize\n"); @@ -2221,6 +2231,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount; } + if (ext4_proc_root) + sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root); + bgl_lock_init(&sbi->s_blockgroup_lock); for (i = 0; i < db_count; i++) { @@ -2500,6 +2513,8 @@ failed_mount2: brelse(sbi->s_group_desc[i]); kfree(sbi->s_group_desc); failed_mount: + if (sbi->s_proc) + remove_proc_entry(sb->s_id, ext4_proc_root); #ifdef CONFIG_QUOTA for (i = 0; i < MAXQUOTAS; i++) kfree(sbi->s_qf_names[i]); @@ -3538,6 +3553,7 @@ static int __init init_ext4_fs(void) { int err; + ext4_proc_root = proc_mkdir("fs/ext4", NULL); err = init_ext4_mballoc(); if (err) return err; @@ -3567,6 +3583,7 @@ static void __exit exit_ext4_fs(void) destroy_inodecache(); exit_ext4_xattr(); exit_ext4_mballoc(); + remove_proc_entry("fs/ext4", NULL); } MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others"); |