3434#include <linux/namei.h>
3535#include <linux/quotaops.h>
3636#include <linux/seq_file.h>
37- #include <linux/proc_fs.h>
3837#include <linux/ctype.h>
3938#include <linux/log2.h>
4039#include <linux/crc16.h>
5453#define CREATE_TRACE_POINTS
5554#include <trace/events/ext4.h>
5655
57- static struct proc_dir_entry * ext4_proc_root ;
5856static struct ext4_lazy_init * ext4_li_info ;
5957static struct mutex ext4_li_mtx ;
6058static int ext4_mballoc_ready ;
@@ -797,6 +795,7 @@ static void ext4_put_super(struct super_block *sb)
797795 ext4_abort (sb , "Couldn't clean up the journal" );
798796 }
799797
798+ ext4_unregister_sysfs (sb );
800799 ext4_es_unregister_shrinker (sbi );
801800 del_timer_sync (& sbi -> s_err_report );
802801 ext4_release_system_zone (sb );
@@ -811,12 +810,6 @@ static void ext4_put_super(struct super_block *sb)
811810 if (!(sb -> s_flags & MS_RDONLY ))
812811 ext4_commit_super (sb , 1 );
813812
814- if (sbi -> s_proc ) {
815- remove_proc_entry ("options" , sbi -> s_proc );
816- remove_proc_entry (sb -> s_id , ext4_proc_root );
817- }
818- kobject_del (& sbi -> s_kobj );
819-
820813 for (i = 0 ; i < sbi -> s_gdb_count ; i ++ )
821814 brelse (sbi -> s_group_desc [i ]);
822815 kvfree (sbi -> s_group_desc );
@@ -1877,7 +1870,7 @@ static int ext4_show_options(struct seq_file *seq, struct dentry *root)
18771870 return _ext4_show_options (seq , root -> d_sb , 0 );
18781871}
18791872
1880- static int options_seq_show (struct seq_file * seq , void * offset )
1873+ int ext4_seq_options_show (struct seq_file * seq , void * offset )
18811874{
18821875 struct super_block * sb = seq -> private ;
18831876 int rc ;
@@ -1888,19 +1881,6 @@ static int options_seq_show(struct seq_file *seq, void *offset)
18881881 return rc ;
18891882}
18901883
1891- static int options_open_fs (struct inode * inode , struct file * file )
1892- {
1893- return single_open (file , options_seq_show , PDE_DATA (inode ));
1894- }
1895-
1896- static const struct file_operations ext4_seq_options_fops = {
1897- .owner = THIS_MODULE ,
1898- .open = options_open_fs ,
1899- .read = seq_read ,
1900- .llseek = seq_lseek ,
1901- .release = single_release ,
1902- };
1903-
19041884static int ext4_setup_super (struct super_block * sb , struct ext4_super_block * es ,
19051885 int read_only )
19061886{
@@ -3616,13 +3596,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
36163596 goto failed_mount ;
36173597 }
36183598
3619- if (ext4_proc_root )
3620- sbi -> s_proc = proc_mkdir (sb -> s_id , ext4_proc_root );
3621-
3622- if (sbi -> s_proc )
3623- proc_create_data ("options" , S_IRUGO , sbi -> s_proc ,
3624- & ext4_seq_options_fops , sb );
3625-
36263599 bgl_lock_init (sbi -> s_blockgroup_lock );
36273600
36283601 for (i = 0 ; i < db_count ; i ++ ) {
@@ -3960,7 +3933,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
39603933
39613934#ifdef CONFIG_QUOTA
39623935failed_mount8 :
3963- kobject_del ( & sbi -> s_kobj );
3936+ ext4_unregister_sysfs ( sb );
39643937#endif
39653938failed_mount7 :
39663939 ext4_unregister_li_request (sb );
@@ -4000,10 +3973,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
40003973failed_mount :
40013974 if (sbi -> s_chksum_driver )
40023975 crypto_free_shash (sbi -> s_chksum_driver );
4003- if (sbi -> s_proc ) {
4004- remove_proc_entry ("options" , sbi -> s_proc );
4005- remove_proc_entry (sb -> s_id , ext4_proc_root );
4006- }
40073976#ifdef CONFIG_QUOTA
40083977 for (i = 0 ; i < EXT4_MAXQUOTAS ; i ++ )
40093978 kfree (sbi -> s_qf_names [i ]);
@@ -5264,7 +5233,6 @@ static int __init ext4_init_fs(void)
52645233 err = ext4_init_system_zone ();
52655234 if (err )
52665235 goto out4 ;
5267- ext4_proc_root = proc_mkdir ("fs/ext4" , NULL );
52685236
52695237 err = ext4_init_sysfs ();
52705238 if (err )
@@ -5295,8 +5263,6 @@ static int __init ext4_init_fs(void)
52955263out2 :
52965264 ext4_exit_sysfs ();
52975265out3 :
5298- if (ext4_proc_root )
5299- remove_proc_entry ("fs/ext4" , NULL );
53005266 ext4_exit_system_zone ();
53015267out4 :
53025268 ext4_exit_pageio ();
@@ -5316,7 +5282,6 @@ static void __exit ext4_exit_fs(void)
53165282 destroy_inodecache ();
53175283 ext4_exit_mballoc ();
53185284 ext4_exit_sysfs ();
5319- remove_proc_entry ("fs/ext4" , NULL );
53205285 ext4_exit_system_zone ();
53215286 ext4_exit_pageio ();
53225287 ext4_exit_es ();
0 commit comments