Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24394
b: refs/heads/master
c: 9ade92a
h: refs/heads/master
v: v3
  • Loading branch information
Alasdair G Kergon authored and Linus Torvalds committed Mar 27, 2006
1 parent 258bd32 commit f1a2f39
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 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: 7e51f257e87297a5b6fe6d136a8ef67206aaf3a8
refs/heads/master: 9ade92a9a5b0a3a10efa6551b8c67a9277bf0438
16 changes: 13 additions & 3 deletions trunk/drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,22 @@ static int dev_create(struct dm_ioctl *param, size_t param_size)
*/
static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param)
{
struct mapped_device *md;
void *mdptr = NULL;

if (*param->uuid)
return __get_uuid_cell(param->uuid);
else if (*param->name)

if (*param->name)
return __get_name_cell(param->name);
else
return dm_get_mdptr(huge_decode_dev(param->dev));

md = dm_get_md(huge_decode_dev(param->dev));
if (md) {
mdptr = dm_get_mdptr(md);
dm_put(md);
}

return mdptr;
}

static struct mapped_device *find_device(struct dm_ioctl *param)
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,15 +990,9 @@ struct mapped_device *dm_get_md(dev_t dev)
return md;
}

void *dm_get_mdptr(dev_t dev)
void *dm_get_mdptr(struct mapped_device *md)
{
struct mapped_device *md;
void *mdptr = NULL;

md = dm_find_md(dev);
if (md)
mdptr = md->interface_ptr;
return mdptr;
return md->interface_ptr;
}

void dm_set_mdptr(struct mapped_device *md, void *ptr)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/md/dm.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct mapped_device;
int dm_create(struct mapped_device **md);
int dm_create_with_minor(unsigned int minor, struct mapped_device **md);
void dm_set_mdptr(struct mapped_device *md, void *ptr);
void *dm_get_mdptr(dev_t dev);
void *dm_get_mdptr(struct mapped_device *md);
struct mapped_device *dm_get_md(dev_t dev);

/*
Expand Down

0 comments on commit f1a2f39

Please sign in to comment.