20
20
#include <linux/slab.h>
21
21
#include <linux/writeback.h>
22
22
#include <linux/blkdev.h>
23
+ #include <linux/seq_file.h>
23
24
#include "affs.h"
24
25
25
26
static int affs_statfs (struct dentry * dentry , struct kstatfs * buf );
27
+ static int affs_show_options (struct seq_file * m , struct dentry * root );
26
28
static int affs_remount (struct super_block * sb , int * flags , char * data );
27
29
28
30
static void
@@ -159,7 +161,7 @@ static const struct super_operations affs_sops = {
159
161
.sync_fs = affs_sync_fs ,
160
162
.statfs = affs_statfs ,
161
163
.remount_fs = affs_remount ,
162
- .show_options = generic_show_options ,
164
+ .show_options = affs_show_options ,
163
165
};
164
166
165
167
enum {
@@ -293,6 +295,40 @@ parse_options(char *options, kuid_t *uid, kgid_t *gid, int *mode, int *reserved,
293
295
return 1 ;
294
296
}
295
297
298
+ static int affs_show_options (struct seq_file * m , struct dentry * root )
299
+ {
300
+ struct super_block * sb = root -> d_sb ;
301
+ struct affs_sb_info * sbi = AFFS_SB (sb );
302
+
303
+ if (sb -> s_blocksize )
304
+ seq_printf (m , ",bs=%lu" , sb -> s_blocksize );
305
+ if (affs_test_opt (sbi -> s_flags , SF_SETMODE ))
306
+ seq_printf (m , ",mode=%o" , sbi -> s_mode );
307
+ if (affs_test_opt (sbi -> s_flags , SF_MUFS ))
308
+ seq_puts (m , ",mufs" );
309
+ if (affs_test_opt (sbi -> s_flags , SF_NO_TRUNCATE ))
310
+ seq_puts (m , ",nofilenametruncate" );
311
+ if (affs_test_opt (sbi -> s_flags , SF_PREFIX ))
312
+ seq_printf (m , ",prefix=%s" , sbi -> s_prefix );
313
+ if (affs_test_opt (sbi -> s_flags , SF_IMMUTABLE ))
314
+ seq_puts (m , ",protect" );
315
+ if (sbi -> s_reserved != 2 )
316
+ seq_printf (m , ",reserved=%u" , sbi -> s_reserved );
317
+ if (sbi -> s_root_block != (sbi -> s_reserved + sbi -> s_partition_size - 1 ) / 2 )
318
+ seq_printf (m , ",root=%u" , sbi -> s_root_block );
319
+ if (affs_test_opt (sbi -> s_flags , SF_SETGID ))
320
+ seq_printf (m , ",setgid=%u" ,
321
+ from_kgid_munged (& init_user_ns , sbi -> s_gid ));
322
+ if (affs_test_opt (sbi -> s_flags , SF_SETUID ))
323
+ seq_printf (m , ",setuid=%u" ,
324
+ from_kuid_munged (& init_user_ns , sbi -> s_uid ));
325
+ if (affs_test_opt (sbi -> s_flags , SF_VERBOSE ))
326
+ seq_puts (m , ",verbose" );
327
+ if (sbi -> s_volume [0 ])
328
+ seq_printf (m , ",volume=%s" , sbi -> s_volume );
329
+ return 0 ;
330
+ }
331
+
296
332
/* This function definitely needs to be split up. Some fine day I'll
297
333
* hopefully have the guts to do so. Until then: sorry for the mess.
298
334
*/
@@ -316,8 +352,6 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
316
352
u8 sig [4 ];
317
353
int ret ;
318
354
319
- save_mount_options (sb , data );
320
-
321
355
pr_debug ("read_super(%s)\n" , data ? (const char * )data : "no options" );
322
356
323
357
sb -> s_magic = AFFS_SUPER_MAGIC ;
@@ -548,8 +582,6 @@ affs_remount(struct super_block *sb, int *flags, char *data)
548
582
}
549
583
550
584
flush_delayed_work (& sbi -> sb_work );
551
- if (new_opts )
552
- replace_mount_options (sb , new_opts );
553
585
554
586
sbi -> s_flags = mount_flags ;
555
587
sbi -> s_mode = mode ;
0 commit comments