From 717dd80e999cdc84fb611decec5c5054d37c40d2 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Tue, 6 Sep 2005 15:18:48 -0700 Subject: [PATCH] hfs: show_options support This adds support for show_options. It also fixes some namespace polution in the hfsplus driver. Signed-off-by: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/hfsplus/options.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'fs/hfsplus/options.c') diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c index 1cca0102c98..cca0818aa4c 100644 --- a/fs/hfsplus/options.c +++ b/fs/hfsplus/options.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include "hfsplus_fs.h" enum { @@ -38,7 +40,7 @@ static match_table_t tokens = { }; /* Initialize an options object to reasonable defaults */ -void fill_defaults(struct hfsplus_sb_info *opts) +void hfsplus_fill_defaults(struct hfsplus_sb_info *opts) { if (!opts) return; @@ -63,7 +65,7 @@ static inline int match_fourchar(substring_t *arg, u32 *result) /* Parse options from mount. Returns 0 on failure */ /* input is the options passed to mount() as a string */ -int parse_options(char *input, struct hfsplus_sb_info *sbi) +int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) { char *p; substring_t args[MAX_OPT_ARGS]; @@ -160,3 +162,23 @@ done: return 1; } + +int hfsplus_show_options(struct seq_file *seq, struct vfsmount *mnt) +{ + struct hfsplus_sb_info *sbi = &HFSPLUS_SB(mnt->mnt_sb); + + if (sbi->creator != HFSPLUS_DEF_CR_TYPE) + seq_printf(seq, ",creator=%.4s", (char *)&sbi->creator); + if (sbi->type != HFSPLUS_DEF_CR_TYPE) + seq_printf(seq, ",type=%.4s", (char *)&sbi->type); + seq_printf(seq, ",umask=%o,uid=%u,gid=%u", sbi->umask, sbi->uid, sbi->gid); + if (sbi->part >= 0) + seq_printf(seq, ",part=%u", sbi->part); + if (sbi->session >= 0) + seq_printf(seq, ",session=%u", sbi->session); + if (sbi->nls) + seq_printf(seq, ",nls=%s", sbi->nls->charset); + if (sbi->flags & HFSPLUS_SB_NODECOMPOSE) + seq_printf(seq, ",nodecompose"); + return 0; +} -- cgit v1.2.3