2323#include <linux/parser.h>
2424#include <linux/mpage.h>
2525#include <linux/user_namespace.h>
26+ #include <linux/seq_file.h>
2627
2728#include "isofs.h"
2829#include "zisofs.h"
@@ -57,6 +58,7 @@ static void isofs_put_super(struct super_block *sb)
5758
5859static int isofs_read_inode (struct inode * , int relocated );
5960static int isofs_statfs (struct dentry * , struct kstatfs * );
61+ static int isofs_show_options (struct seq_file * , struct dentry * );
6062
6163static struct kmem_cache * isofs_inode_cachep ;
6264
@@ -123,7 +125,7 @@ static const struct super_operations isofs_sops = {
123125 .put_super = isofs_put_super ,
124126 .statfs = isofs_statfs ,
125127 .remount_fs = isofs_remount ,
126- .show_options = generic_show_options ,
128+ .show_options = isofs_show_options ,
127129};
128130
129131
@@ -472,6 +474,48 @@ static int parse_options(char *options, struct iso9660_options *popt)
472474 return 1 ;
473475}
474476
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+
475519/*
476520 * look if the driver can tell the multi session redirection value
477521 *
@@ -583,8 +627,6 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
583627 int table , error = - EINVAL ;
584628 unsigned int vol_desc_start ;
585629
586- save_mount_options (s , data );
587-
588630 sbi = kzalloc (sizeof (* sbi ), GFP_KERNEL );
589631 if (!sbi )
590632 return - ENOMEM ;
@@ -605,6 +647,8 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
605647 opt .blocksize = sb_min_blocksize (s , opt .blocksize );
606648
607649 sbi -> s_high_sierra = 0 ; /* default is iso9660 */
650+ sbi -> s_session = opt .session ;
651+ sbi -> s_sbsector = opt .sbsector ;
608652
609653 vol_desc_start = (opt .sbsector != -1 ) ?
610654 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)
911955 table += 2 ;
912956 if (opt .check == 'r' )
913957 table ++ ;
958+ sbi -> s_check = opt .check ;
914959
915960 if (table )
916961 s -> s_d_op = & isofs_dentry_ops [table - 1 ];
0 commit comments