Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: remove unnecessary argument from blk_execute_rq

We can remove 'q' from blk_execute_rq as well after the previous change
in blk_execute_rq_nowait.

And more importantly it never really was needed to start with given
that we can trivial derive it from struct request.

Cc: linux-scsi@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org
Cc: linux-ide@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
Cc: linux-nfs@vger.kernel.org
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # for mmc
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Guoqing Jiang and committed by
Jens Axboe
684da762 8eeed0b5

+33 -35
+1 -2
block/blk-exec.c
··· 74 74 * Insert a fully prepared request at the back of the I/O scheduler queue 75 75 * for execution and wait for completion. 76 76 */ 77 - void blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk, 78 - struct request *rq, int at_head) 77 + void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head) 79 78 { 80 79 DECLARE_COMPLETION_ONSTACK(wait); 81 80 unsigned long hang_check;
+1 -1
block/bsg.c
··· 183 183 184 184 bio = rq->bio; 185 185 186 - blk_execute_rq(q, NULL, rq, !(hdr.flags & BSG_FLAG_Q_AT_TAIL)); 186 + blk_execute_rq(NULL, rq, !(hdr.flags & BSG_FLAG_Q_AT_TAIL)); 187 187 ret = rq->q->bsg_dev.ops->complete_rq(rq, &hdr); 188 188 blk_rq_unmap_user(bio); 189 189
+3 -3
block/scsi_ioctl.c
··· 357 357 * (if he doesn't check that is his problem). 358 358 * N.B. a non-zero SCSI status is _not_ necessarily an error. 359 359 */ 360 - blk_execute_rq(q, bd_disk, rq, at_head); 360 + blk_execute_rq(bd_disk, rq, at_head); 361 361 362 362 hdr->duration = jiffies_to_msecs(jiffies - start_time); 363 363 ··· 493 493 goto error; 494 494 } 495 495 496 - blk_execute_rq(q, disk, rq, 0); 496 + blk_execute_rq(disk, rq, 0); 497 497 498 498 err = req->result & 0xff; /* only 8 bit SCSI status */ 499 499 if (err) { ··· 532 532 scsi_req(rq)->cmd[0] = cmd; 533 533 scsi_req(rq)->cmd[4] = data; 534 534 scsi_req(rq)->cmd_len = 6; 535 - blk_execute_rq(q, bd_disk, rq, 0); 535 + blk_execute_rq(bd_disk, rq, 0); 536 536 err = scsi_req(rq)->result ? -EIO : 0; 537 537 blk_put_request(rq); 538 538
+1 -1
drivers/block/mtip32xx/mtip32xx.c
··· 1015 1015 rq->timeout = timeout; 1016 1016 1017 1017 /* insert request and run queue */ 1018 - blk_execute_rq(rq->q, NULL, rq, true); 1018 + blk_execute_rq(NULL, rq, true); 1019 1019 1020 1020 if (int_cmd->status) { 1021 1021 dev_err(&dd->pdev->dev, "Internal command [%02X] failed %d\n",
+1 -1
drivers/block/paride/pd.c
··· 781 781 req = blk_mq_rq_to_pdu(rq); 782 782 783 783 req->func = func; 784 - blk_execute_rq(disk->gd->queue, disk->gd, rq, 0); 784 + blk_execute_rq(disk->gd, rq, 0); 785 785 blk_put_request(rq); 786 786 return 0; 787 787 }
+1 -1
drivers/block/pktcdvd.c
··· 722 722 if (cgc->quiet) 723 723 rq->rq_flags |= RQF_QUIET; 724 724 725 - blk_execute_rq(rq->q, pd->bdev->bd_disk, rq, 0); 725 + blk_execute_rq(pd->bdev->bd_disk, rq, 0); 726 726 if (scsi_req(rq)->result) 727 727 ret = -EIO; 728 728 out:
+1 -1
drivers/block/virtio_blk.c
··· 320 320 if (err) 321 321 goto out; 322 322 323 - blk_execute_rq(vblk->disk->queue, vblk->disk, req, false); 323 + blk_execute_rq(vblk->disk, req, false); 324 324 err = blk_status_to_errno(virtblk_result(blk_mq_rq_to_pdu(req))); 325 325 out: 326 326 blk_put_request(req);
+1 -1
drivers/cdrom/cdrom.c
··· 2214 2214 rq->timeout = 60 * HZ; 2215 2215 bio = rq->bio; 2216 2216 2217 - blk_execute_rq(q, cdi->disk, rq, 0); 2217 + blk_execute_rq(cdi->disk, rq, 0); 2218 2218 if (scsi_req(rq)->result) { 2219 2219 struct scsi_sense_hdr sshdr; 2220 2220
+1 -1
drivers/ide/ide-atapi.c
··· 107 107 memcpy(scsi_req(rq)->cmd, pc->c, 12); 108 108 if (drive->media == ide_tape) 109 109 scsi_req(rq)->cmd[13] = REQ_IDETAPE_PC1; 110 - blk_execute_rq(drive->queue, disk, rq, 0); 110 + blk_execute_rq(disk, rq, 0); 111 111 error = scsi_req(rq)->result ? -EIO : 0; 112 112 put_req: 113 113 blk_put_request(rq);
+1 -1
drivers/ide/ide-cd.c
··· 467 467 } 468 468 } 469 469 470 - blk_execute_rq(drive->queue, info->disk, rq, 0); 470 + blk_execute_rq(info->disk, rq, 0); 471 471 error = scsi_req(rq)->result ? -EIO : 0; 472 472 473 473 if (buffer)
+1 -1
drivers/ide/ide-cd_ioctl.c
··· 299 299 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 300 300 ide_req(rq)->type = ATA_PRIV_MISC; 301 301 rq->rq_flags = RQF_QUIET; 302 - blk_execute_rq(drive->queue, cd->disk, rq, 0); 302 + blk_execute_rq(cd->disk, rq, 0); 303 303 ret = scsi_req(rq)->result ? -EIO : 0; 304 304 blk_put_request(rq); 305 305 /*
+1 -1
drivers/ide/ide-devsets.c
··· 173 173 *(int *)&scsi_req(rq)->cmd[1] = arg; 174 174 ide_req(rq)->special = setting->set; 175 175 176 - blk_execute_rq(q, NULL, rq, 0); 176 + blk_execute_rq(NULL, rq, 0); 177 177 ret = scsi_req(rq)->result; 178 178 blk_put_request(rq); 179 179
+1 -1
drivers/ide/ide-disk.c
··· 482 482 483 483 drive->mult_req = arg; 484 484 drive->special_flags |= IDE_SFLAG_SET_MULTMODE; 485 - blk_execute_rq(drive->queue, NULL, rq, 0); 485 + blk_execute_rq(NULL, rq, 0); 486 486 blk_put_request(rq); 487 487 488 488 return (drive->mult_count == arg) ? 0 : -EIO;
+2 -2
drivers/ide/ide-ioctls.c
··· 137 137 138 138 rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 139 139 ide_req(rq)->type = ATA_PRIV_TASKFILE; 140 - blk_execute_rq(drive->queue, NULL, rq, 0); 140 + blk_execute_rq(NULL, rq, 0); 141 141 err = scsi_req(rq)->result ? -EIO : 0; 142 142 blk_put_request(rq); 143 143 ··· 235 235 ide_req(rq)->type = ATA_PRIV_MISC; 236 236 scsi_req(rq)->cmd_len = 1; 237 237 scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET; 238 - blk_execute_rq(drive->queue, NULL, rq, 1); 238 + blk_execute_rq(NULL, rq, 1); 239 239 ret = scsi_req(rq)->result; 240 240 blk_put_request(rq); 241 241 return ret;
+1 -1
drivers/ide/ide-park.c
··· 37 37 scsi_req(rq)->cmd_len = 1; 38 38 ide_req(rq)->type = ATA_PRIV_MISC; 39 39 ide_req(rq)->special = &timeout; 40 - blk_execute_rq(q, NULL, rq, 1); 40 + blk_execute_rq(NULL, rq, 1); 41 41 rc = scsi_req(rq)->result ? -EIO : 0; 42 42 blk_put_request(rq); 43 43 if (rc)
+2 -2
drivers/ide/ide-pm.c
··· 27 27 mesg.event = PM_EVENT_FREEZE; 28 28 rqpm.pm_state = mesg.event; 29 29 30 - blk_execute_rq(drive->queue, NULL, rq, 0); 30 + blk_execute_rq(NULL, rq, 0); 31 31 ret = scsi_req(rq)->result ? -EIO : 0; 32 32 blk_put_request(rq); 33 33 ··· 50 50 blk_mq_end_request(rq, BLK_STS_OK); 51 51 return -ENXIO; 52 52 } 53 - blk_execute_rq(q, NULL, rq, true); 53 + blk_execute_rq(NULL, rq, true); 54 54 55 55 return scsi_req(rq)->result ? -EIO : 0; 56 56 }
+1 -1
drivers/ide/ide-tape.c
··· 868 868 goto out_put; 869 869 } 870 870 871 - blk_execute_rq(drive->queue, tape->disk, rq, 0); 871 + blk_execute_rq(tape->disk, rq, 0); 872 872 873 873 /* calculate the number of transferred bytes and update buffer state */ 874 874 size -= scsi_req(rq)->resid_len;
+1 -1
drivers/ide/ide-taskfile.c
··· 443 443 ide_req(rq)->special = cmd; 444 444 cmd->rq = rq; 445 445 446 - blk_execute_rq(drive->queue, NULL, rq, 0); 446 + blk_execute_rq(NULL, rq, 0); 447 447 error = scsi_req(rq)->result ? -EIO : 0; 448 448 put_req: 449 449 blk_put_request(rq);
+5 -5
drivers/mmc/core/block.c
··· 253 253 goto out_put; 254 254 } 255 255 req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_BOOT_WP; 256 - blk_execute_rq(mq->queue, NULL, req, 0); 256 + blk_execute_rq(NULL, req, 0); 257 257 ret = req_to_mmc_queue_req(req)->drv_op_result; 258 258 blk_put_request(req); 259 259 ··· 629 629 rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL; 630 630 req_to_mmc_queue_req(req)->drv_op_data = idatas; 631 631 req_to_mmc_queue_req(req)->ioc_count = 1; 632 - blk_execute_rq(mq->queue, NULL, req, 0); 632 + blk_execute_rq(NULL, req, 0); 633 633 ioc_err = req_to_mmc_queue_req(req)->drv_op_result; 634 634 err = mmc_blk_ioctl_copy_to_user(ic_ptr, idata); 635 635 blk_put_request(req); ··· 698 698 rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL; 699 699 req_to_mmc_queue_req(req)->drv_op_data = idata; 700 700 req_to_mmc_queue_req(req)->ioc_count = num_of_cmds; 701 - blk_execute_rq(mq->queue, NULL, req, 0); 701 + blk_execute_rq(NULL, req, 0); 702 702 ioc_err = req_to_mmc_queue_req(req)->drv_op_result; 703 703 704 704 /* copy to user if data and response */ ··· 2722 2722 if (IS_ERR(req)) 2723 2723 return PTR_ERR(req); 2724 2724 req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_CARD_STATUS; 2725 - blk_execute_rq(mq->queue, NULL, req, 0); 2725 + blk_execute_rq(NULL, req, 0); 2726 2726 ret = req_to_mmc_queue_req(req)->drv_op_result; 2727 2727 if (ret >= 0) { 2728 2728 *val = ret; ··· 2761 2761 } 2762 2762 req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_EXT_CSD; 2763 2763 req_to_mmc_queue_req(req)->drv_op_data = &ext_csd; 2764 - blk_execute_rq(mq->queue, NULL, req, 0); 2764 + blk_execute_rq(NULL, req, 0); 2765 2765 err = req_to_mmc_queue_req(req)->drv_op_result; 2766 2766 blk_put_request(req); 2767 2767 if (err) {
+2 -2
drivers/nvme/host/core.c
··· 964 964 if (poll) 965 965 nvme_execute_rq_polled(req->q, NULL, req, at_head); 966 966 else 967 - blk_execute_rq(req->q, NULL, req, at_head); 967 + blk_execute_rq(NULL, req, at_head); 968 968 if (result) 969 969 *result = nvme_req(req)->result; 970 970 if (nvme_req(req)->flags & NVME_REQ_CANCELLED) ··· 1101 1101 u32 effects; 1102 1102 1103 1103 effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode); 1104 - blk_execute_rq(rq->q, disk, rq, 0); 1104 + blk_execute_rq(disk, rq, 0); 1105 1105 nvme_passthru_end(ctrl, effects); 1106 1106 } 1107 1107 EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);
+1 -1
drivers/nvme/host/lightnvm.c
··· 819 819 bio->bi_bdev = ns->disk->part0; 820 820 } 821 821 822 - blk_execute_rq(q, NULL, rq, 0); 822 + blk_execute_rq(NULL, rq, 0); 823 823 824 824 if (nvme_req(rq)->flags & NVME_REQ_CANCELLED) 825 825 ret = -EINTR;
+1 -1
drivers/scsi/scsi_lib.c
··· 269 269 /* 270 270 * head injection *required* here otherwise quiesce won't work 271 271 */ 272 - blk_execute_rq(req->q, NULL, req, 1); 272 + blk_execute_rq(NULL, req, 1); 273 273 274 274 /* 275 275 * Some devices (USB mass-storage in particular) may transfer
+1 -1
fs/nfsd/blocklayout.c
··· 254 254 req->cmd[4] = bufflen & 0xff; 255 255 req->cmd_len = COMMAND_SIZE(INQUIRY); 256 256 257 - blk_execute_rq(rq->q, NULL, rq, 1); 257 + blk_execute_rq(NULL, rq, 1); 258 258 if (req->result) { 259 259 pr_err("pNFS: INQUIRY 0x83 failed with: %x\n", 260 260 req->result);
+1 -2
include/linux/blkdev.h
··· 948 948 extern int blk_rq_map_user_iov(struct request_queue *, struct request *, 949 949 struct rq_map_data *, const struct iov_iter *, 950 950 gfp_t); 951 - extern void blk_execute_rq(struct request_queue *, struct gendisk *, 952 - struct request *, int); 951 + extern void blk_execute_rq(struct gendisk *, struct request *, int); 953 952 extern void blk_execute_rq_nowait(struct gendisk *, 954 953 struct request *, int, rq_end_io_fn *); 955 954