linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: Re: [patch 25/26] mount options: fix udf
Date: Thu, 24 Jan 2008 23:40:10 +0300	[thread overview]
Message-ID: <20080124204010.GD6724@cvg> (raw)
In-Reply-To: <20080124193456.220272889@szeredi.hu>

[Miklos Szeredi - Thu, Jan 24, 2008 at 08:34:06PM +0100]
| From: Miklos Szeredi <mszeredi@suse.cz>
| 
| Add a .show_options super operation to udf.
| 
| Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
| ---
| 
| Index: linux/fs/udf/super.c
| ===================================================================
| --- linux.orig/fs/udf/super.c	2008-01-24 13:48:37.000000000 +0100
| +++ linux/fs/udf/super.c	2008-01-24 15:58:21.000000000 +0100
| @@ -53,6 +53,8 @@
|  #include <linux/vfs.h>
|  #include <linux/vmalloc.h>
|  #include <linux/errno.h>
| +#include <linux/mount.h>
| +#include <linux/seq_file.h>
|  #include <asm/byteorder.h>
|  
|  #include <linux/udf_fs.h>
| @@ -71,6 +73,8 @@
|  #define VDS_POS_TERMINATING_DESC	6
|  #define VDS_POS_LENGTH			7
|  
| +#define UDF_DEFAULT_BLOCKSIZE 2048
| +
|  static char error_buf[1024];
|  
|  /* These are the "meat" - everything else is stuffing */
| @@ -95,6 +99,7 @@ static void udf_open_lvid(struct super_b
|  static void udf_close_lvid(struct super_block *);
|  static unsigned int udf_count_free(struct super_block *);
|  static int udf_statfs(struct dentry *, struct kstatfs *);
| +static int udf_show_options(struct seq_file *, struct vfsmount *);
|  
|  struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi)
|  {
| @@ -181,6 +186,7 @@ static const struct super_operations udf
|  	.write_super	= udf_write_super,
|  	.statfs		= udf_statfs,
|  	.remount_fs	= udf_remount_fs,
| +	.show_options	= udf_show_options,
|  };
|  
|  struct udf_options {
| @@ -247,6 +253,56 @@ static int udf_sb_alloc_partition_maps(s
|  	return 0;
|  }
|  
| +static int udf_show_options(struct seq_file *seq, struct vfsmount *mnt)
| +{
| +	struct super_block *sb = mnt->mnt_sb;
| +	struct udf_sb_info *sbi = UDF_SB(sb);
| +
| +	if (!UDF_QUERY_FLAG(sb, UDF_FLAG_STRICT))
| +		seq_puts(seq, ",nostrict");
| +	if (sb->s_blocksize != UDF_DEFAULT_BLOCKSIZE)
| +		seq_printf(seq, ",bs=%lu", sb->s_blocksize);
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_UNHIDE))
| +		seq_puts(seq, ",unhide");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_UNDELETE))
| +		seq_puts(seq, ",undelete");
| +	if (!UDF_QUERY_FLAG(sb, UDF_FLAG_USE_AD_IN_ICB))
| +		seq_puts(seq, ",noadinicb");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_USE_SHORT_AD))
| +		seq_puts(seq, ",shortad");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_UID_FORGET))
| +		seq_puts(seq, ",uid=forget");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_UID_IGNORE))
| +		seq_puts(seq, ",uid=ignore");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_GID_FORGET))
| +		seq_puts(seq, ",gid=forget");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_GID_IGNORE))
| +		seq_puts(seq, ",gid=ignore");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_UID_SET))
| +		seq_printf(seq, ",uid=%u", sbi->s_uid);
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_GID_SET))
| +		seq_printf(seq, ",gid=%u", sbi->s_gid);
| +	if (sbi->s_umask != 0)
| +		seq_printf(seq, ",umask=%o", sbi->s_umask);
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET))
| +		seq_printf(seq, ",session=%u", sbi->s_session);
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET))
| +		seq_printf(seq, ",lastblock=%u", sbi->s_last_block);
| +	/* is this correct? */
| +	if (sbi->s_anchor[2] != 0)
| +		seq_printf(seq, ",anchor=%u", sbi->s_anchor[2]);

btw, Miklos, i think you may strip off != and use just if (val)
form, like "if (sbi->s_umask)"

| +	/*
| +	 * volume, partition, fileset and rootdir seem to be ignored
| +	 * currently
| +	 */
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_UTF8))
| +		seq_puts(seq, ",utf8");
| +	if (UDF_QUERY_FLAG(sb, UDF_FLAG_NLS_MAP) && sbi->s_nls_map)
| +		seq_printf(seq, ",iocharset=%s", sbi->s_nls_map->charset);
| +
| +	return 0;
| +}
| +
|  /*
|   * udf_parse_options
|   *
| @@ -339,13 +395,14 @@ static match_table_t tokens = {
|  	{Opt_err,	NULL}
|  };
|  
| -static int udf_parse_options(char *options, struct udf_options *uopt)
| +static int udf_parse_options(char *options, struct udf_options *uopt,
| +			     bool remount)
|  {
|  	char *p;
|  	int option;
|  
|  	uopt->novrs = 0;
| -	uopt->blocksize = 2048;
| +	uopt->blocksize = UDF_DEFAULT_BLOCKSIZE;
|  	uopt->partition = 0xFFFF;
|  	uopt->session = 0xFFFFFFFF;
|  	uopt->lastblock = 0;
| @@ -415,11 +472,15 @@ static int udf_parse_options(char *optio
|  			if (match_int(args, &option))
|  				return 0;
|  			uopt->session = option;
| +			if (!remount)
| +				uopt->flags |= (1 << UDF_FLAG_SESSION_SET);
|  			break;
|  		case Opt_lastblock:
|  			if (match_int(args, &option))
|  				return 0;
|  			uopt->lastblock = option;
| +			if (!remount)
| +				uopt->flags |= (1 << UDF_FLAG_LASTBLOCK_SET);
|  			break;
|  		case Opt_anchor:
|  			if (match_int(args, &option))
| @@ -497,7 +558,7 @@ static int udf_remount_fs(struct super_b
|  	uopt.gid   = sbi->s_gid;
|  	uopt.umask = sbi->s_umask;
|  
| -	if (!udf_parse_options(options, &uopt))
| +	if (!udf_parse_options(options, &uopt, true))
|  		return -EINVAL;
|  
|  	sbi->s_flags = uopt.flags;
| @@ -1679,7 +1740,7 @@ static int udf_fill_super(struct super_b
|  
|  	mutex_init(&sbi->s_alloc_mutex);
|  
| -	if (!udf_parse_options((char *)options, &uopt))
| +	if (!udf_parse_options((char *)options, &uopt, false))
|  		goto error_out;
|  
|  	if (uopt.flags & (1 << UDF_FLAG_UTF8) &&
| Index: linux/fs/udf/udf_sb.h
| ===================================================================
| --- linux.orig/fs/udf/udf_sb.h	2008-01-24 13:48:37.000000000 +0100
| +++ linux/fs/udf/udf_sb.h	2008-01-24 13:51:08.000000000 +0100
| @@ -26,6 +26,8 @@
|  #define UDF_FLAG_GID_IGNORE     14
|  #define UDF_FLAG_UID_SET	15
|  #define UDF_FLAG_GID_SET	16
| +#define UDF_FLAG_SESSION_SET	17
| +#define UDF_FLAG_LASTBLOCK_SET	18
|  
|  #define UDF_PART_FLAG_UNALLOC_BITMAP	0x0001
|  #define UDF_PART_FLAG_UNALLOC_TABLE	0x0002
| 
| --
| 
		- Cyrill -

  parent reply	other threads:[~2008-01-24 20:40 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24 19:33 [patch 00/26] mount options: fix filesystem's ->show_options Miklos Szeredi
2008-01-24 19:33 ` [patch 01/26] mount options: add documentation Miklos Szeredi
2008-01-25  0:24   ` Erez Zadok
2008-01-25  7:56     ` David Chinner
2008-01-25 10:02     ` Miklos Szeredi
2008-01-30  1:54   ` Roman Zippel
2008-01-30  9:09     ` Miklos Szeredi
2008-01-30 14:42       ` Karel Zak
2008-01-31 17:42         ` Miklos Szeredi
2008-02-08 19:20       ` Roman Zippel
2008-02-08 20:23         ` Miklos Szeredi
2008-01-24 19:33 ` [patch 02/26] mount options: add generic_show_options() Miklos Szeredi
2008-01-24 19:33 ` [patch 03/26] mount options: fix adfs Miklos Szeredi
2008-01-24 20:05   ` Russell King
2008-01-24 19:33 ` [patch 04/26] mount options: fix affs Miklos Szeredi
2008-01-24 19:33 ` [patch 05/26] mount options: fix afs Miklos Szeredi
2008-01-24 19:33 ` [patch 06/26] mount options: fix autofs4 Miklos Szeredi
2008-01-25  5:13   ` Ian Kent
2008-01-24 19:33 ` [patch 07/26] mount options: fix autofs Miklos Szeredi
2008-01-24 19:46   ` H. Peter Anvin
2008-01-24 19:33 ` [patch 08/26] mount options: fix befs Miklos Szeredi
2008-01-24 19:33 ` [patch 09/26] mount options: fix capifs Miklos Szeredi
2008-01-25 10:18   ` Karsten Keil
2008-01-24 19:33 ` [patch 10/26] mount options: fix devpts Miklos Szeredi
2008-01-24 19:46   ` H. Peter Anvin
2008-01-25  9:24     ` Miklos Szeredi
2008-01-24 19:33 ` [patch 11/26] mount options: fix ext2 Miklos Szeredi
2008-01-25 14:34   ` Jan Kara
2008-01-24 19:33 ` [patch 12/26] mount options: fix ext4 Miklos Szeredi
2008-01-25  6:41   ` Andreas Dilger
2008-01-25 14:37   ` Jan Kara
2008-01-25 17:35   ` Mingming Cao
2008-01-24 19:33 ` [patch 13/26] mount options: fix fat Miklos Szeredi
2008-01-24 19:33 ` [patch 14/26] mount options: fix fuse Miklos Szeredi
2008-01-24 19:33 ` [patch 15/26] mount options: fix hostfs Miklos Szeredi
2008-01-24 19:33 ` [patch 16/26] mount options: fix hpfs Miklos Szeredi
2008-01-24 19:33 ` [patch 17/26] mount options: fix hugetlbfs Miklos Szeredi
2008-01-24 19:33 ` [patch 18/26] mount options: fix isofs Miklos Szeredi
2008-01-25 14:42   ` Jan Kara
2008-01-24 19:34 ` [patch 19/26] mount options: fix jfs Miklos Szeredi
2008-01-24 21:15   ` Dave Kleikamp
2008-01-24 21:57     ` Andrew Morton
2008-01-24 22:17       ` Dave Kleikamp
2008-01-24 19:34 ` [patch 20/26] mount options: fix ncpfs Miklos Szeredi
2008-01-24 19:34 ` [patch 21/26] mount options: partially fix nfs Miklos Szeredi
2008-01-24 20:49   ` Chuck Lever
2008-01-25  9:39     ` Miklos Szeredi
2008-01-25 17:19       ` Chuck Lever
2008-01-28 11:34         ` Miklos Szeredi
2008-01-28 16:22           ` Chuck Lever
2008-01-24 20:53   ` Trond Myklebust
2008-01-25  9:43     ` Miklos Szeredi
2008-01-24 19:34 ` [patch 22/26] mount options: fix reiserfs Miklos Szeredi
2008-01-24 19:34 ` [patch 23/26] mount options: fix spufs Miklos Szeredi
2008-01-24 19:34 ` [patch 24/26] mount options: fix tmpfs Miklos Szeredi
2008-01-28  6:09   ` Hugh Dickins
2008-01-28 11:40     ` Miklos Szeredi
2008-01-29 13:28       ` Hugh Dickins
2008-01-24 19:34 ` [patch 25/26] mount options: fix udf Miklos Szeredi
2008-01-24 19:51   ` Cyrill Gorcunov
2008-01-24 20:20   ` Cyrill Gorcunov
2008-01-25  9:29     ` Miklos Szeredi
2008-01-25 10:57       ` Cyrill Gorcunov
2008-01-25 13:41       ` Cyrill Gorcunov
2008-01-25 15:27       ` Jan Kara
2008-01-25 15:50         ` Miklos Szeredi
2008-01-25 15:57           ` Cyrill Gorcunov
2008-01-25 16:07           ` Jan Kara
2008-01-25 16:10             ` Miklos Szeredi
2008-01-24 20:40   ` Cyrill Gorcunov [this message]
2008-01-25 15:30   ` Jan Kara
2008-01-25 15:56     ` Miklos Szeredi
2008-01-25 16:04       ` Jan Kara
2008-01-24 19:34 ` [patch 26/26] mount options: fix usbfs Miklos Szeredi
2008-01-24 22:01   ` Greg KH
2008-01-25  9:54     ` Miklos Szeredi
2008-01-27  6:01 ` [patch 00/26] mount options: fix filesystem's ->show_options Andrew Morton
2008-01-28 11:36   ` Miklos Szeredi
2008-01-29  0:19 ` [patch 05/26] mount options: fix afs David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080124204010.GD6724@cvg \
    --to=gorcunov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).