Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 128794
b: refs/heads/master
c: 43e570b
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Chris Mason committed Sep 25, 2008
1 parent 30702d3 commit f602013
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: edf24abe51493ccda384644d487fe2f796ac21c8
refs/heads/master: 43e570b08a6c6b1d75f218566a6240542a386fd9
21 changes: 16 additions & 5 deletions trunk/fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ static void btrfs_put_super (struct super_block * sb)
}

enum {
Opt_degraded, Opt_subvol, Opt_nodatasum, Opt_nodatacow,
Opt_degraded, Opt_subvol, Opt_device, Opt_nodatasum, Opt_nodatacow,
Opt_max_extent, Opt_max_inline, Opt_alloc_start, Opt_nobarrier,
Opt_ssd, Opt_err,
};

static match_table_t tokens = {
{Opt_degraded, "degraded"},
{Opt_subvol, "subvol=%s"},
{Opt_device, "device=%s"},
{Opt_nodatasum, "nodatasum"},
{Opt_nodatacow, "nodatacow"},
{Opt_nobarrier, "nobarrier"},
Expand Down Expand Up @@ -142,8 +143,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
btrfs_set_opt(info->mount_opt, DEGRADED);
break;
case Opt_subvol:
case Opt_device:
/*
* This one is parsed by btrfs_parse_early_options
* These are parsed by btrfs_parse_early_options
* and can be happily ignored here.
*/
break;
Expand Down Expand Up @@ -212,8 +214,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
* All other options will be parsed on much later in the mount process and
* only when we need to allocate a new super block.
*/
static int btrfs_parse_early_options(const char *options,
char **subvol_name)
static int btrfs_parse_early_options(const char *options, int flags,
void *holder, char **subvol_name,
struct btrfs_fs_devices **fs_devices)
{
substring_t args[MAX_OPT_ARGS];
char *opts, *p;
Expand All @@ -240,11 +243,18 @@ static int btrfs_parse_early_options(const char *options,
case Opt_subvol:
*subvol_name = match_strdup(&args[0]);
break;
case Opt_device:
error = btrfs_scan_one_device(match_strdup(&args[0]),
flags, holder, fs_devices);
if (error)
goto out_free_opts;
break;
default:
break;
}
}

out_free_opts:
kfree(opts);
out:
/*
Expand Down Expand Up @@ -380,7 +390,8 @@ static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
struct btrfs_fs_devices *fs_devices = NULL;
int error = 0;

error = btrfs_parse_early_options(data, &subvol_name);
error = btrfs_parse_early_options(data, flags, fs_type,
&subvol_name, &fs_devices);
if (error)
goto error;

Expand Down

0 comments on commit f602013

Please sign in to comment.