dm.c (efd15f5f4ff63f6ac5d80850686e3d2cc8c4481b) | dm.c (00c4fc3b1f590288cb3c42f36da50f49a513cfcf) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 1932 unchanged lines hidden (view full) --- 1941 md->disk->first_minor = minor; 1942 md->disk->fops = &dm_blk_dops; 1943 md->disk->queue = md->queue; 1944 md->disk->private_data = md; 1945 sprintf(md->disk->disk_name, "dm-%d", minor); 1946 add_disk(md->disk); 1947 format_dev_t(md->name, MKDEV(_major, minor)); 1948 | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 1932 unchanged lines hidden (view full) --- 1941 md->disk->first_minor = minor; 1942 md->disk->fops = &dm_blk_dops; 1943 md->disk->queue = md->queue; 1944 md->disk->private_data = md; 1945 sprintf(md->disk->disk_name, "dm-%d", minor); 1946 add_disk(md->disk); 1947 format_dev_t(md->name, MKDEV(_major, minor)); 1948 |
1949 md->wq = alloc_workqueue("kdmflush", 1950 WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); | 1949 md->wq = alloc_workqueue("kdmflush", WQ_MEM_RECLAIM, 0); |
1951 if (!md->wq) 1952 goto bad_thread; 1953 1954 md->bdev = bdget_disk(md->disk, 0); 1955 if (!md->bdev) 1956 goto bad_bdev; 1957 1958 bio_init(&md->flush_bio); --- 272 unchanged lines hidden (view full) --- 2231 2232void dm_unlock_md_type(struct mapped_device *md) 2233{ 2234 mutex_unlock(&md->type_lock); 2235} 2236 2237void dm_set_md_type(struct mapped_device *md, unsigned type) 2238{ | 1950 if (!md->wq) 1951 goto bad_thread; 1952 1953 md->bdev = bdget_disk(md->disk, 0); 1954 if (!md->bdev) 1955 goto bad_bdev; 1956 1957 bio_init(&md->flush_bio); --- 272 unchanged lines hidden (view full) --- 2230 2231void dm_unlock_md_type(struct mapped_device *md) 2232{ 2233 mutex_unlock(&md->type_lock); 2234} 2235 2236void dm_set_md_type(struct mapped_device *md, unsigned type) 2237{ |
2238 BUG_ON(!mutex_is_locked(&md->type_lock)); |
|
2239 md->type = type; 2240} 2241 2242unsigned dm_get_md_type(struct mapped_device *md) 2243{ | 2239 md->type = type; 2240} 2241 2242unsigned dm_get_md_type(struct mapped_device *md) 2243{ |
2244 BUG_ON(!mutex_is_locked(&md->type_lock)); |
|
2244 return md->type; 2245} 2246 2247struct target_type *dm_get_immutable_target_type(struct mapped_device *md) 2248{ 2249 return md->immutable_target_type; 2250} 2251 --- 618 unchanged lines hidden --- | 2245 return md->type; 2246} 2247 2248struct target_type *dm_get_immutable_target_type(struct mapped_device *md) 2249{ 2250 return md->immutable_target_type; 2251} 2252 --- 618 unchanged lines hidden --- |