From 2b06cfff12f0f87c4bc4d4c4dd76997e72c360ba Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 26 Jun 2006 00:27:32 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/dm.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'drivers/md/dm.h') diff --git a/drivers/md/dm.h b/drivers/md/dm.h index fd90bc8f9e4..2901ab94319 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); /* -- cgit v1.2.3