From: FUJITA Tomonori <[email-masked]>

chunk_io() can perform I/Os only with ps->area. This patch adds a new
argument (a pointer to a buffer) to chunk_io() so that it performs
I/Os with a supplied buffer.

Signed-off-by: FUJITA Tomonori <[email-masked]>
---
 drivers/md/dm-exception-store.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

Index: linux-2.6.28-rc3/drivers/md/dm-exception-store.c
===================================================================
--- linux-2.6.28-rc3.orig/drivers/md/dm-exception-store.c	2008-11-04 14:10:54.000000000 +0000
+++ linux-2.6.28-rc3/drivers/md/dm-exception-store.c	2008-11-07 13:15:32.000000000 +0000
@@ -188,7 +188,8 @@ static void do_metadata(struct work_stru
 /*
  * Read or write a chunk aligned and sized block of data from a device.
  */
-static int chunk_io(struct pstore *ps, chunk_t chunk, int rw, int metadata)
+static int chunk_io(struct pstore *ps, chunk_t chunk, int rw, int metadata,
+		    void *data)
 {
 	struct dm_io_region where = {
 		.bdev = ps->snap->cow->bdev,
@@ -198,7 +199,7 @@ static int chunk_io(struct pstore *ps, c
 	struct dm_io_request io_req = {
 		.bi_rw = rw,
 		.mem.type = DM_IO_VMA,
-		.mem.ptr.vma = ps->area,
+		.mem.ptr.vma = data,
 		.client = ps->io_client,
 		.notify.fn = NULL,
 	};
@@ -240,7 +241,7 @@ static int area_io(struct pstore *ps, in
 
 	chunk = area_location(ps, ps->current_area);
 
-	r = chunk_io(ps, chunk, rw, 0);
+	r = chunk_io(ps, chunk, rw, 0, ps->area);
 	if (r)
 		return r;
 
@@ -297,7 +298,7 @@ static int read_header(struct pstore *ps
 	if (r)
 		return r;
 
-	r = chunk_io(ps, 0, READ, 1);
+	r = chunk_io(ps, 0, READ, 1, ps->area);
 	if (r)
 		goto bad;
 
@@ -359,7 +360,7 @@ static int write_header(struct pstore *p
 	dh->version = cpu_to_le32(ps->version);
 	dh->chunk_size = cpu_to_le32(ps->snap->chunk_size);
 
-	return chunk_io(ps, 0, WRITE, 1);
+	return chunk_io(ps, 0, WRITE, 1, ps->area);
 }
 
 /*