init_rwsem(&md->lock); 
init_rwsem(&md->io_lock); init_MUTEX(&md->suspend_lock); 
static struct mapped_device *alloc_dev(unsigned int minor, int persistent){	int r;	struct mapped_device *md = kmalloc(sizeof(*md), GFP_KERNEL);	if (!md) {		DMWARN("unable to allocate device, out of memory.");		return NULL;	}	/* get a minor number for the dev */	r = persistent ? specific_minor(md, minor) : next_free_minor(md, &minor);	if (r < 0)		goto bad1;	memset(md, 0, sizeof(*md));	init_rwsem(&md->lock);	rwlock_init(&md->map_lock);	atomic_set(&md->holders, 1);	atomic_set(&md->event_nr, 0);	md->queue = blk_alloc_queue(GFP_KERNEL);	if (!md->queue)		goto bad1;	md->queue->queuedata = md;	md->queue->backing_dev_info.congested_fn = dm_any_congested;	md->queue->backing_dev_info.congested_data = md;	blk_queue_make_request(md->queue, dm_request);	md->queue->unplug_fn = dm_unplug_all;	md->queue->issue_flush_fn = dm_flush_all;	md->io_pool = mempool_create(MIN_IOS, mempool_alloc_slab,				     mempool_free_slab, _io_cache); 	if (!md->io_pool) 		goto bad2;	md->tio_pool = mempool_create(MIN_IOS, mempool_alloc_slab,				      mempool_free_slab, _tio_cache);	if (!md->tio_pool)		goto bad3;	md->disk = alloc_disk(1);	if (!md->disk)		goto bad4;	md->disk->major = _major;	md->disk->first_minor = minor;	md->disk->fops = &dm_blk_dops;	md->disk->queue = md->queue;	md->disk->private_data = md;	sprintf(md->disk->disk_name, "dm-%d", minor);	add_disk(md->disk);	atomic_set(&md->pending, 0);	init_waitqueue_head(&md->wait);	init_waitqueue_head(&md->eventq);	return md; bad4:	mempool_destroy(md->tio_pool); bad3:	mempool_destroy(md->io_pool); bad2:	blk_put_queue(md->queue);	free_minor(minor); bad1:	kfree(md);	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2ca3310e78912a527d7d2c62c01da7cbf7346b8d/dm.c/clean/drivers/md/dm.c