[dm-devel] [PATCH 3/4] Add dm_snap_origin function
Mikulas Patocka
mpatocka at redhat.com
Mon Mar 15 06:01:23 UTC 2010
Add dm_snap_origin function
Add function dm_snap_origin, it will be used for checking chunk size against
origin sector size.
Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>
---
drivers/md/dm-exception-store.h | 3 ++-
drivers/md/dm-snap.c | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
Index: linux-2.6.34-rc1-devel/drivers/md/dm-exception-store.h
===================================================================
--- linux-2.6.34-rc1-devel.orig/drivers/md/dm-exception-store.h 2010-03-12 14:41:37.000000000 +0100
+++ linux-2.6.34-rc1-devel/drivers/md/dm-exception-store.h 2010-03-12 14:42:11.000000000 +0100
@@ -126,8 +126,9 @@ struct dm_exception_store {
};
/*
- * Obtain the cow device used by a given snapshot.
+ * Obtain the origin and cow device used by a given snapshot.
*/
+struct dm_dev *dm_snap_origin(struct dm_snapshot *snap);
struct dm_dev *dm_snap_cow(struct dm_snapshot *snap);
/*
Index: linux-2.6.34-rc1-devel/drivers/md/dm-snap.c
===================================================================
--- linux-2.6.34-rc1-devel.orig/drivers/md/dm-snap.c 2010-03-12 14:41:20.000000000 +0100
+++ linux-2.6.34-rc1-devel/drivers/md/dm-snap.c 2010-03-12 14:42:37.000000000 +0100
@@ -148,6 +148,12 @@ struct dm_snapshot {
#define RUNNING_MERGE 0
#define SHUTDOWN_MERGE 1
+struct dm_dev *dm_snap_origin(struct dm_snapshot *s)
+{
+ return s->origin;
+}
+EXPORT_SYMBOL(dm_snap_origin);
+
struct dm_dev *dm_snap_cow(struct dm_snapshot *s)
{
return s->cow;
More information about the dm-devel
mailing list