diff options
author | Alasdair G Kergon <agk@redhat.com> | 2006-06-26 03:27:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:36 -0400 |
commit | 2b06cfff12f0f87c4bc4d4c4dd76997e72c360ba (patch) | |
tree | 68e9085593ef64b78a60daec94898e620bf716c3 /drivers/md/dm-ioctl.c | |
parent | 814d68629b40e863997fa0eea459be4cc99a06cc (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.c | 9 |
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 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. | 2 | * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. |
3 | * Copyright (C) 2004 - 2005 Red Hat, Inc. All rights reserved. | 3 | * Copyright (C) 2004 - 2006 Red Hat, Inc. All rights reserved. |
4 | * | 4 | * |
5 | * This file is released under the GPL. | 5 | * This file is released under the GPL. |
6 | */ | 6 | */ |
@@ -578,7 +578,7 @@ static int __dev_status(struct mapped_device *md, struct dm_ioctl *param) | |||
578 | 578 | ||
579 | static int dev_create(struct dm_ioctl *param, size_t param_size) | 579 | static int dev_create(struct dm_ioctl *param, size_t param_size) |
580 | { | 580 | { |
581 | int r; | 581 | int r, m = DM_ANY_MINOR; |
582 | struct mapped_device *md; | 582 | struct mapped_device *md; |
583 | 583 | ||
584 | r = check_name(param->name); | 584 | r = check_name(param->name); |
@@ -586,10 +586,9 @@ static int dev_create(struct dm_ioctl *param, size_t param_size) | |||
586 | return r; | 586 | return r; |
587 | 587 | ||
588 | if (param->flags & DM_PERSISTENT_DEV_FLAG) | 588 | if (param->flags & DM_PERSISTENT_DEV_FLAG) |
589 | r = dm_create_with_minor(MINOR(huge_decode_dev(param->dev)), &md); | 589 | m = MINOR(huge_decode_dev(param->dev)); |
590 | else | ||
591 | r = dm_create(&md); | ||
592 | 590 | ||
591 | r = dm_create(m, &md); | ||
593 | if (r) | 592 | if (r) |
594 | return r; | 593 | return r; |
595 | 594 | ||