[PATCHv2 4/4] block: Change at_head argument of blk_execute_rq to bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Suggested-by: Christoph Hellwig <hch@xxxxxx>
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux