summaryrefslogtreecommitdiff
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2006-06-26 00:27:32 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 09:58:36 -0700
commit2b06cfff12f0f87c4bc4d4c4dd76997e72c360ba (patch)
tree68e9085593ef64b78a60daec94898e620bf716c3 /drivers/md/dm-ioctl.c
parent814d68629b40e863997fa0eea459be4cc99a06cc (diff)
[PATCH] dm: consolidate creation functions
Merge dm_create() and dm_create_with_minor() by introducing the special value DM_ANY_MINOR to request the allocation of the next available minor number. Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r--drivers/md/dm-ioctl.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index f7e743691aa8..c826b3e1799a 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001, 2002 Sistina Software (UK) Limited.
- * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004 - 2006 Red Hat, Inc. All rights reserved.
*
* This file is released under the GPL.
*/
@@ -578,7 +578,7 @@ static int __dev_status(struct mapped_device *md, struct dm_ioctl *param)
static int dev_create(struct dm_ioctl *param, size_t param_size)
{
- int r;
+ int r, m = DM_ANY_MINOR;
struct mapped_device *md;
r = check_name(param->name);
@@ -586,10 +586,9 @@ static int dev_create(struct dm_ioctl *param, size_t param_size)
return r;
if (param->flags & DM_PERSISTENT_DEV_FLAG)
- r = dm_create_with_minor(MINOR(huge_decode_dev(param->dev)), &md);
- else
- r = dm_create(&md);
+ m = MINOR(huge_decode_dev(param->dev));
+ r = dm_create(m, &md);
if (r)
return r;