]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: remove unnecessary argument from blk_execute_rq
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Mon, 25 Jan 2021 04:49:58 +0000 (05:49 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 04:52:39 +0000 (21:52 -0700)
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>
24 files changed:
block/blk-exec.c
block/bsg.c
block/scsi_ioctl.c
drivers/block/mtip32xx/mtip32xx.c
drivers/block/paride/pd.c
drivers/block/pktcdvd.c
drivers/block/virtio_blk.c
drivers/cdrom/cdrom.c
drivers/ide/ide-atapi.c
drivers/ide/ide-cd.c
drivers/ide/ide-cd_ioctl.c
drivers/ide/ide-devsets.c
drivers/ide/ide-disk.c
drivers/ide/ide-ioctls.c
drivers/ide/ide-park.c
drivers/ide/ide-pm.c
drivers/ide/ide-tape.c
drivers/ide/ide-taskfile.c
drivers/mmc/core/block.c
drivers/nvme/host/core.c
drivers/nvme/host/lightnvm.c
drivers/scsi/scsi_lib.c
fs/nfsd/blocklayout.c
include/linux/blkdev.h

index 2e37e85456fb44f97a27f50a328a8811d9e91d38..0ab873f101332d096a0ca74d34979d129f9a8a6d 100644 (file)
@@ -74,8 +74,7 @@ EXPORT_SYMBOL_GPL(blk_execute_rq_nowait);
  *    Insert a fully prepared request at the back of the I/O scheduler queue
  *    for execution and wait for completion.
  */
-void blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
-                  struct request *rq, int at_head)
+void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, int at_head)
 {
        DECLARE_COMPLETION_ONSTACK(wait);
        unsigned long hang_check;
index 3d78e843a83f65469c0eeb19ebea9c28a06d2529..bd10922d5cbb428b29068e898927e500bd615cf0 100644 (file)
@@ -183,7 +183,7 @@ static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
 
        bio = rq->bio;
 
-       blk_execute_rq(q, NULL, rq, !(hdr.flags & BSG_FLAG_Q_AT_TAIL));
+       blk_execute_rq(NULL, rq, !(hdr.flags & BSG_FLAG_Q_AT_TAIL));
        ret = rq->q->bsg_dev.ops->complete_rq(rq, &hdr);
        blk_rq_unmap_user(bio);
 
index c9f009cc04460f48dc1a50f70418454e534a4a32..6599bac0a78cb01d978c4f2d526dcdc5532696a3 100644 (file)
@@ -357,7 +357,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
         * (if he doesn't check that is his problem).
         * N.B. a non-zero SCSI status is _not_ necessarily an error.
         */
-       blk_execute_rq(q, bd_disk, rq, at_head);
+       blk_execute_rq(bd_disk, rq, at_head);
 
        hdr->duration = jiffies_to_msecs(jiffies - start_time);
 
@@ -493,7 +493,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
                goto error;
        }
 
-       blk_execute_rq(q, disk, rq, 0);
+       blk_execute_rq(disk, rq, 0);
 
        err = req->result & 0xff;       /* only 8 bit SCSI status */
        if (err) {
@@ -532,7 +532,7 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
        scsi_req(rq)->cmd[0] = cmd;
        scsi_req(rq)->cmd[4] = data;
        scsi_req(rq)->cmd_len = 6;
-       blk_execute_rq(q, bd_disk, rq, 0);
+       blk_execute_rq(bd_disk, rq, 0);
        err = scsi_req(rq)->result ? -EIO : 0;
        blk_put_request(rq);
 
index 53ac59d19ae530b7d2e0cbb0b0f9939258473c53..3fd99836bb1c427a70c57ab8838660b4e47f9ba8 100644 (file)
@@ -1015,7 +1015,7 @@ static int mtip_exec_internal_command(struct mtip_port *port,
        rq->timeout = timeout;
 
        /* insert request and run queue */
-       blk_execute_rq(rq->q, NULL, rq, true);
+       blk_execute_rq(NULL, rq, true);
 
        if (int_cmd->status) {
                dev_err(&dd->pdev->dev, "Internal command [%02X] failed %d\n",
index a7af4f27b7c3f11eb3205a6d0bebcd2661bad7d5..897acda20ac85a2b3c8ccbc0dbf4d95294d892fd 100644 (file)
@@ -781,7 +781,7 @@ static int pd_special_command(struct pd_unit *disk,
        req = blk_mq_rq_to_pdu(rq);
 
        req->func = func;
-       blk_execute_rq(disk->gd->queue, disk->gd, rq, 0);
+       blk_execute_rq(disk->gd, rq, 0);
        blk_put_request(rq);
        return 0;
 }
index 658a0981cb5471f780aa0e623370090343a3487c..fc4b0f1aa86dfb71ac4223113040b68bd100a9d6 100644 (file)
@@ -722,7 +722,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
        if (cgc->quiet)
                rq->rq_flags |= RQF_QUIET;
 
-       blk_execute_rq(rq->q, pd->bdev->bd_disk, rq, 0);
+       blk_execute_rq(pd->bdev->bd_disk, rq, 0);
        if (scsi_req(rq)->result)
                ret = -EIO;
 out:
index 145606dc52db1e5214a2080c113643cc1eeba0db..b0285db7cf4f66ae4cf1ea9a2d8d192a7fa98148 100644 (file)
@@ -320,7 +320,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
        if (err)
                goto out;
 
-       blk_execute_rq(vblk->disk->queue, vblk->disk, req, false);
+       blk_execute_rq(vblk->disk, req, false);
        err = blk_status_to_errno(virtblk_result(blk_mq_rq_to_pdu(req)));
 out:
        blk_put_request(req);
index 8f0e52a7149382e1ea7a3295d056ef91938f15f5..90ad34c6ef8e0ace63df5a1d4faa8d3f91186356 100644 (file)
@@ -2214,7 +2214,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
                rq->timeout = 60 * HZ;
                bio = rq->bio;
 
-               blk_execute_rq(q, cdi->disk, rq, 0);
+               blk_execute_rq(cdi->disk, rq, 0);
                if (scsi_req(rq)->result) {
                        struct scsi_sense_hdr sshdr;
 
index 013ad33fbbc81ee507148df1aeffde66613957d2..a1ce9f5ac3aa1d30876017ca7e3536e8f22f5d71 100644 (file)
@@ -107,7 +107,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
        memcpy(scsi_req(rq)->cmd, pc->c, 12);
        if (drive->media == ide_tape)
                scsi_req(rq)->cmd[13] = REQ_IDETAPE_PC1;
-       blk_execute_rq(drive->queue, disk, rq, 0);
+       blk_execute_rq(disk, rq, 0);
        error = scsi_req(rq)->result ? -EIO : 0;
 put_req:
        blk_put_request(rq);
index 25d2d88e82ada07444f870e02e7d9b57cc3f7514..cffbcc27a34ccd542c01a0d94b2c04ce75e8511e 100644 (file)
@@ -467,7 +467,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
                        }
                }
 
-               blk_execute_rq(drive->queue, info->disk, rq, 0);
+               blk_execute_rq(info->disk, rq, 0);
                error = scsi_req(rq)->result ? -EIO : 0;
 
                if (buffer)
index 46f2df288c6a1c63df711c4aa666528c5313f9d3..011eab9c69b7ebc926f1363fc5a1dd307d2278c2 100644 (file)
@@ -299,7 +299,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
        rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
        ide_req(rq)->type = ATA_PRIV_MISC;
        rq->rq_flags = RQF_QUIET;
-       blk_execute_rq(drive->queue, cd->disk, rq, 0);
+       blk_execute_rq(cd->disk, rq, 0);
        ret = scsi_req(rq)->result ? -EIO : 0;
        blk_put_request(rq);
        /*
index f2f93ed4035629851c25ee03f1036b82a129eccc..ca1d4b3d38786042c2cef0310d87cd10db5184f5 100644 (file)
@@ -173,7 +173,7 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting,
        *(int *)&scsi_req(rq)->cmd[1] = arg;
        ide_req(rq)->special = setting->set;
 
-       blk_execute_rq(q, NULL, rq, 0);
+       blk_execute_rq(NULL, rq, 0);
        ret = scsi_req(rq)->result;
        blk_put_request(rq);
 
index 34b9441084f84f7d078eb870d5a77799d17bda96..8413731c62598b5d9c183edad2ff3f1a52ebf20f 100644 (file)
@@ -482,7 +482,7 @@ static int set_multcount(ide_drive_t *drive, int arg)
 
        drive->mult_req = arg;
        drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
-       blk_execute_rq(drive->queue, NULL, rq, 0);
+       blk_execute_rq(NULL, rq, 0);
        blk_put_request(rq);
 
        return (drive->mult_count == arg) ? 0 : -EIO;
index 58994da10c0664371ac158a49e8944b3d3c6c5a8..43fbc37d85c34acd6b417e9b4f70937cf3d9c1f2 100644 (file)
@@ -137,7 +137,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, void __user *argp)
 
                rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
                ide_req(rq)->type = ATA_PRIV_TASKFILE;
-               blk_execute_rq(drive->queue, NULL, rq, 0);
+               blk_execute_rq(NULL, rq, 0);
                err = scsi_req(rq)->result ? -EIO : 0;
                blk_put_request(rq);
 
@@ -235,7 +235,7 @@ static int generic_drive_reset(ide_drive_t *drive)
        ide_req(rq)->type = ATA_PRIV_MISC;
        scsi_req(rq)->cmd_len = 1;
        scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET;
-       blk_execute_rq(drive->queue, NULL, rq, 1);
+       blk_execute_rq(NULL, rq, 1);
        ret = scsi_req(rq)->result;
        blk_put_request(rq);
        return ret;
index 8af7af6001eb36cd28bdfd840c206942e1fda5c0..a80a0f28f7b9e3fad97a61f20c7149c93c7c79d2 100644 (file)
@@ -37,7 +37,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
        scsi_req(rq)->cmd_len = 1;
        ide_req(rq)->type = ATA_PRIV_MISC;
        ide_req(rq)->special = &timeout;
-       blk_execute_rq(q, NULL, rq, 1);
+       blk_execute_rq(NULL, rq, 1);
        rc = scsi_req(rq)->result ? -EIO : 0;
        blk_put_request(rq);
        if (rc)
index 82ab308f1aafe007b0e2420e0065eeefd19acf6f..d680b3e3295faa251e81ff9bf80617755f2fb226 100644 (file)
@@ -27,7 +27,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
                mesg.event = PM_EVENT_FREEZE;
        rqpm.pm_state = mesg.event;
 
-       blk_execute_rq(drive->queue, NULL, rq, 0);
+       blk_execute_rq(NULL, rq, 0);
        ret = scsi_req(rq)->result ? -EIO : 0;
        blk_put_request(rq);
 
@@ -50,7 +50,7 @@ static int ide_pm_execute_rq(struct request *rq)
                blk_mq_end_request(rq, BLK_STS_OK);
                return -ENXIO;
        }
-       blk_execute_rq(q, NULL, rq, true);
+       blk_execute_rq(NULL, rq, true);
 
        return scsi_req(rq)->result ? -EIO : 0;
 }
index 88b96437b22e62ae05ae440f116dc9a320251e46..fa05e7e7d6090b942213bc1ca716d22b5aacc6f1 100644 (file)
@@ -868,7 +868,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size)
                        goto out_put;
        }
 
-       blk_execute_rq(drive->queue, tape->disk, rq, 0);
+       blk_execute_rq(tape->disk, rq, 0);
 
        /* calculate the number of transferred bytes and update buffer state */
        size -= scsi_req(rq)->resid_len;
index d016cbe68cba17419ba279dc74dd041a8d11e288..6665fc4724b996a8e0e5c039c16b2e5c9d044333 100644 (file)
@@ -443,7 +443,7 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
        ide_req(rq)->special = cmd;
        cmd->rq = rq;
 
-       blk_execute_rq(drive->queue, NULL, rq, 0);
+       blk_execute_rq(NULL, rq, 0);
        error = scsi_req(rq)->result ? -EIO : 0;
 put_req:
        blk_put_request(rq);
index 42e27a2982180efe570f1ea658c6dfc57ccf4222..a1d6b68320ae48b5adb60ebbf1dba584a9e60269 100644 (file)
@@ -253,7 +253,7 @@ static ssize_t power_ro_lock_store(struct device *dev,
                goto out_put;
        }
        req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_BOOT_WP;
-       blk_execute_rq(mq->queue, NULL, req, 0);
+       blk_execute_rq(NULL, req, 0);
        ret = req_to_mmc_queue_req(req)->drv_op_result;
        blk_put_request(req);
 
@@ -629,7 +629,7 @@ static int mmc_blk_ioctl_cmd(struct mmc_blk_data *md,
                rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL;
        req_to_mmc_queue_req(req)->drv_op_data = idatas;
        req_to_mmc_queue_req(req)->ioc_count = 1;
-       blk_execute_rq(mq->queue, NULL, req, 0);
+       blk_execute_rq(NULL, req, 0);
        ioc_err = req_to_mmc_queue_req(req)->drv_op_result;
        err = mmc_blk_ioctl_copy_to_user(ic_ptr, idata);
        blk_put_request(req);
@@ -698,7 +698,7 @@ static int mmc_blk_ioctl_multi_cmd(struct mmc_blk_data *md,
                rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL;
        req_to_mmc_queue_req(req)->drv_op_data = idata;
        req_to_mmc_queue_req(req)->ioc_count = num_of_cmds;
-       blk_execute_rq(mq->queue, NULL, req, 0);
+       blk_execute_rq(NULL, req, 0);
        ioc_err = req_to_mmc_queue_req(req)->drv_op_result;
 
        /* copy to user if data and response */
@@ -2722,7 +2722,7 @@ static int mmc_dbg_card_status_get(void *data, u64 *val)
        if (IS_ERR(req))
                return PTR_ERR(req);
        req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_CARD_STATUS;
-       blk_execute_rq(mq->queue, NULL, req, 0);
+       blk_execute_rq(NULL, req, 0);
        ret = req_to_mmc_queue_req(req)->drv_op_result;
        if (ret >= 0) {
                *val = ret;
@@ -2761,7 +2761,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
        }
        req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_EXT_CSD;
        req_to_mmc_queue_req(req)->drv_op_data = &ext_csd;
-       blk_execute_rq(mq->queue, NULL, req, 0);
+       blk_execute_rq(NULL, req, 0);
        err = req_to_mmc_queue_req(req)->drv_op_result;
        blk_put_request(req);
        if (err) {
index 0bea9ae0309216ade677a2a248eb46c566aeeac8..eb7963fb167b56a181fadfe915868cec0e8ee4fd 100644 (file)
@@ -964,7 +964,7 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
        if (poll)
                nvme_execute_rq_polled(req->q, NULL, req, at_head);
        else
-               blk_execute_rq(req->q, NULL, req, at_head);
+               blk_execute_rq(NULL, req, at_head);
        if (result)
                *result = nvme_req(req)->result;
        if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
@@ -1101,7 +1101,7 @@ void nvme_execute_passthru_rq(struct request *rq)
        u32 effects;
 
        effects = nvme_passthru_start(ctrl, ns, cmd->common.opcode);
-       blk_execute_rq(rq->q, disk, rq, 0);
+       blk_execute_rq(disk, rq, 0);
        nvme_passthru_end(ctrl, effects);
 }
 EXPORT_SYMBOL_NS_GPL(nvme_execute_passthru_rq, NVME_TARGET_PASSTHRU);
index 0e5a55075e35e2a01fc1be8635f00b8dd0b131d1..ec38128f51e994cf566e82735c2c6d5c360d014c 100644 (file)
@@ -819,7 +819,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
                bio->bi_bdev = ns->disk->part0;
        }
 
-       blk_execute_rq(q, NULL, rq, 0);
+       blk_execute_rq(NULL, rq, 0);
 
        if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
                ret = -EINTR;
index b3f14f05340ad63a9fe5d4377cfb118d57d4a937..4d228065855954fc6b3698013241a8452b95d157 100644 (file)
@@ -269,7 +269,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
        /*
         * head injection *required* here otherwise quiesce won't work
         */
-       blk_execute_rq(req->q, NULL, req, 1);
+       blk_execute_rq(NULL, req, 1);
 
        /*
         * Some devices (USB mass-storage in particular) may transfer
index a07c39c94bbd03a2ec60c0c24b4b77184533ed16..1058659a8d31af5014c8ce2ea9bedb276b67346f 100644 (file)
@@ -254,7 +254,7 @@ again:
        req->cmd[4] = bufflen & 0xff;
        req->cmd_len = COMMAND_SIZE(INQUIRY);
 
-       blk_execute_rq(rq->q, NULL, rq, 1);
+       blk_execute_rq(NULL, rq, 1);
        if (req->result) {
                pr_err("pNFS: INQUIRY 0x83 failed with: %x\n",
                        req->result);
index 623a61239429a5c8d38451be395e347e7369277e..20f3706b6b2e68a4edde4f5740ea2af4ea72cc49 100644 (file)
@@ -948,8 +948,7 @@ extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, uns
 extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
                               struct rq_map_data *, const struct iov_iter *,
                               gfp_t);
-extern void blk_execute_rq(struct request_queue *, struct gendisk *,
-                         struct request *, int);
+extern void blk_execute_rq(struct gendisk *, struct request *, int);
 extern void blk_execute_rq_nowait(struct gendisk *,
                                  struct request *, int, rq_end_io_fn *);