23
23
#include <linux/parser.h>
24
24
#include <linux/mpage.h>
25
25
#include <linux/user_namespace.h>
26
+ #include <linux/seq_file.h>
26
27
27
28
#include "isofs.h"
28
29
#include "zisofs.h"
@@ -57,6 +58,7 @@ static void isofs_put_super(struct super_block *sb)
57
58
58
59
static int isofs_read_inode (struct inode * , int relocated );
59
60
static int isofs_statfs (struct dentry * , struct kstatfs * );
61
+ static int isofs_show_options (struct seq_file * , struct dentry * );
60
62
61
63
static struct kmem_cache * isofs_inode_cachep ;
62
64
@@ -123,7 +125,7 @@ static const struct super_operations isofs_sops = {
123
125
.put_super = isofs_put_super ,
124
126
.statfs = isofs_statfs ,
125
127
.remount_fs = isofs_remount ,
126
- .show_options = generic_show_options ,
128
+ .show_options = isofs_show_options ,
127
129
};
128
130
129
131
@@ -472,6 +474,48 @@ static int parse_options(char *options, struct iso9660_options *popt)
472
474
return 1 ;
473
475
}
474
476
477
+ /*
478
+ * Display the mount options in /proc/mounts.
479
+ */
480
+ static int isofs_show_options (struct seq_file * m , struct dentry * root )
481
+ {
482
+ struct isofs_sb_info * sbi = ISOFS_SB (root -> d_sb );
483
+
484
+ if (!sbi -> s_rock ) seq_puts (m , ",norock" );
485
+ else if (!sbi -> s_joliet_level ) seq_puts (m , ",nojoliet" );
486
+ if (sbi -> s_cruft ) seq_puts (m , ",cruft" );
487
+ if (sbi -> s_hide ) seq_puts (m , ",hide" );
488
+ if (sbi -> s_nocompress ) seq_puts (m , ",nocompress" );
489
+ if (sbi -> s_overriderockperm ) seq_puts (m , ",overriderockperm" );
490
+ if (sbi -> s_showassoc ) seq_puts (m , ",showassoc" );
491
+ if (sbi -> s_utf8 ) seq_puts (m , ",utf8" );
492
+
493
+ if (sbi -> s_check ) seq_printf (m , ",check=%c" , sbi -> s_check );
494
+ if (sbi -> s_mapping ) seq_printf (m , ",map=%c" , sbi -> s_mapping );
495
+ if (sbi -> s_session != -1 ) seq_printf (m , ",session=%u" , sbi -> s_session );
496
+ if (sbi -> s_sbsector != -1 ) seq_printf (m , ",sbsector=%u" , sbi -> s_sbsector );
497
+
498
+ if (root -> d_sb -> s_blocksize != 1024 )
499
+ seq_printf (m , ",blocksize=%lu" , root -> d_sb -> s_blocksize );
500
+
501
+ if (sbi -> s_uid_set )
502
+ seq_printf (m , ",uid=%u" ,
503
+ from_kuid_munged (& init_user_ns , sbi -> s_uid ));
504
+ if (sbi -> s_gid_set )
505
+ seq_printf (m , ",gid=%u" ,
506
+ from_kgid_munged (& init_user_ns , sbi -> s_gid ));
507
+
508
+ if (sbi -> s_dmode != ISOFS_INVALID_MODE )
509
+ seq_printf (m , ",dmode=%o" , sbi -> s_dmode );
510
+ if (sbi -> s_fmode != ISOFS_INVALID_MODE )
511
+ seq_printf (m , ",fmode=%o" , sbi -> s_fmode );
512
+
513
+ if (sbi -> s_nls_iocharset &&
514
+ strcmp (sbi -> s_nls_iocharset -> charset , CONFIG_NLS_DEFAULT ) != 0 )
515
+ seq_printf (m , ",iocharset=%s" , sbi -> s_nls_iocharset -> charset );
516
+ return 0 ;
517
+ }
518
+
475
519
/*
476
520
* look if the driver can tell the multi session redirection value
477
521
*
@@ -583,8 +627,6 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
583
627
int table , error = - EINVAL ;
584
628
unsigned int vol_desc_start ;
585
629
586
- save_mount_options (s , data );
587
-
588
630
sbi = kzalloc (sizeof (* sbi ), GFP_KERNEL );
589
631
if (!sbi )
590
632
return - ENOMEM ;
@@ -605,6 +647,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
605
647
opt .blocksize = sb_min_blocksize (s , opt .blocksize );
606
648
607
649
sbi -> s_high_sierra = 0 ; /* default is iso9660 */
650
+ sbi -> s_session = opt .session ;
651
+ sbi -> s_sbsector = opt .sbsector ;
608
652
609
653
vol_desc_start = (opt .sbsector != -1 ) ?
610
654
opt .sbsector : isofs_get_last_session (s ,opt .session );
@@ -911,6 +955,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
911
955
table += 2 ;
912
956
if (opt .check == 'r' )
913
957
table ++ ;
958
+ sbi -> s_check = opt .check ;
914
959
915
960
if (table )
916
961
s -> s_d_op = & isofs_dentry_ops [table - 1 ];
0 commit comments