aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2007-10-17 02:26:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:49 -0400
commit2a9807c0d39066236640aa34ca8de168e690632f (patch)
treed0d05b5c89336344d2bb95a41f6ce065c8211e6c
parent252e211e90ce56bf005cb533ad5a297c18c19407 (diff)
ufs: implement show_options
An implementation of show_options method for UFS. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Cc: "Randy.Dunlap" <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/ufs/super.c43
1 files changed, 39 insertions, 4 deletions
diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 87f6b51a895d..21987d29994d 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -88,6 +88,8 @@
88#include <linux/buffer_head.h> 88#include <linux/buffer_head.h>
89#include <linux/vfs.h> 89#include <linux/vfs.h>
90#include <linux/log2.h> 90#include <linux/log2.h>
91#include <linux/mount.h>
92#include <linux/seq_file.h>
91 93
92#include "swab.h" 94#include "swab.h"
93#include "util.h" 95#include "util.h"
@@ -286,10 +288,21 @@ void ufs_warning (struct super_block * sb, const char * function,
286} 288}
287 289
288enum { 290enum {
289 Opt_type_old, Opt_type_sunx86, Opt_type_sun, Opt_type_sunos, Opt_type_44bsd, 291 Opt_type_old = UFS_MOUNT_UFSTYPE_OLD,
290 Opt_type_ufs2, Opt_type_hp, Opt_type_nextstepcd, Opt_type_nextstep, 292 Opt_type_sunx86 = UFS_MOUNT_UFSTYPE_SUNx86,
291 Opt_type_openstep, Opt_onerror_panic, Opt_onerror_lock, 293 Opt_type_sun = UFS_MOUNT_UFSTYPE_SUN,
292 Opt_onerror_umount, Opt_onerror_repair, Opt_err 294 Opt_type_sunos = UFS_MOUNT_UFSTYPE_SUNOS,
295 Opt_type_44bsd = UFS_MOUNT_UFSTYPE_44BSD,
296 Opt_type_ufs2 = UFS_MOUNT_UFSTYPE_UFS2,
297 Opt_type_hp = UFS_MOUNT_UFSTYPE_HP,
298 Opt_type_nextstepcd = UFS_MOUNT_UFSTYPE_NEXTSTEP_CD,
299 Opt_type_nextstep = UFS_MOUNT_UFSTYPE_NEXTSTEP,
300 Opt_type_openstep = UFS_MOUNT_UFSTYPE_OPENSTEP,
301 Opt_onerror_panic = UFS_MOUNT_ONERROR_PANIC,
302 Opt_onerror_lock = UFS_MOUNT_ONERROR_LOCK,
303 Opt_onerror_umount = UFS_MOUNT_ONERROR_UMOUNT,
304 Opt_onerror_repair = UFS_MOUNT_ONERROR_REPAIR,
305 Opt_err
293}; 306};
294 307
295static match_table_t tokens = { 308static match_table_t tokens = {
@@ -304,6 +317,7 @@ static match_table_t tokens = {
304 {Opt_type_nextstepcd, "ufstype=nextstep-cd"}, 317 {Opt_type_nextstepcd, "ufstype=nextstep-cd"},
305 {Opt_type_nextstep, "ufstype=nextstep"}, 318 {Opt_type_nextstep, "ufstype=nextstep"},
306 {Opt_type_openstep, "ufstype=openstep"}, 319 {Opt_type_openstep, "ufstype=openstep"},
320/*end of possible ufs types */
307 {Opt_onerror_panic, "onerror=panic"}, 321 {Opt_onerror_panic, "onerror=panic"},
308 {Opt_onerror_lock, "onerror=lock"}, 322 {Opt_onerror_lock, "onerror=lock"},
309 {Opt_onerror_umount, "onerror=umount"}, 323 {Opt_onerror_umount, "onerror=umount"},
@@ -1206,6 +1220,26 @@ static int ufs_remount (struct super_block *sb, int *mount_flags, char *data)
1206 return 0; 1220 return 0;
1207} 1221}
1208 1222
1223static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs)
1224{
1225 struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb);
1226 unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE;
1227 struct match_token *tp = tokens;
1228
1229 while (tp->token != Opt_onerror_panic && tp->token != mval)
1230 ++tp;
1231 BUG_ON(tp->token == Opt_onerror_panic);
1232 seq_printf(seq, ",%s", tp->pattern);
1233
1234 mval = sbi->s_mount_opt & UFS_MOUNT_ONERROR;
1235 while (tp->token != Opt_err && tp->token != mval)
1236 ++tp;
1237 BUG_ON(tp->token == Opt_err);
1238 seq_printf(seq, ",%s", tp->pattern);
1239
1240 return 0;
1241}
1242
1209static int ufs_statfs(struct dentry *dentry, struct kstatfs *buf) 1243static int ufs_statfs(struct dentry *dentry, struct kstatfs *buf)
1210{ 1244{
1211 struct super_block *sb = dentry->d_sb; 1245 struct super_block *sb = dentry->d_sb;
@@ -1298,6 +1332,7 @@ static const struct super_operations ufs_super_ops = {
1298 .write_super = ufs_write_super, 1332 .write_super = ufs_write_super,
1299 .statfs = ufs_statfs, 1333 .statfs = ufs_statfs,
1300 .remount_fs = ufs_remount, 1334 .remount_fs = ufs_remount,
1335 .show_options = ufs_show_options,
1301#ifdef CONFIG_QUOTA 1336#ifdef CONFIG_QUOTA
1302 .quota_read = ufs_quota_read, 1337 .quota_read = ufs_quota_read,
1303 .quota_write = ufs_quota_write, 1338 .quota_write = ufs_quota_write,