Commit 89c7cd89 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon

dm raid1: rename read_record to bio_record

Rename struct read_record to bio_record in dm-raid1.

In the following patch, the structure will be used for both read and
write bios, so rename it.
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent ddbd658f
...@@ -138,7 +138,7 @@ static void dispatch_bios(void *context, struct bio_list *bio_list) ...@@ -138,7 +138,7 @@ static void dispatch_bios(void *context, struct bio_list *bio_list)
queue_bio(ms, bio, WRITE); queue_bio(ms, bio, WRITE);
} }
struct dm_raid1_read_record { struct dm_raid1_bio_record {
struct mirror *m; struct mirror *m;
struct dm_bio_details details; struct dm_bio_details details;
}; };
...@@ -1072,7 +1072,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) ...@@ -1072,7 +1072,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
ti->num_flush_requests = 1; ti->num_flush_requests = 1;
ti->num_discard_requests = 1; ti->num_discard_requests = 1;
ti->per_bio_data_size = sizeof(struct dm_raid1_read_record); ti->per_bio_data_size = sizeof(struct dm_raid1_bio_record);
ti->discard_zeroes_data_unsupported = true; ti->discard_zeroes_data_unsupported = true;
ms->kmirrord_wq = alloc_workqueue("kmirrord", ms->kmirrord_wq = alloc_workqueue("kmirrord",
...@@ -1146,7 +1146,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio, ...@@ -1146,7 +1146,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio,
int r, rw = bio_rw(bio); int r, rw = bio_rw(bio);
struct mirror *m; struct mirror *m;
struct mirror_set *ms = ti->private; struct mirror_set *ms = ti->private;
struct dm_raid1_read_record *read_record; struct dm_raid1_bio_record *bio_record;
struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh); struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh);
if (rw == WRITE) { if (rw == WRITE) {
...@@ -1179,10 +1179,10 @@ static int mirror_map(struct dm_target *ti, struct bio *bio, ...@@ -1179,10 +1179,10 @@ static int mirror_map(struct dm_target *ti, struct bio *bio,
if (unlikely(!m)) if (unlikely(!m))
return -EIO; return -EIO;
read_record = dm_per_bio_data(bio, sizeof(struct dm_raid1_read_record)); bio_record = dm_per_bio_data(bio, sizeof(struct dm_raid1_bio_record));
dm_bio_record(&read_record->details, bio); dm_bio_record(&bio_record->details, bio);
map_context->ptr = read_record; map_context->ptr = bio_record;
read_record->m = m; bio_record->m = m;
map_bio(m, bio); map_bio(m, bio);
...@@ -1196,7 +1196,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, ...@@ -1196,7 +1196,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
struct mirror_set *ms = (struct mirror_set *) ti->private; struct mirror_set *ms = (struct mirror_set *) ti->private;
struct mirror *m = NULL; struct mirror *m = NULL;
struct dm_bio_details *bd = NULL; struct dm_bio_details *bd = NULL;
struct dm_raid1_read_record *read_record = map_context->ptr; struct dm_raid1_bio_record *bio_record = map_context->ptr;
/* /*
* We need to dec pending if this was a write. * We need to dec pending if this was a write.
...@@ -1214,7 +1214,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, ...@@ -1214,7 +1214,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
goto out; goto out;
if (unlikely(error)) { if (unlikely(error)) {
if (!read_record) { if (!bio_record) {
/* /*
* There wasn't enough memory to record necessary * There wasn't enough memory to record necessary
* information for a retry or there was no other * information for a retry or there was no other
...@@ -1224,7 +1224,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, ...@@ -1224,7 +1224,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
return -EIO; return -EIO;
} }
m = read_record->m; m = bio_record->m;
DMERR("Mirror read failed from %s. Trying alternative device.", DMERR("Mirror read failed from %s. Trying alternative device.",
m->dev->name); m->dev->name);
...@@ -1236,7 +1236,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, ...@@ -1236,7 +1236,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
* mirror. * mirror.
*/ */
if (default_ok(m) || mirror_available(ms, bio)) { if (default_ok(m) || mirror_available(ms, bio)) {
bd = &read_record->details; bd = &bio_record->details;
dm_bio_restore(bd, bio); dm_bio_restore(bd, bio);
map_context->ptr = NULL; map_context->ptr = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment