diff options
author | Alasdair G Kergon <agk@redhat.com> | 2006-06-26 09:27:32 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 18:58:36 +0200 |
commit | 2b06cfff12f0f87c4bc4d4c4dd76997e72c360ba (patch) | |
tree | 68e9085593ef64b78a60daec94898e620bf716c3 /drivers/md/dm.h | |
parent | [PATCH] dm table split_args: handle no input (diff) | |
download | linux-2b06cfff12f0f87c4bc4d4c4dd76997e72c360ba.tar.xz linux-2b06cfff12f0f87c4bc4d4c4dd76997e72c360ba.zip |
[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.h')
-rw-r--r-- | drivers/md/dm.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index fd90bc8f9e45..2901ab943191 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h @@ -2,7 +2,7 @@ * Internal header file for device mapper * * Copyright (C) 2001, 2002 Sistina Software - * Copyright (C) 2004 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. * * This file is released under the LGPL. */ @@ -45,16 +45,21 @@ struct mapped_device; * Functions for manipulating a struct mapped_device. * Drop the reference with dm_put when you finish with the object. *---------------------------------------------------------------*/ -int dm_create(struct mapped_device **md); -int dm_create_with_minor(unsigned int minor, struct mapped_device **md); + +/* + * DM_ANY_MINOR allocates any available minor number. + */ +#define DM_ANY_MINOR (-1) +int dm_create(int minor, struct mapped_device **md); + void dm_set_mdptr(struct mapped_device *md, void *ptr); void *dm_get_mdptr(struct mapped_device *md); -struct mapped_device *dm_get_md(dev_t dev); /* * Reference counting for md. */ void dm_get(struct mapped_device *md); +struct mapped_device *dm_get_md(dev_t dev); void dm_put(struct mapped_device *md); /* |