FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor


 
 
LinkBack Thread Tools
 
Old 07-08-2011, 10:19 PM
Mike Snitzer
 
Default dm: add dm_bdev

From: Joe Thornber <thornber@redhat.com>

Allow targets to access to the block_device associated with a DM
mapped_device. Export dm_disk() and dm_bdev() -- both are required by
the dm-thinp target.

Signed-off-by: Joe Thornber <thornber@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
drivers/md/dm.c | 11 +++++++++--
include/linux/device-mapper.h | 1 +
2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 538144b..99664eb 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2632,13 +2632,20 @@ void dm_uevent_add(struct mapped_device *md, struct list_head *elist)
}

/*
- * The gendisk is only valid as long as you have a reference
- * count on 'md'.
+ * The gendisk or block_device are only valid as long as you
+ * have a reference count on 'md'.
*/
struct gendisk *dm_disk(struct mapped_device *md)
{
return md->disk;
}
+EXPORT_SYMBOL_GPL(dm_disk);
+
+struct block_device *dm_bdev(struct mapped_device *md)
+{
+ return md->bdev;
+}
+EXPORT_SYMBOL_GPL(dm_bdev);

struct kobject *dm_kobject(struct mapped_device *md)
{
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 3fa1f3d..3941602 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -295,6 +295,7 @@ void dm_uevent_add(struct mapped_device *md, struct list_head *elist);
const char *dm_device_name(struct mapped_device *md);
int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid);
struct gendisk *dm_disk(struct mapped_device *md);
+struct block_device *dm_bdev(struct mapped_device *md);
int dm_suspended(struct dm_target *ti);
int dm_noflush_suspending(struct dm_target *ti);
union map_info *dm_get_mapinfo(struct bio *bio);
--
1.7.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 07:50 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org