aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.ibm.com>2018-06-04 13:07:39 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2018-06-12 09:14:19 -0400
commitc5205f2ff2bec6acf398211aed66b3e6ac44eee6 (patch)
tree8de7981d2baf17dce8452ea267092ab01383ab81
parent5c618c0cf451f1d9746296b0d30c84af1bce3604 (diff)
s390/dasd: move dasd_ccw_req to per request data
Let the block layer allocate per request data to store struct dasd_ccw_req. We still need extra preallocated memory for usage by ccw programs (which vary in length) and for requests which don't originate from the block layer. Link: https://lkml.kernel.org/r/20180530074130.GA6927@infradead.org Signed-off-by: Sebastian Ott <sebott@linux.ibm.com> Reviewed-by: Stefan Haberland <sth@linux.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/block/dasd.c46
-rw-r--r--drivers/s390/block/dasd_diag.c3
-rw-r--r--drivers/s390/block/dasd_eckd.c46
-rw-r--r--drivers/s390/block/dasd_fba.c6
-rw-r--r--drivers/s390/block/dasd_int.h3
5 files changed, 57 insertions, 47 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 790b1fa3fec0..01a1d1dabb43 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1267,35 +1267,37 @@ struct dasd_ccw_req *dasd_kmalloc_request(int magic, int cplength,
1267} 1267}
1268EXPORT_SYMBOL(dasd_kmalloc_request); 1268EXPORT_SYMBOL(dasd_kmalloc_request);
1269 1269
1270struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, 1270struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, int datasize,
1271 int datasize, 1271 struct dasd_device *device,
1272 struct dasd_device *device) 1272 struct dasd_ccw_req *cqr)
1273{ 1273{
1274 unsigned long flags; 1274 unsigned long flags;
1275 struct dasd_ccw_req *cqr; 1275 char *data, *chunk;
1276 char *data; 1276 int size = 0;
1277 int size;
1278 1277
1279 size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
1280 if (cplength > 0) 1278 if (cplength > 0)
1281 size += cplength * sizeof(struct ccw1); 1279 size += cplength * sizeof(struct ccw1);
1282 if (datasize > 0) 1280 if (datasize > 0)
1283 size += datasize; 1281 size += datasize;
1282 if (!cqr)
1283 size += (sizeof(*cqr) + 7L) & -8L;
1284
1284 spin_lock_irqsave(&device->mem_lock, flags); 1285 spin_lock_irqsave(&device->mem_lock, flags);
1285 cqr = (struct dasd_ccw_req *) 1286 data = chunk = dasd_alloc_chunk(&device->ccw_chunks, size);
1286 dasd_alloc_chunk(&device->ccw_chunks, size);
1287 spin_unlock_irqrestore(&device->mem_lock, flags); 1287 spin_unlock_irqrestore(&device->mem_lock, flags);
1288 if (cqr == NULL) 1288 if (!chunk)
1289 return ERR_PTR(-ENOMEM); 1289 return ERR_PTR(-ENOMEM);
1290 memset(cqr, 0, sizeof(struct dasd_ccw_req)); 1290 if (!cqr) {
1291 data = (char *) cqr + ((sizeof(struct dasd_ccw_req) + 7L) & -8L); 1291 cqr = (void *) data;
1292 cqr->cpaddr = NULL; 1292 data += (sizeof(*cqr) + 7L) & -8L;
1293 }
1294 memset(cqr, 0, sizeof(*cqr));
1295 cqr->mem_chunk = chunk;
1293 if (cplength > 0) { 1296 if (cplength > 0) {
1294 cqr->cpaddr = (struct ccw1 *) data; 1297 cqr->cpaddr = data;
1295 data += cplength*sizeof(struct ccw1); 1298 data += cplength * sizeof(struct ccw1);
1296 memset(cqr->cpaddr, 0, cplength*sizeof(struct ccw1)); 1299 memset(cqr->cpaddr, 0, cplength * sizeof(struct ccw1));
1297 } 1300 }
1298 cqr->data = NULL;
1299 if (datasize > 0) { 1301 if (datasize > 0) {
1300 cqr->data = data; 1302 cqr->data = data;
1301 memset(cqr->data, 0, datasize); 1303 memset(cqr->data, 0, datasize);
@@ -1333,7 +1335,7 @@ void dasd_sfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device)
1333 unsigned long flags; 1335 unsigned long flags;
1334 1336
1335 spin_lock_irqsave(&device->mem_lock, flags); 1337 spin_lock_irqsave(&device->mem_lock, flags);
1336 dasd_free_chunk(&device->ccw_chunks, cqr); 1338 dasd_free_chunk(&device->ccw_chunks, cqr->mem_chunk);
1337 spin_unlock_irqrestore(&device->mem_lock, flags); 1339 spin_unlock_irqrestore(&device->mem_lock, flags);
1338 dasd_put_device(device); 1340 dasd_put_device(device);
1339} 1341}
@@ -3046,7 +3048,6 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx,
3046 cqr->callback_data = req; 3048 cqr->callback_data = req;
3047 cqr->status = DASD_CQR_FILLED; 3049 cqr->status = DASD_CQR_FILLED;
3048 cqr->dq = dq; 3050 cqr->dq = dq;
3049 *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)) = cqr;
3050 3051
3051 blk_mq_start_request(req); 3052 blk_mq_start_request(req);
3052 spin_lock(&block->queue_lock); 3053 spin_lock(&block->queue_lock);
@@ -3077,7 +3078,7 @@ enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved)
3077 unsigned long flags; 3078 unsigned long flags;
3078 int rc = 0; 3079 int rc = 0;
3079 3080
3080 cqr = *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)); 3081 cqr = blk_mq_rq_to_pdu(req);
3081 if (!cqr) 3082 if (!cqr)
3082 return BLK_EH_DONE; 3083 return BLK_EH_DONE;
3083 3084
@@ -3179,7 +3180,7 @@ static int dasd_alloc_queue(struct dasd_block *block)
3179 int rc; 3180 int rc;
3180 3181
3181 block->tag_set.ops = &dasd_mq_ops; 3182 block->tag_set.ops = &dasd_mq_ops;
3182 block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *); 3183 block->tag_set.cmd_size = sizeof(struct dasd_ccw_req);
3183 block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES; 3184 block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
3184 block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV; 3185 block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
3185 block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE; 3186 block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
@@ -4043,7 +4044,8 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
4043 struct ccw1 *ccw; 4044 struct ccw1 *ccw;
4044 unsigned long *idaw; 4045 unsigned long *idaw;
4045 4046
4046 cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device); 4047 cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device,
4048 NULL);
4047 4049
4048 if (IS_ERR(cqr)) { 4050 if (IS_ERR(cqr)) {
4049 /* internal error 13 - Allocating the RDC request failed*/ 4051 /* internal error 13 - Allocating the RDC request failed*/
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 131f1989f6f3..e1fe02477ea8 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -536,7 +536,8 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev,
536 /* Build the request */ 536 /* Build the request */
537 datasize = sizeof(struct dasd_diag_req) + 537 datasize = sizeof(struct dasd_diag_req) +
538 count*sizeof(struct dasd_diag_bio); 538 count*sizeof(struct dasd_diag_bio);
539 cqr = dasd_smalloc_request(DASD_DIAG_MAGIC, 0, datasize, memdev); 539 cqr = dasd_smalloc_request(DASD_DIAG_MAGIC, 0, datasize, memdev,
540 blk_mq_rq_to_pdu(req));
540 if (IS_ERR(cqr)) 541 if (IS_ERR(cqr))
541 return cqr; 542 return cqr;
542 543
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index be208e7adcb4..bbf95b78ef5d 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -886,7 +886,7 @@ static int dasd_eckd_read_conf_lpm(struct dasd_device *device,
886 } 886 }
887 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* RCD */, 887 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* RCD */,
888 0, /* use rcd_buf as data ara */ 888 0, /* use rcd_buf as data ara */
889 device); 889 device, NULL);
890 if (IS_ERR(cqr)) { 890 if (IS_ERR(cqr)) {
891 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 891 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
892 "Could not allocate RCD request"); 892 "Could not allocate RCD request");
@@ -1442,7 +1442,7 @@ static int dasd_eckd_read_features(struct dasd_device *device)
1442 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, 1442 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
1443 (sizeof(struct dasd_psf_prssd_data) + 1443 (sizeof(struct dasd_psf_prssd_data) +
1444 sizeof(struct dasd_rssd_features)), 1444 sizeof(struct dasd_rssd_features)),
1445 device); 1445 device, NULL);
1446 if (IS_ERR(cqr)) { 1446 if (IS_ERR(cqr)) {
1447 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", "Could not " 1447 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", "Could not "
1448 "allocate initialization request"); 1448 "allocate initialization request");
@@ -1504,7 +1504,7 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device,
1504 1504
1505 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ , 1505 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ ,
1506 sizeof(struct dasd_psf_ssc_data), 1506 sizeof(struct dasd_psf_ssc_data),
1507 device); 1507 device, NULL);
1508 1508
1509 if (IS_ERR(cqr)) { 1509 if (IS_ERR(cqr)) {
1510 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 1510 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
@@ -1815,7 +1815,8 @@ dasd_eckd_analysis_ccw(struct dasd_device *device)
1815 1815
1816 cplength = 8; 1816 cplength = 8;
1817 datasize = sizeof(struct DE_eckd_data) + 2*sizeof(struct LO_eckd_data); 1817 datasize = sizeof(struct DE_eckd_data) + 2*sizeof(struct LO_eckd_data);
1818 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device); 1818 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device,
1819 NULL);
1819 if (IS_ERR(cqr)) 1820 if (IS_ERR(cqr))
1820 return cqr; 1821 return cqr;
1821 ccw = cqr->cpaddr; 1822 ccw = cqr->cpaddr;
@@ -2092,7 +2093,8 @@ dasd_eckd_build_check_tcw(struct dasd_device *base, struct format_data_t *fdata,
2092 */ 2093 */
2093 itcw_size = itcw_calc_size(0, count, 0); 2094 itcw_size = itcw_calc_size(0, count, 0);
2094 2095
2095 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev); 2096 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev,
2097 NULL);
2096 if (IS_ERR(cqr)) 2098 if (IS_ERR(cqr))
2097 return cqr; 2099 return cqr;
2098 2100
@@ -2186,7 +2188,7 @@ dasd_eckd_build_check(struct dasd_device *base, struct format_data_t *fdata,
2186 cplength += count; 2188 cplength += count;
2187 2189
2188 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, 2190 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize,
2189 startdev); 2191 startdev, NULL);
2190 if (IS_ERR(cqr)) 2192 if (IS_ERR(cqr))
2191 return cqr; 2193 return cqr;
2192 2194
@@ -2332,7 +2334,7 @@ dasd_eckd_build_format(struct dasd_device *base,
2332 } 2334 }
2333 /* Allocate the format ccw request. */ 2335 /* Allocate the format ccw request. */
2334 fcp = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, 2336 fcp = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength,
2335 datasize, startdev); 2337 datasize, startdev, NULL);
2336 if (IS_ERR(fcp)) 2338 if (IS_ERR(fcp))
2337 return fcp; 2339 return fcp;
2338 2340
@@ -3103,7 +3105,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_single(
3103 } 3105 }
3104 /* Allocate the ccw request. */ 3106 /* Allocate the ccw request. */
3105 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, 3107 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize,
3106 startdev); 3108 startdev, blk_mq_rq_to_pdu(req));
3107 if (IS_ERR(cqr)) 3109 if (IS_ERR(cqr))
3108 return cqr; 3110 return cqr;
3109 ccw = cqr->cpaddr; 3111 ccw = cqr->cpaddr;
@@ -3262,7 +3264,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_track(
3262 3264
3263 /* Allocate the ccw request. */ 3265 /* Allocate the ccw request. */
3264 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, 3266 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize,
3265 startdev); 3267 startdev, blk_mq_rq_to_pdu(req));
3266 if (IS_ERR(cqr)) 3268 if (IS_ERR(cqr))
3267 return cqr; 3269 return cqr;
3268 ccw = cqr->cpaddr; 3270 ccw = cqr->cpaddr;
@@ -3595,7 +3597,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track(
3595 3597
3596 /* Allocate the ccw request. */ 3598 /* Allocate the ccw request. */
3597 itcw_size = itcw_calc_size(0, ctidaw, 0); 3599 itcw_size = itcw_calc_size(0, ctidaw, 0);
3598 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev); 3600 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev,
3601 blk_mq_rq_to_pdu(req));
3599 if (IS_ERR(cqr)) 3602 if (IS_ERR(cqr))
3600 return cqr; 3603 return cqr;
3601 3604
@@ -3862,7 +3865,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev,
3862 3865
3863 /* Allocate the ccw request. */ 3866 /* Allocate the ccw request. */
3864 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, 3867 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength,
3865 datasize, startdev); 3868 datasize, startdev, blk_mq_rq_to_pdu(req));
3866 if (IS_ERR(cqr)) 3869 if (IS_ERR(cqr))
3867 return cqr; 3870 return cqr;
3868 3871
@@ -4102,7 +4105,7 @@ dasd_eckd_release(struct dasd_device *device)
4102 return -EACCES; 4105 return -EACCES;
4103 4106
4104 useglobal = 0; 4107 useglobal = 0;
4105 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device); 4108 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL);
4106 if (IS_ERR(cqr)) { 4109 if (IS_ERR(cqr)) {
4107 mutex_lock(&dasd_reserve_mutex); 4110 mutex_lock(&dasd_reserve_mutex);
4108 useglobal = 1; 4111 useglobal = 1;
@@ -4157,7 +4160,7 @@ dasd_eckd_reserve(struct dasd_device *device)
4157 return -EACCES; 4160 return -EACCES;
4158 4161
4159 useglobal = 0; 4162 useglobal = 0;
4160 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device); 4163 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL);
4161 if (IS_ERR(cqr)) { 4164 if (IS_ERR(cqr)) {
4162 mutex_lock(&dasd_reserve_mutex); 4165 mutex_lock(&dasd_reserve_mutex);
4163 useglobal = 1; 4166 useglobal = 1;
@@ -4211,7 +4214,7 @@ dasd_eckd_steal_lock(struct dasd_device *device)
4211 return -EACCES; 4214 return -EACCES;
4212 4215
4213 useglobal = 0; 4216 useglobal = 0;
4214 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device); 4217 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL);
4215 if (IS_ERR(cqr)) { 4218 if (IS_ERR(cqr)) {
4216 mutex_lock(&dasd_reserve_mutex); 4219 mutex_lock(&dasd_reserve_mutex);
4217 useglobal = 1; 4220 useglobal = 1;
@@ -4271,7 +4274,8 @@ static int dasd_eckd_snid(struct dasd_device *device,
4271 4274
4272 useglobal = 0; 4275 useglobal = 0;
4273 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 4276 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1,
4274 sizeof(struct dasd_snid_data), device); 4277 sizeof(struct dasd_snid_data), device,
4278 NULL);
4275 if (IS_ERR(cqr)) { 4279 if (IS_ERR(cqr)) {
4276 mutex_lock(&dasd_reserve_mutex); 4280 mutex_lock(&dasd_reserve_mutex);
4277 useglobal = 1; 4281 useglobal = 1;
@@ -4331,7 +4335,7 @@ dasd_eckd_performance(struct dasd_device *device, void __user *argp)
4331 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, 4335 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
4332 (sizeof(struct dasd_psf_prssd_data) + 4336 (sizeof(struct dasd_psf_prssd_data) +
4333 sizeof(struct dasd_rssd_perf_stats_t)), 4337 sizeof(struct dasd_rssd_perf_stats_t)),
4334 device); 4338 device, NULL);
4335 if (IS_ERR(cqr)) { 4339 if (IS_ERR(cqr)) {
4336 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 4340 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
4337 "Could not allocate initialization request"); 4341 "Could not allocate initialization request");
@@ -4477,7 +4481,7 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp)
4477 psf1 = psf_data[1]; 4481 psf1 = psf_data[1];
4478 4482
4479 /* setup CCWs for PSF + RSSD */ 4483 /* setup CCWs for PSF + RSSD */
4480 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 2 , 0, device); 4484 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 2, 0, device, NULL);
4481 if (IS_ERR(cqr)) { 4485 if (IS_ERR(cqr)) {
4482 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 4486 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
4483 "Could not allocate initialization request"); 4487 "Could not allocate initialization request");
@@ -5037,7 +5041,7 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device,
5037 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, 5041 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
5038 (sizeof(struct dasd_psf_prssd_data) + 5042 (sizeof(struct dasd_psf_prssd_data) +
5039 sizeof(struct dasd_rssd_messages)), 5043 sizeof(struct dasd_rssd_messages)),
5040 device); 5044 device, NULL);
5041 if (IS_ERR(cqr)) { 5045 if (IS_ERR(cqr)) {
5042 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", 5046 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s",
5043 "Could not allocate read message buffer request"); 5047 "Could not allocate read message buffer request");
@@ -5126,7 +5130,7 @@ static int dasd_eckd_query_host_access(struct dasd_device *device,
5126 5130
5127 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */, 5131 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
5128 sizeof(struct dasd_psf_prssd_data) + 1, 5132 sizeof(struct dasd_psf_prssd_data) + 1,
5129 device); 5133 device, NULL);
5130 if (IS_ERR(cqr)) { 5134 if (IS_ERR(cqr)) {
5131 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", 5135 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s",
5132 "Could not allocate read message buffer request"); 5136 "Could not allocate read message buffer request");
@@ -5284,8 +5288,8 @@ dasd_eckd_psf_cuir_response(struct dasd_device *device, int response,
5284 int rc; 5288 int rc;
5285 5289
5286 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ , 5290 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ ,
5287 sizeof(struct dasd_psf_cuir_response), 5291 sizeof(struct dasd_psf_cuir_response),
5288 device); 5292 device, NULL);
5289 5293
5290 if (IS_ERR(cqr)) { 5294 if (IS_ERR(cqr)) {
5291 DBF_DEV_EVENT(DBF_WARNING, device, "%s", 5295 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
index a6b132f7e869..56007a3e7f11 100644
--- a/drivers/s390/block/dasd_fba.c
+++ b/drivers/s390/block/dasd_fba.c
@@ -356,7 +356,8 @@ static struct dasd_ccw_req *dasd_fba_build_cp_discard(
356 datasize = sizeof(struct DE_fba_data) + 356 datasize = sizeof(struct DE_fba_data) +
357 nr_ccws * (sizeof(struct LO_fba_data) + sizeof(struct ccw1)); 357 nr_ccws * (sizeof(struct LO_fba_data) + sizeof(struct ccw1));
358 358
359 cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev); 359 cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev,
360 blk_mq_rq_to_pdu(req));
360 if (IS_ERR(cqr)) 361 if (IS_ERR(cqr))
361 return cqr; 362 return cqr;
362 363
@@ -490,7 +491,8 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular(
490 datasize += (count - 1)*sizeof(struct LO_fba_data); 491 datasize += (count - 1)*sizeof(struct LO_fba_data);
491 } 492 }
492 /* Allocate the ccw request. */ 493 /* Allocate the ccw request. */
493 cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev); 494 cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev,
495 blk_mq_rq_to_pdu(req));
494 if (IS_ERR(cqr)) 496 if (IS_ERR(cqr))
495 return cqr; 497 return cqr;
496 ccw = cqr->cpaddr; 498 ccw = cqr->cpaddr;
diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h
index 96709b1a7bf8..0844e5e2f566 100644
--- a/drivers/s390/block/dasd_int.h
+++ b/drivers/s390/block/dasd_int.h
@@ -184,6 +184,7 @@ struct dasd_ccw_req {
184 struct irb irb; /* device status in case of an error */ 184 struct irb irb; /* device status in case of an error */
185 struct dasd_ccw_req *refers; /* ERP-chain queueing. */ 185 struct dasd_ccw_req *refers; /* ERP-chain queueing. */
186 void *function; /* originating ERP action */ 186 void *function; /* originating ERP action */
187 void *mem_chunk;
187 188
188 /* these are for statistics only */ 189 /* these are for statistics only */
189 unsigned long buildclk; /* TOD-clock of request generation */ 190 unsigned long buildclk; /* TOD-clock of request generation */
@@ -716,7 +717,7 @@ extern struct kmem_cache *dasd_page_cache;
716struct dasd_ccw_req * 717struct dasd_ccw_req *
717dasd_kmalloc_request(int , int, int, struct dasd_device *); 718dasd_kmalloc_request(int , int, int, struct dasd_device *);
718struct dasd_ccw_req * 719struct dasd_ccw_req *
719dasd_smalloc_request(int , int, int, struct dasd_device *); 720dasd_smalloc_request(int, int, int, struct dasd_device *, struct dasd_ccw_req *);
720void dasd_kfree_request(struct dasd_ccw_req *, struct dasd_device *); 721void dasd_kfree_request(struct dasd_ccw_req *, struct dasd_device *);
721void dasd_sfree_request(struct dasd_ccw_req *, struct dasd_device *); 722void dasd_sfree_request(struct dasd_ccw_req *, struct dasd_device *);
722void dasd_wakeup_cb(struct dasd_ccw_req *, void *); 723void dasd_wakeup_cb(struct dasd_ccw_req *, void *);