aboutsummaryrefslogtreecommitdiffstats
path: root/fs/adfs/super.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-02-08 07:21:35 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:39 -0500
commite11400b0cadc97cb1062912c1028e965c93fa9b3 (patch)
treeb73813aacee8b5d840dbab1531038abd52310181 /fs/adfs/super.c
parentb3b304a23a8f7ae4c40c7b512ee45afae0010a70 (diff)
mount options: fix adfs
Add a .show_options super operation to adfs. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/adfs/super.c')
-rw-r--r--fs/adfs/super.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index b36695ae5c2e..9e421eeb672b 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -20,6 +20,8 @@
20#include <linux/vfs.h> 20#include <linux/vfs.h>
21#include <linux/parser.h> 21#include <linux/parser.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/mount.h>
24#include <linux/seq_file.h>
23 25
24#include <asm/uaccess.h> 26#include <asm/uaccess.h>
25#include <asm/system.h> 27#include <asm/system.h>
@@ -30,6 +32,9 @@
30#include "dir_f.h" 32#include "dir_f.h"
31#include "dir_fplus.h" 33#include "dir_fplus.h"
32 34
35#define ADFS_DEFAULT_OWNER_MASK S_IRWXU
36#define ADFS_DEFAULT_OTHER_MASK (S_IRWXG | S_IRWXO)
37
33void __adfs_error(struct super_block *sb, const char *function, const char *fmt, ...) 38void __adfs_error(struct super_block *sb, const char *function, const char *fmt, ...)
34{ 39{
35 char error_buf[128]; 40 char error_buf[128];
@@ -134,6 +139,22 @@ static void adfs_put_super(struct super_block *sb)
134 sb->s_fs_info = NULL; 139 sb->s_fs_info = NULL;
135} 140}
136 141
142static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt)
143{
144 struct adfs_sb_info *asb = ADFS_SB(mnt->mnt_sb);
145
146 if (asb->s_uid != 0)
147 seq_printf(seq, ",uid=%u", asb->s_uid);
148 if (asb->s_gid != 0)
149 seq_printf(seq, ",gid=%u", asb->s_gid);
150 if (asb->s_owner_mask != ADFS_DEFAULT_OWNER_MASK)
151 seq_printf(seq, ",ownmask=%o", asb->s_owner_mask);
152 if (asb->s_other_mask != ADFS_DEFAULT_OTHER_MASK)
153 seq_printf(seq, ",othmask=%o", asb->s_other_mask);
154
155 return 0;
156}
157
137enum {Opt_uid, Opt_gid, Opt_ownmask, Opt_othmask, Opt_err}; 158enum {Opt_uid, Opt_gid, Opt_ownmask, Opt_othmask, Opt_err};
138 159
139static match_table_t tokens = { 160static match_table_t tokens = {
@@ -259,6 +280,7 @@ static const struct super_operations adfs_sops = {
259 .put_super = adfs_put_super, 280 .put_super = adfs_put_super,
260 .statfs = adfs_statfs, 281 .statfs = adfs_statfs,
261 .remount_fs = adfs_remount, 282 .remount_fs = adfs_remount,
283 .show_options = adfs_show_options,
262}; 284};
263 285
264static struct adfs_discmap *adfs_read_map(struct super_block *sb, struct adfs_discrecord *dr) 286static struct adfs_discmap *adfs_read_map(struct super_block *sb, struct adfs_discrecord *dr)
@@ -344,8 +366,8 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
344 /* set default options */ 366 /* set default options */
345 asb->s_uid = 0; 367 asb->s_uid = 0;
346 asb->s_gid = 0; 368 asb->s_gid = 0;
347 asb->s_owner_mask = S_IRWXU; 369 asb->s_owner_mask = ADFS_DEFAULT_OWNER_MASK;
348 asb->s_other_mask = S_IRWXG | S_IRWXO; 370 asb->s_other_mask = ADFS_DEFAULT_OTHER_MASK;
349 371
350 if (parse_options(sb, data)) 372 if (parse_options(sb, data))
351 goto error; 373 goto error;