Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331634
b: refs/heads/master
c: c98f533
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent ea2e844 commit fa578a7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 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: 4156d998409be065aa8141b6bd2c6f18be1b21e9
refs/heads/master: c98f533c9497e285109a047bfb955d683f33f7e4
37 changes: 26 additions & 11 deletions trunk/fs/ceph/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,10 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt,
{
struct ceph_mount_options *fsopt;
const char *dev_name_end;
int err = -ENOMEM;
int err;

if (!dev_name || !*dev_name)
return -EINVAL;

fsopt = kzalloc(sizeof(*fsopt), GFP_KERNEL);
if (!fsopt)
Expand All @@ -328,21 +331,33 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt,
fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT;
fsopt->congestion_kb = default_congestion_kb();

/* ip1[:port1][,ip2[:port2]...]:/subdir/in/fs */
/*
* Distinguish the server list from the path in "dev_name".
* Internally we do not include the leading '/' in the path.
*
* "dev_name" will look like:
* <server_spec>[,<server_spec>...]:[<path>]
* where
* <server_spec> is <ip>[:<port>]
* <path> is optional, but if present must begin with '/'
*/
dev_name_end = strchr(dev_name, '/');
if (dev_name_end) {
/* skip over leading '/' for path */
*path = dev_name_end + 1;
} else {
/* path is empty */
dev_name_end = dev_name + strlen(dev_name);
*path = dev_name_end;
}
err = -EINVAL;
if (!dev_name)
goto out;
*path = strstr(dev_name, ":/");
if (*path == NULL) {
pr_err("device name is missing path (no :/ in %s)\n",
dev_name_end--; /* back up to ':' separator */
if (*dev_name_end != ':') {
pr_err("device name is missing path (no : separator in %s)\n",
dev_name);
goto out;
}
dev_name_end = *path;
dout("device name '%.*s'\n", (int)(dev_name_end - dev_name), dev_name);

/* path on server */
*path += 2;
dout("server path '%s'\n", *path);

*popt = ceph_parse_options(options, dev_name, dev_name_end,
Expand Down

0 comments on commit fa578a7

Please sign in to comment.