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.
/*
- * 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);