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

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-15-2008, 06:42 AM
FUJITA Tomonori
 
Default dm snapshot: split snapshot_map and sanpshot_end_io

snapshot_map and sanpshot_end_io are useful for shared exception
snapshot but they assume that dm_target:rivate is a pointer to
struct dm_snapshot. This removes that restriction.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/md/dm-snap.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 4f15b5f..fa0e9f7 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1039,11 +1039,10 @@ static void remap_exception(struct dm_snapshot *s, struct dm_snap_exception *e,
(bio->bi_sector & s->chunk_mask);
}

-static int snapshot_map(struct dm_target *ti, struct bio *bio,
- union map_info *map_context)
+static int do_snapshot_map(struct dm_snapshot *s, struct bio *bio,
+ union map_info *map_context)
{
struct dm_snap_exception *e;
- struct dm_snapshot *s = ti->private;
int r = DM_MAPIO_REMAPPED;
chunk_t chunk;
struct dm_snap_pending_exception *pe = NULL;
@@ -1107,18 +1106,32 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
return r;
}

-static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
- int error, union map_info *map_context)
+static int snapshot_map(struct dm_target *ti, struct bio *bio,
+ union map_info *map_context)
{
struct dm_snapshot *s = ti->private;
+
+ return do_snapshot_map(s, bio, map_context);
+}
+
+static int do_snapshot_end_io(struct dm_snapshot *s, struct bio *bio,
+ int error, union map_info *map_context)
+{
struct dm_snap_tracked_chunk *c = map_context->ptr;

if (c)
stop_tracking_chunk(s, c);
-
return 0;
}

+static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
+ int error, union map_info *map_context)
+{
+ struct dm_snapshot *s = ti->private;
+
+ return do_snapshot_end_io(s, bio, error, map_context);
+}
+
static void snapshot_resume(struct dm_target *ti)
{
struct dm_snapshot *s = ti->private;
--
1.5.5.GIT

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 10-27-2008, 11:07 AM
FUJITA Tomonori
 
Default dm snapshot: split snapshot_map and sanpshot_end_io

snapshot_map and sanpshot_end_io are useful for shared exception
snapshot but they assume that dm_target:rivate is a pointer to
struct dm_snapshot. This removes that restriction.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/md/dm-snap.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 7a4d8e1..30071b8 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1034,11 +1034,10 @@ static void remap_exception(struct dm_snapshot *s, struct dm_snap_exception *e,
(bio->bi_sector & s->chunk_mask);
}

-static int snapshot_map(struct dm_target *ti, struct bio *bio,
- union map_info *map_context)
+static int do_snapshot_map(struct dm_snapshot *s, struct bio *bio,
+ union map_info *map_context)
{
struct dm_snap_exception *e;
- struct dm_snapshot *s = ti->private;
int r = DM_MAPIO_REMAPPED;
chunk_t chunk;
struct dm_snap_pending_exception *pe = NULL;
@@ -1102,18 +1101,32 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
return r;
}

-static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
- int error, union map_info *map_context)
+static int snapshot_map(struct dm_target *ti, struct bio *bio,
+ union map_info *map_context)
{
struct dm_snapshot *s = ti->private;
+
+ return do_snapshot_map(s, bio, map_context);
+}
+
+static int do_snapshot_end_io(struct dm_snapshot *s, struct bio *bio,
+ int error, union map_info *map_context)
+{
struct dm_snap_tracked_chunk *c = map_context->ptr;

if (c)
stop_tracking_chunk(s, c);
-
return 0;
}

+static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
+ int error, union map_info *map_context)
+{
+ struct dm_snapshot *s = ti->private;
+
+ return do_snapshot_end_io(s, bio, error, map_context);
+}
+
static void snapshot_resume(struct dm_target *ti)
{
struct dm_snapshot *s = ti->private;
--
1.5.5.GIT

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 11-26-2008, 03:17 PM
FUJITA Tomonori
 
Default dm snapshot: split snapshot_map and sanpshot_end_io

snapshot_map and sanpshot_end_io are useful for shared exception
snapshot but they assume that dm_target:rivate is a pointer to
struct dm_snapshot. This removes that restriction.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/md/dm-snap.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 1abb3a7..270f7b2 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1050,11 +1050,10 @@ static void remap_exception(struct dm_snapshot *s, struct dm_snap_exception *e,
(bio->bi_sector & s->chunk_mask);
}

-static int snapshot_map(struct dm_target *ti, struct bio *bio,
- union map_info *map_context)
+static int do_snapshot_map(struct dm_snapshot *s, struct bio *bio,
+ union map_info *map_context)
{
struct dm_snap_exception *e;
- struct dm_snapshot *s = ti->private;
int r = DM_MAPIO_REMAPPED;
chunk_t chunk;
struct dm_snap_pending_exception *pe = NULL;
@@ -1118,18 +1117,32 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
return r;
}

-static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
- int error, union map_info *map_context)
+static int snapshot_map(struct dm_target *ti, struct bio *bio,
+ union map_info *map_context)
{
struct dm_snapshot *s = ti->private;
+
+ return do_snapshot_map(s, bio, map_context);
+}
+
+static int do_snapshot_end_io(struct dm_snapshot *s, struct bio *bio,
+ int error, union map_info *map_context)
+{
struct dm_snap_tracked_chunk *c = map_context->ptr;

if (c)
stop_tracking_chunk(s, c);
-
return 0;
}

+static int snapshot_end_io(struct dm_target *ti, struct bio *bio,
+ int error, union map_info *map_context)
+{
+ struct dm_snapshot *s = ti->private;
+
+ return do_snapshot_end_io(s, bio, error, map_context);
+}
+
static void snapshot_resume(struct dm_target *ti)
{
struct dm_snapshot *s = ti->private;
--
1.5.5.GIT

--
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 10:55 AM.

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