aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2013-03-01 17:45:47 -0500
committerAlasdair G Kergon <agk@redhat.com>2013-03-01 17:45:47 -0500
commit55a62eef8d1b50ceff3b7bf46851103bdcc7e5b0 (patch)
tree7fb8ce46abe5e6f4a0a2dbcf2d3c848fdbfe4a56 /drivers/md/dm.c
parentbd2a49b86d9aae0c505dcc99c0a073f9da2cc889 (diff)
dm: rename request variables to bios
Use 'bio' in the name of variables and functions that deal with bios rather than 'request' to avoid confusion with the normal block layer use of 'request'. No functional changes. Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 4521d72637c2..caef71befc43 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1103,7 +1103,7 @@ static void clone_bio(struct dm_target_io *tio, struct bio *bio,
1103 1103
1104static struct dm_target_io *alloc_tio(struct clone_info *ci, 1104static struct dm_target_io *alloc_tio(struct clone_info *ci,
1105 struct dm_target *ti, int nr_iovecs, 1105 struct dm_target *ti, int nr_iovecs,
1106 unsigned target_request_nr) 1106 unsigned target_bio_nr)
1107{ 1107{
1108 struct dm_target_io *tio; 1108 struct dm_target_io *tio;
1109 struct bio *clone; 1109 struct bio *clone;
@@ -1114,15 +1114,15 @@ static struct dm_target_io *alloc_tio(struct clone_info *ci,
1114 tio->io = ci->io; 1114 tio->io = ci->io;
1115 tio->ti = ti; 1115 tio->ti = ti;
1116 memset(&tio->info, 0, sizeof(tio->info)); 1116 memset(&tio->info, 0, sizeof(tio->info));
1117 tio->target_request_nr = target_request_nr; 1117 tio->target_bio_nr = target_bio_nr;
1118 1118
1119 return tio; 1119 return tio;
1120} 1120}
1121 1121
1122static void __issue_target_request(struct clone_info *ci, struct dm_target *ti, 1122static void __issue_target_request(struct clone_info *ci, struct dm_target *ti,
1123 unsigned request_nr, sector_t len) 1123 unsigned target_bio_nr, sector_t len)
1124{ 1124{
1125 struct dm_target_io *tio = alloc_tio(ci, ti, ci->bio->bi_max_vecs, request_nr); 1125 struct dm_target_io *tio = alloc_tio(ci, ti, ci->bio->bi_max_vecs, target_bio_nr);
1126 struct bio *clone = &tio->clone; 1126 struct bio *clone = &tio->clone;
1127 1127
1128 /* 1128 /*
@@ -1137,13 +1137,13 @@ static void __issue_target_request(struct clone_info *ci, struct dm_target *ti,
1137 __map_bio(tio); 1137 __map_bio(tio);
1138} 1138}
1139 1139
1140static void __issue_target_requests(struct clone_info *ci, struct dm_target *ti, 1140static void __issue_target_bios(struct clone_info *ci, struct dm_target *ti,
1141 unsigned num_requests, sector_t len) 1141 unsigned num_bios, sector_t len)
1142{ 1142{
1143 unsigned request_nr; 1143 unsigned target_bio_nr;
1144 1144
1145 for (request_nr = 0; request_nr < num_requests; request_nr++) 1145 for (target_bio_nr = 0; target_bio_nr < num_bios; target_bio_nr++)
1146 __issue_target_request(ci, ti, request_nr, len); 1146 __issue_target_request(ci, ti, target_bio_nr, len);
1147} 1147}
1148 1148
1149static int __clone_and_map_empty_flush(struct clone_info *ci) 1149static int __clone_and_map_empty_flush(struct clone_info *ci)
@@ -1153,7 +1153,7 @@ static int __clone_and_map_empty_flush(struct clone_info *ci)
1153 1153
1154 BUG_ON(bio_has_data(ci->bio)); 1154 BUG_ON(bio_has_data(ci->bio));
1155 while ((ti = dm_table_get_target(ci->map, target_nr++))) 1155 while ((ti = dm_table_get_target(ci->map, target_nr++)))
1156 __issue_target_requests(ci, ti, ti->num_flush_requests, 0); 1156 __issue_target_bios(ci, ti, ti->num_flush_bios, 0);
1157 1157
1158 return 0; 1158 return 0;
1159} 1159}
@@ -1173,32 +1173,32 @@ static void __clone_and_map_simple(struct clone_info *ci, struct dm_target *ti)
1173 ci->sector_count = 0; 1173 ci->sector_count = 0;
1174} 1174}
1175 1175
1176typedef unsigned (*get_num_requests_fn)(struct dm_target *ti); 1176typedef unsigned (*get_num_bios_fn)(struct dm_target *ti);
1177 1177
1178static unsigned get_num_discard_requests(struct dm_target *ti) 1178static unsigned get_num_discard_bios(struct dm_target *ti)
1179{ 1179{
1180 return ti->num_discard_requests; 1180 return ti->num_discard_bios;
1181} 1181}
1182 1182
1183static unsigned get_num_write_same_requests(struct dm_target *ti) 1183static unsigned get_num_write_same_bios(struct dm_target *ti)
1184{ 1184{
1185 return ti->num_write_same_requests; 1185 return ti->num_write_same_bios;
1186} 1186}
1187 1187
1188typedef bool (*is_split_required_fn)(struct dm_target *ti); 1188typedef bool (*is_split_required_fn)(struct dm_target *ti);
1189 1189
1190static bool is_split_required_for_discard(struct dm_target *ti) 1190static bool is_split_required_for_discard(struct dm_target *ti)
1191{ 1191{
1192 return ti->split_discard_requests; 1192 return ti->split_discard_bios;
1193} 1193}
1194 1194
1195static int __clone_and_map_changing_extent_only(struct clone_info *ci, 1195static int __clone_and_map_changing_extent_only(struct clone_info *ci,
1196 get_num_requests_fn get_num_requests, 1196 get_num_bios_fn get_num_bios,
1197 is_split_required_fn is_split_required) 1197 is_split_required_fn is_split_required)
1198{ 1198{
1199 struct dm_target *ti; 1199 struct dm_target *ti;
1200 sector_t len; 1200 sector_t len;
1201 unsigned num_requests; 1201 unsigned num_bios;
1202 1202
1203 do { 1203 do {
1204 ti = dm_table_find_target(ci->map, ci->sector); 1204 ti = dm_table_find_target(ci->map, ci->sector);
@@ -1211,8 +1211,8 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
1211 * reconfiguration might also have changed that since the 1211 * reconfiguration might also have changed that since the
1212 * check was performed. 1212 * check was performed.
1213 */ 1213 */
1214 num_requests = get_num_requests ? get_num_requests(ti) : 0; 1214 num_bios = get_num_bios ? get_num_bios(ti) : 0;
1215 if (!num_requests) 1215 if (!num_bios)
1216 return -EOPNOTSUPP; 1216 return -EOPNOTSUPP;
1217 1217
1218 if (is_split_required && !is_split_required(ti)) 1218 if (is_split_required && !is_split_required(ti))
@@ -1220,7 +1220,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
1220 else 1220 else
1221 len = min(ci->sector_count, max_io_len(ci->sector, ti)); 1221 len = min(ci->sector_count, max_io_len(ci->sector, ti));
1222 1222
1223 __issue_target_requests(ci, ti, num_requests, len); 1223 __issue_target_bios(ci, ti, num_bios, len);
1224 1224
1225 ci->sector += len; 1225 ci->sector += len;
1226 } while (ci->sector_count -= len); 1226 } while (ci->sector_count -= len);
@@ -1230,13 +1230,13 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci,
1230 1230
1231static int __clone_and_map_discard(struct clone_info *ci) 1231static int __clone_and_map_discard(struct clone_info *ci)
1232{ 1232{
1233 return __clone_and_map_changing_extent_only(ci, get_num_discard_requests, 1233 return __clone_and_map_changing_extent_only(ci, get_num_discard_bios,
1234 is_split_required_for_discard); 1234 is_split_required_for_discard);
1235} 1235}
1236 1236
1237static int __clone_and_map_write_same(struct clone_info *ci) 1237static int __clone_and_map_write_same(struct clone_info *ci)
1238{ 1238{
1239 return __clone_and_map_changing_extent_only(ci, get_num_write_same_requests, NULL); 1239 return __clone_and_map_changing_extent_only(ci, get_num_write_same_bios, NULL);
1240} 1240}
1241 1241
1242static int __clone_and_map(struct clone_info *ci) 1242static int __clone_and_map(struct clone_info *ci)