Linux-ide Archive on lore.kernel.org
 help / color / Atom feed
* [PATCHv2  2/4] fs/block/drivers: Remove request_queue argument from blk_execute_rq
       [not found] <20190809105433.8946-1-marcos.souza.org@gmail.com>
@ 2019-08-09 10:54 ` Marcos Paulo de Souza
  2019-08-09 10:54 ` [PATCHv2 4/4] block: Change at_head argument of blk_execute_rq to bool Marcos Paulo de Souza
  1 sibling, 0 replies; 3+ messages in thread
From: Marcos Paulo de Souza @ 2019-08-09 10:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Marcos Paulo de Souza, hch, axboe, linux-block, FUJITA Tomonori,
	Tim Waugh, Michael S. Tsirkin, Jason Wang, Paolo Bonzini,
	Stefan Hajnoczi, David S. Miller, Borislav Petkov, Ulf Hansson,
	Keith Busch, Sagi Grimberg, James E.J. Bottomley,
	Martin K. Petersen, J. Bruce Fields, Chuck Lever,
	Hannes Reinecke, Johannes Thumshirn, Matthew Wilcox, Avri Altman,
	Wolfram Sang, Ming Lei, YueHaibing, Chris Boot, Zachary Hays,
	Omar Sandoval, Chaitanya Kulkarni, Damien Le Moal,
	Bart Van Assche, linux-scsi, virtualization, linux-ide,
	linux-mmc, SECURE DIGITAL (SD) AND...),
	linux-nvme, linux-nfs

The only user of the request_queue argument was removed in commit
552cef2b8b03 ("block: Remove request_queue argument from
blk_execute_rq_nowait"), so now we can safely removed the same argument
from blk_execute_rq and all places that calls this function.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 block/blk-exec.c                  |  4 +---
 block/bsg.c                       |  2 +-
 block/scsi_ioctl.c                |  6 +++---
 drivers/block/mtip32xx/mtip32xx.c |  2 +-
 drivers/block/paride/pd.c         |  2 +-
 drivers/block/pktcdvd.c           |  2 +-
 drivers/block/virtio_blk.c        |  2 +-
 drivers/cdrom/cdrom.c             |  2 +-
 drivers/ide/ide-atapi.c           |  2 +-
 drivers/ide/ide-cd.c              |  2 +-
 drivers/ide/ide-cd_ioctl.c        |  2 +-
 drivers/ide/ide-devsets.c         |  2 +-
 drivers/ide/ide-disk.c            |  2 +-
 drivers/ide/ide-ioctls.c          |  4 ++--
 drivers/ide/ide-park.c            |  2 +-
 drivers/ide/ide-pm.c              |  4 ++--
 drivers/ide/ide-tape.c            |  2 +-
 drivers/ide/ide-taskfile.c        |  2 +-
 drivers/mmc/core/block.c          | 10 +++++-----
 drivers/nvme/host/core.c          |  4 ++--
 drivers/nvme/host/lightnvm.c      |  4 ++--
 drivers/scsi/scsi_lib.c           |  2 +-
 fs/nfsd/blocklayout.c             |  2 +-
 include/linux/blkdev.h            |  3 +--
 24 files changed, 34 insertions(+), 37 deletions(-)

diff --git a/block/blk-exec.c b/block/blk-exec.c
index 80890b0b9c67..7862f8be39d1 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -63,7 +63,6 @@ EXPORT_SYMBOL_GPL(blk_execute_rq_nowait);

 /**
  * blk_execute_rq - insert a request into queue for execution
- * @q:		queue to insert the request in
  * @bd_disk:	matching gendisk
  * @rq:		request to insert
  * @at_head:    insert request at head or tail of queue
@@ -72,8 +71,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;
diff --git a/block/bsg.c b/block/bsg.c
index 833c44b3d458..180c26ea131d 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -181,7 +181,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);

diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index f5e0ad65e86a..5411fb322c56 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -354,7 +354,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);

@@ -490,7 +490,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) {
@@ -529,7 +529,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);

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 964f78cfffa0..707c2a21d75e 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -1014,7 +1014,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",
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 6f9ad3fc716f..22f36dc28018 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -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;
 }
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 024060165afa..00b0aa14ca07 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -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:
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 7ffd719d89de..e84aefc89780 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -374,7 +374,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);
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index ac42ae4651ce..fa85c6ab4915 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -2221,7 +2221,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;

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 80bc3bf82f4d..f3e5f25e4065 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -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);
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 9d117936bee1..31a6d1af0c2f 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -466,7 +466,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)
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c
index 46f2df288c6a..011eab9c69b7 100644
--- a/drivers/ide/ide-cd_ioctl.c
+++ b/drivers/ide/ide-cd_ioctl.c
@@ -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);
 	/*
diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c
index f2f93ed40356..ca1d4b3d3878 100644
--- a/drivers/ide/ide-devsets.c
+++ b/drivers/ide/ide-devsets.c
@@ -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);

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 197912af5c2f..ffb42a566c2b 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -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;
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index d48c17003874..45a313cd8698 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -128,7 +128,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)

 		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);

@@ -227,7 +227,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;
diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c
index 8af7af6001eb..a80a0f28f7b9 100644
--- a/drivers/ide/ide-park.c
+++ b/drivers/ide/ide-park.c
@@ -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)
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index 192e6c65d34e..fc3cb37fec14 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -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;
 }
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index db1a65f4b490..56f66cb0d6b6 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -867,7 +867,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;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index aab6a10435b6..577e34b80244 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -444,7 +444,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);
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 2c71a434c915..7cba68054435 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -249,7 +249,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);

@@ -664,7 +664,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);
@@ -733,7 +733,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 */
@@ -2752,7 +2752,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;
@@ -2791,7 +2791,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) {
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 6682fdcece0f..4a2ed03223b1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -791,7 +791,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)
@@ -884,7 +884,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,
 		}
 	}

-	blk_execute_rq(req->q, disk, req, 0);
+	blk_execute_rq(disk, req, 0);
 	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
 		ret = -EINTR;
 	else
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index 5d0e330e86d0..9c82a5044b75 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -706,7 +706,7 @@ static int nvme_nvm_submit_io_sync(struct nvm_dev *dev, struct nvm_rq *rqd)
 	/* I/Os can fail and the error is signaled through rqd. Callers must
 	 * handle the error accordingly.
 	 */
-	blk_execute_rq(q, NULL, rq, 0);
+	blk_execute_rq(NULL, rq, 0);
 	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
 		ret = -EINTR;

@@ -835,7 +835,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
 		bio->bi_disk = disk;
 	}

-	blk_execute_rq(q, NULL, rq, 0);
+	blk_execute_rq(NULL, rq, 0);

 	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
 		ret = -EINTR;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 11e64b50497f..9551bc93ad0c 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -276,7 +276,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
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c
index 66d4c55eb48e..b6fc7f7a0568 100644
--- a/fs/nfsd/blocklayout.c
+++ b/fs/nfsd/blocklayout.c
@@ -253,7 +253,7 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev,
 	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);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8e8f088c75a5..c9d9ca686290 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -865,8 +865,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 *);

--
2.22.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCHv2  4/4] block: Change at_head argument of blk_execute_rq to bool
       [not found] <20190809105433.8946-1-marcos.souza.org@gmail.com>
  2019-08-09 10:54 ` [PATCHv2 2/4] fs/block/drivers: Remove request_queue argument from blk_execute_rq Marcos Paulo de Souza
@ 2019-08-09 10:54 ` Marcos Paulo de Souza
  2019-08-11  5:20   ` kbuild test robot
  1 sibling, 1 reply; 3+ messages in thread
From: Marcos Paulo de Souza @ 2019-08-09 10:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: Marcos Paulo de Souza, hch, axboe, linux-block, Tim Waugh,
	David S. Miller, Borislav Petkov, Ulf Hansson, Keith Busch,
	Sagi Grimberg, James E.J. Bottomley, Martin K. Petersen,
	J. Bruce Fields, Chuck Lever, Hannes Reinecke, Avri Altman,
	YueHaibing, Wolfram Sang, Chris Boot, Zachary Hays, Ming Lei,
	Omar Sandoval, Damien Le Moal, Bart Van Assche, linux-ide,
	linux-mmc, SECURE DIGITAL (SD) AND...),
	linux-nvme, linux-scsi, linux-nfs

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 block/blk-exec.c             |  2 +-
 block/scsi_ioctl.c           |  8 ++++----
 drivers/block/paride/pd.c    |  2 +-
 drivers/block/pktcdvd.c      |  2 +-
 drivers/cdrom/cdrom.c        |  2 +-
 drivers/ide/ide-atapi.c      |  2 +-
 drivers/ide/ide-cd.c         |  2 +-
 drivers/ide/ide-cd_ioctl.c   |  2 +-
 drivers/ide/ide-devsets.c    |  2 +-
 drivers/ide/ide-disk.c       |  2 +-
 drivers/ide/ide-ioctls.c     |  4 ++--
 drivers/ide/ide-park.c       |  2 +-
 drivers/ide/ide-pm.c         |  2 +-
 drivers/ide/ide-tape.c       |  2 +-
 drivers/ide/ide-taskfile.c   |  2 +-
 drivers/mmc/core/block.c     | 10 +++++-----
 drivers/nvme/host/core.c     |  2 +-
 drivers/nvme/host/lightnvm.c |  4 ++--
 drivers/scsi/scsi_lib.c      |  2 +-
 fs/nfsd/blocklayout.c        |  2 +-
 include/linux/blkdev.h       |  2 +-
 21 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/block/blk-exec.c b/block/blk-exec.c
index c8b88f469988..dcc4bfb7b981 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -71,7 +71,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 gendisk *bd_disk, struct request *rq, int at_head)
+void blk_execute_rq(struct gendisk *bd_disk, struct request *rq, bool at_head)
 {
 	DECLARE_COMPLETION_ONSTACK(wait);
 	unsigned long hang_check;
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 5411fb322c56..3231c347ee94 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -281,7 +281,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
 	unsigned long start_time;
 	ssize_t ret = 0;
 	int writing = 0;
-	int at_head = 0;
+	bool at_head = false;
 	struct request *rq;
 	struct scsi_request *req;
 	struct bio *bio;
@@ -304,7 +304,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
 			break;
 		}
 	if (hdr->flags & SG_FLAG_Q_AT_HEAD)
-		at_head = 1;
+		at_head = true

 	ret = -ENOMEM;
 	rq = blk_get_request(q, writing ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
@@ -490,7 +490,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
 		goto error;
 	}

-	blk_execute_rq(disk, rq, 0);
+	blk_execute_rq(disk, rq, false);

 	err = req->result & 0xff;	/* only 8 bit SCSI status */
 	if (err) {
@@ -529,7 +529,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(bd_disk, rq, 0);
+	blk_execute_rq(bd_disk, rq, false);
 	err = scsi_req(rq)->result ? -EIO : 0;
 	blk_put_request(rq);

diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 22f36dc28018..d02c57247c9d 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -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, rq, 0);
+	blk_execute_rq(disk->gd, rq, false);
 	blk_put_request(rq);
 	return 0;
 }
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 00b0aa14ca07..6bd163c4c5c2 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -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(pd->bdev->bd_disk, rq, 0);
+	blk_execute_rq(pd->bdev->bd_disk, rq, false);
 	if (scsi_req(rq)->result)
 		ret = -EIO;
 out:
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index fa85c6ab4915..b5406301e823 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -2221,7 +2221,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(cdi->disk, rq, 0);
+		blk_execute_rq(cdi->disk, rq, false);
 		if (scsi_req(rq)->result) {
 			struct scsi_sense_hdr sshdr;

diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index f3e5f25e4065..571e30187a0f 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -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(disk, rq, 0);
+	blk_execute_rq(disk, rq, false);
 	error = scsi_req(rq)->result ? -EIO : 0;
 put_req:
 	blk_put_request(rq);
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index 31a6d1af0c2f..3d0dbb11fa8f 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -466,7 +466,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
 			}
 		}

-		blk_execute_rq(info->disk, rq, 0);
+		blk_execute_rq(info->disk, rq, false);
 		error = scsi_req(rq)->result ? -EIO : 0;

 		if (buffer)
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c
index 011eab9c69b7..2eed0e43bb2b 100644
--- a/drivers/ide/ide-cd_ioctl.c
+++ b/drivers/ide/ide-cd_ioctl.c
@@ -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(cd->disk, rq, 0);
+	blk_execute_rq(cd->disk, rq, false);
 	ret = scsi_req(rq)->result ? -EIO : 0;
 	blk_put_request(rq);
 	/*
diff --git a/drivers/ide/ide-devsets.c b/drivers/ide/ide-devsets.c
index ca1d4b3d3878..304df2b35b42 100644
--- a/drivers/ide/ide-devsets.c
+++ b/drivers/ide/ide-devsets.c
@@ -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(NULL, rq, 0);
+	blk_execute_rq(NULL, rq, false);
 	ret = scsi_req(rq)->result;
 	blk_put_request(rq);

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index ffb42a566c2b..2d2614607df9 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -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(NULL, rq, 0);
+	blk_execute_rq(NULL, rq, false);
 	blk_put_request(rq);

 	return (drive->mult_count == arg) ? 0 : -EIO;
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index 45a313cd8698..fd861037b723 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -128,7 +128,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)

 		rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
 		ide_req(rq)->type = ATA_PRIV_TASKFILE;
-		blk_execute_rq(NULL, rq, 0);
+		blk_execute_rq(NULL, rq, false);
 		err = scsi_req(rq)->result ? -EIO : 0;
 		blk_put_request(rq);

@@ -227,7 +227,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(NULL, rq, 1);
+	blk_execute_rq(NULL, rq, true);
 	ret = scsi_req(rq)->result;
 	blk_put_request(rq);
 	return ret;
diff --git a/drivers/ide/ide-park.c b/drivers/ide/ide-park.c
index a80a0f28f7b9..0069feb228fd 100644
--- a/drivers/ide/ide-park.c
+++ b/drivers/ide/ide-park.c
@@ -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(NULL, rq, 1);
+	blk_execute_rq(NULL, rq, true);
 	rc = scsi_req(rq)->result ? -EIO : 0;
 	blk_put_request(rq);
 	if (rc)
diff --git a/drivers/ide/ide-pm.c b/drivers/ide/ide-pm.c
index fc3cb37fec14..7c53449dc462 100644
--- a/drivers/ide/ide-pm.c
+++ b/drivers/ide/ide-pm.c
@@ -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(NULL, rq, 0);
+	blk_execute_rq(NULL, rq, false);
 	ret = scsi_req(rq)->result ? -EIO : 0;
 	blk_put_request(rq);

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 56f66cb0d6b6..484daef19ffe 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -867,7 +867,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size)
 			goto out_put;
 	}

-	blk_execute_rq(tape->disk, rq, 0);
+	blk_execute_rq(tape->disk, rq, false);

 	/* calculate the number of transferred bytes and update buffer state */
 	size -= scsi_req(rq)->resid_len;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 577e34b80244..4f9422deaf28 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -444,7 +444,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(NULL, rq, 0);
+	blk_execute_rq(NULL, rq, false);
 	error = scsi_req(rq)->result ? -EIO : 0;
 put_req:
 	blk_put_request(rq);
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 7cba68054435..2543850aee99 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -249,7 +249,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(NULL, req, 0);
+	blk_execute_rq(NULL, req, false);
 	ret = req_to_mmc_queue_req(req)->drv_op_result;
 	blk_put_request(req);

@@ -664,7 +664,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(NULL, req, 0);
+	blk_execute_rq(NULL, req, false);
 	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);
@@ -733,7 +733,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(NULL, req, 0);
+	blk_execute_rq(NULL, req, false);
 	ioc_err = req_to_mmc_queue_req(req)->drv_op_result;

 	/* copy to user if data and response */
@@ -2752,7 +2752,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(NULL, req, 0);
+	blk_execute_rq(NULL, req, false);
 	ret = req_to_mmc_queue_req(req)->drv_op_result;
 	if (ret >= 0) {
 		*val = ret;
@@ -2791,7 +2791,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(NULL, req, 0);
+	blk_execute_rq(NULL, req, false);
 	err = req_to_mmc_queue_req(req)->drv_op_result;
 	blk_put_request(req);
 	if (err) {
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 38c1a5db9e56..0aa72962f2a7 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -884,7 +884,7 @@ static int nvme_submit_user_cmd(struct request_queue *q,
 		}
 	}

-	blk_execute_rq(disk, req, 0);
+	blk_execute_rq(disk, req, false);
 	if (nvme_req(req)->flags & NVME_REQ_CANCELLED)
 		ret = -EINTR;
 	else
diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
index c09989376c3b..220e34097f94 100644
--- a/drivers/nvme/host/lightnvm.c
+++ b/drivers/nvme/host/lightnvm.c
@@ -706,7 +706,7 @@ static int nvme_nvm_submit_io_sync(struct nvm_dev *dev, struct nvm_rq *rqd)
 	/* I/Os can fail and the error is signaled through rqd. Callers must
 	 * handle the error accordingly.
 	 */
-	blk_execute_rq(NULL, rq, 0);
+	blk_execute_rq(NULL, rq, false);
 	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
 		ret = -EINTR;

@@ -835,7 +835,7 @@ static int nvme_nvm_submit_user_cmd(struct request_queue *q,
 		bio->bi_disk = disk;
 	}

-	blk_execute_rq(NULL, rq, 0);
+	blk_execute_rq(NULL, rq, false);

 	if (nvme_req(rq)->flags & NVME_REQ_CANCELLED)
 		ret = -EINTR;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 9551bc93ad0c..b02df7b09312 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -276,7 +276,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
 	/*
 	 * head injection *required* here otherwise quiesce won't work
 	 */
-	blk_execute_rq(NULL, req, 1);
+	blk_execute_rq(NULL, req, true);

 	/*
 	 * Some devices (USB mass-storage in particular) may transfer
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c
index b6fc7f7a0568..407b633b7691 100644
--- a/fs/nfsd/blocklayout.c
+++ b/fs/nfsd/blocklayout.c
@@ -253,7 +253,7 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev,
 	req->cmd[4] = bufflen & 0xff;
 	req->cmd_len = COMMAND_SIZE(INQUIRY);

-	blk_execute_rq(NULL, rq, 1);
+	blk_execute_rq(NULL, rq, true);
 	if (req->result) {
 		pr_err("pNFS: INQUIRY 0x83 failed with: %x\n",
 			req->result);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 19ed996f0074..405f8ae31e5c 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -865,7 +865,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 gendisk *, struct request *, int);
+extern void blk_execute_rq(struct gendisk *, struct request *, bool);
 extern void blk_execute_rq_nowait(struct gendisk *, struct request *, bool,
 				rq_end_io_fn *);

--
2.22.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCHv2  4/4] block: Change at_head argument of blk_execute_rq to bool
  2019-08-09 10:54 ` [PATCHv2 4/4] block: Change at_head argument of blk_execute_rq to bool Marcos Paulo de Souza
@ 2019-08-11  5:20   ` kbuild test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2019-08-11  5:20 UTC (permalink / raw)
  To: Marcos Paulo de Souza
  Cc: kbuild-all, linux-kernel, Marcos Paulo de Souza, hch, axboe,
	linux-block, Tim Waugh, David S. Miller, Borislav Petkov,
	Ulf Hansson, Keith Busch, Sagi Grimberg, James E.J. Bottomley,
	Martin K. Petersen, J. Bruce Fields, Chuck Lever,
	Hannes Reinecke, Avri Altman, YueHaibing, Wolfram Sang,
	Chris Boot, Zachary Hays, Ming Lei, Omar Sandoval,
	Damien Le Moal, Bart Van Assche, open list:IDE SUBSYSTEM,
	open list:MULTIMEDIA CARD (MMC), SECURE DIGITAL (SD) AND...,
	open list:NVM EXPRESS DRIVER, open list:SCSI SUBSYSTEM,
	open list:KERNEL NFSD, SUNRPC, AND LOCKD SERVERS

[-- Attachment #1: Type: text/plain, Size: 10986 bytes --]

Hi Marcos,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[cannot apply to v5.3-rc3 next-20190809]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Marcos-Paulo-de-Souza/block-Remove-request_queue-argument-from-blk_execute_rq_nowait/20190811-113304
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   block/scsi_ioctl.c: In function 'sg_io':
>> block/scsi_ioctl.c:309:2: error: expected ';' before 'ret'
     ret = -ENOMEM;
     ^~~

vim +309 block/scsi_ioctl.c

3d6392cfbd7dc1 block/scsi_ioctl.c         Jens Axboe            2007-07-09  277  
5842e51ff2e8d6 block/scsi_ioctl.c         Al Viro               2008-09-02  278  static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
5842e51ff2e8d6 block/scsi_ioctl.c         Al Viro               2008-09-02  279  		struct sg_io_hdr *hdr, fmode_t mode)
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  280  {
3d6392cfbd7dc1 block/scsi_ioctl.c         Jens Axboe            2007-07-09  281  	unsigned long start_time;
e0ce0eacb3197a block/scsi_ioctl.c         Kent Overstreet       2013-08-07  282  	ssize_t ret = 0;
e0ce0eacb3197a block/scsi_ioctl.c         Kent Overstreet       2013-08-07  283  	int writing = 0;
e9e1e68597dd4a block/scsi_ioctl.c         Marcos Paulo de Souza 2019-08-09  284  	bool at_head = false;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  285  	struct request *rq;
82ed4db499b859 block/scsi_ioctl.c         Christoph Hellwig     2017-01-27  286  	struct scsi_request *req;
77d172ce2719b5 block/scsi_ioctl.c         FUJITA Tomonori       2006-12-11  287  	struct bio *bio;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  288  
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  289  	if (hdr->interface_id != 'S')
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  290  		return -EINVAL;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  291  
ae03bf639a5027 block/scsi_ioctl.c         Martin K. Petersen    2009-05-22  292  	if (hdr->dxfer_len > (queue_max_hw_sectors(q) << 9))
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  293  		return -EIO;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  294  
f1970baf6d74e0 drivers/block/scsi_ioctl.c James Bottomley       2005-06-20  295  	if (hdr->dxfer_len)
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  296  		switch (hdr->dxfer_direction) {
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  297  		default:
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  298  			return -EINVAL;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  299  		case SG_DXFER_TO_DEV:
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  300  			writing = 1;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  301  			break;
616e8a091a035c block/scsi_ioctl.c         Jens Axboe            2006-11-13  302  		case SG_DXFER_TO_FROM_DEV:
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  303  		case SG_DXFER_FROM_DEV:
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  304  			break;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  305  		}
d15156138dad40 block/scsi_ioctl.c         Douglas Gilbert       2014-07-01  306  	if (hdr->flags & SG_FLAG_Q_AT_HEAD)
e9e1e68597dd4a block/scsi_ioctl.c         Marcos Paulo de Souza 2019-08-09  307  		at_head = true
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  308  
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21 @309  	ret = -ENOMEM;
ff005a066240ef block/scsi_ioctl.c         Christoph Hellwig     2018-05-09  310  	rq = blk_get_request(q, writing ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
a492f075450f3b block/scsi_ioctl.c         Joe Lawrence          2014-08-28  311  	if (IS_ERR(rq))
a492f075450f3b block/scsi_ioctl.c         Joe Lawrence          2014-08-28  312  		return PTR_ERR(rq);
82ed4db499b859 block/scsi_ioctl.c         Christoph Hellwig     2017-01-27  313  	req = scsi_req(rq);
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  314  
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  315  	if (hdr->cmd_len > BLK_MAX_CDB) {
82ed4db499b859 block/scsi_ioctl.c         Christoph Hellwig     2017-01-27  316  		req->cmd = kzalloc(hdr->cmd_len, GFP_KERNEL);
82ed4db499b859 block/scsi_ioctl.c         Christoph Hellwig     2017-01-27  317  		if (!req->cmd)
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  318  			goto out_put_request;
3d6392cfbd7dc1 block/scsi_ioctl.c         Jens Axboe            2007-07-09  319  	}
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  320  
2c4cffe85170a0 block/scsi_ioctl.c         Paolo Bonzini         2015-06-26  321  	ret = blk_fill_sghdr_rq(q, rq, hdr, mode);
2c4cffe85170a0 block/scsi_ioctl.c         Paolo Bonzini         2015-06-26  322  	if (ret < 0)
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  323  		goto out_free_cdb;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  324  
d19d744685f47f block/scsi_ioctl.c         Sabrina Dubroca       2014-08-26  325  	ret = 0;
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  326  	if (hdr->iovec_count) {
26e49cfc7e988a block/scsi_ioctl.c         Kent Overstreet       2015-01-18  327  		struct iov_iter i;
17a05cca99d952 block/scsi_ioctl.c         Christian Engelmayer  2014-01-19  328  		struct iovec *iov = NULL;
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  329  
e272b89ff8fb63 block/scsi_ioctl.c         Al Viro               2015-03-21  330  		ret = import_iovec(rq_data_dir(rq),
e272b89ff8fb63 block/scsi_ioctl.c         Al Viro               2015-03-21  331  				   hdr->dxferp, hdr->iovec_count,
e272b89ff8fb63 block/scsi_ioctl.c         Al Viro               2015-03-21  332  				   0, &iov, &i);
e272b89ff8fb63 block/scsi_ioctl.c         Al Viro               2015-03-21  333  		if (ret < 0)
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  334  			goto out_free_cdb;
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  335  
25636e282fe955 block/scsi_ioctl.c         Tejun Heo             2009-04-15  336  		/* SG_IO howto says that the shorter of the two wins */
e272b89ff8fb63 block/scsi_ioctl.c         Al Viro               2015-03-21  337  		iov_iter_truncate(&i, hdr->dxfer_len);
25636e282fe955 block/scsi_ioctl.c         Tejun Heo             2009-04-15  338  
26e49cfc7e988a block/scsi_ioctl.c         Kent Overstreet       2015-01-18  339  		ret = blk_rq_map_user_iov(q, rq, NULL, &i, GFP_KERNEL);
e0ce0eacb3197a block/scsi_ioctl.c         Kent Overstreet       2013-08-07  340  		kfree(iov);
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  341  	} else if (hdr->dxfer_len)
152e283fdfea0c block/scsi_ioctl.c         FUJITA Tomonori       2008-08-28  342  		ret = blk_rq_map_user(q, rq, NULL, hdr->dxferp, hdr->dxfer_len,
a3bce90edd8f6c block/scsi_ioctl.c         FUJITA Tomonori       2008-08-28  343  				      GFP_KERNEL);
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  344  
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  345  	if (ret)
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  346  		goto out_free_cdb;
0e75f9063f5c55 block/scsi_ioctl.c         Mike Christie         2006-12-01  347  
77d172ce2719b5 block/scsi_ioctl.c         FUJITA Tomonori       2006-12-11  348  	bio = rq->bio;
64c7f1d1572cac block/scsi_ioctl.c         Christoph Hellwig     2017-04-05  349  	req->retries = 0;
01840f9c9d7ae3 block/scsi_ioctl.c         Jens Axboe            2006-02-03  350  
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  351  	start_time = jiffies;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  352  
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  353  	/* ignore return value. All information is passed back to caller
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  354  	 * (if he doesn't check that is his problem).
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  355  	 * N.B. a non-zero SCSI status is _not_ necessarily an error.
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  356  	 */
6bd6171931c593 block/scsi_ioctl.c         Marcos Paulo de Souza 2019-08-09  357  	blk_execute_rq(bd_disk, rq, at_head);
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  358  
24bb8fb99a0622 block/scsi_ioctl.c         Tejun Heo             2007-12-05  359  	hdr->duration = jiffies_to_msecs(jiffies - start_time);
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  360  
2cada584b20007 block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  361  	ret = blk_complete_sghdr_rq(rq, hdr, bio);
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  362  
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  363  out_free_cdb:
82ed4db499b859 block/scsi_ioctl.c         Christoph Hellwig     2017-01-27  364  	scsi_req_free_cmd(req);
a57821cac6bb6e block/scsi_ioctl.c         Christoph Hellwig     2014-08-21  365  out_put_request:
dd1cab95f356f1 drivers/block/scsi_ioctl.c Jens Axboe            2005-06-20  366  	blk_put_request(rq);
dd1cab95f356f1 drivers/block/scsi_ioctl.c Jens Axboe            2005-06-20  367  	return ret;
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  368  }
^1da177e4c3f41 drivers/block/scsi_ioctl.c Linus Torvalds        2005-04-16  369  

:::::: The code at line 309 was first introduced by commit
:::::: a57821cac6bb6e46abea118e34d0e86444ec1410 block: support > 16 byte CDBs for SG_IO

:::::: TO: Christoph Hellwig <hch@lst.de>
:::::: CC: Jens Axboe <axboe@fb.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 58668 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190809105433.8946-1-marcos.souza.org@gmail.com>
2019-08-09 10:54 ` [PATCHv2 2/4] fs/block/drivers: Remove request_queue argument from blk_execute_rq Marcos Paulo de Souza
2019-08-09 10:54 ` [PATCHv2 4/4] block: Change at_head argument of blk_execute_rq to bool Marcos Paulo de Souza
2019-08-11  5:20   ` kbuild test robot

Linux-ide Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ide/0 linux-ide/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ide linux-ide/ https://lore.kernel.org/linux-ide \
		linux-ide@vger.kernel.org
	public-inbox-index linux-ide

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ide


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git