Change the argument name "metadata" to "in_thread" (because it means that the request should be handed over to a thread). Propagate this argument to functions area_io and read_exceptions. This patch has no functional change (there will be zero anyway), but it prepares for cluster re-reading that must be done from a thread. Signed-off-by: Mikulas Patocka --- drivers/md/dm-snap-persistent.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) Index: linux-2.6/drivers/md/dm-snap-persistent.c =================================================================== --- linux-2.6.orig/drivers/md/dm-snap-persistent.c +++ linux-2.6/drivers/md/dm-snap-persistent.c @@ -212,7 +212,7 @@ 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, void *area, chunk_t chunk, int rw, - int metadata) + int in_thread) { struct dm_io_region where = { .bdev = dm_snap_cow(ps->store->snap)->bdev, @@ -228,7 +228,7 @@ static int chunk_io(struct pstore *ps, v }; struct mdata_req req; - if (!metadata) + if (!in_thread) return dm_io(&io_req, 1, &where, NULL); req.where = &where; @@ -257,14 +257,14 @@ static chunk_t area_location(struct psto * Read or write a metadata area. Remembering to skip the first * chunk which holds the header. */ -static int area_io(struct pstore *ps, int rw) +static int area_io(struct pstore *ps, int rw, int in_thread) { int r; chunk_t chunk; chunk = area_location(ps, ps->current_area); - r = chunk_io(ps, ps->area, chunk, rw, 0); + r = chunk_io(ps, ps->area, chunk, rw, in_thread); if (r) return r; @@ -473,7 +473,7 @@ static int insert_exceptions(struct psto static int read_exceptions(struct pstore *ps, int (*callback)(void *callback_context, chunk_t old, chunk_t new), - void *callback_context) + void *callback_context, int in_thread) { int r, full = 1; @@ -482,7 +482,7 @@ static int read_exceptions(struct pstore * we find a partially full area. */ for (; full; ps->current_area++) { - r = area_io(ps, READ); + r = area_io(ps, READ, in_thread); if (r) return r; @@ -611,7 +611,7 @@ static int persistent_read_metadata(stru * Read the metadata. */ if (!will_handover) - r = read_exceptions(ps, callback, callback_context); + r = read_exceptions(ps, callback, callback_context, 0); return r; } @@ -687,7 +687,7 @@ static void persistent_commit_exception( /* * Commit exceptions to disk. */ - if (ps->valid && area_io(ps, WRITE_BARRIER)) + if (ps->valid && area_io(ps, WRITE_BARRIER, 0)) ps->valid = 0; /* @@ -720,7 +720,7 @@ static int persistent_prepare_merge(stru if (!ps->current_area) return 0; ps->current_area--; - r = area_io(ps, READ); + r = area_io(ps, READ, 0); if (r < 0) return r; ps->current_committed = ps->exceptions_per_area; @@ -750,7 +750,7 @@ static int persistent_commit_merge(struc for (i = 0; i < n; i++) clear_exception(ps, ps->current_committed - 1 - i); - r = area_io(ps, WRITE); + r = area_io(ps, WRITE, 0); if (r < 0) return r;