@@ -642,12 +642,6 @@ struct request *blk_get_request(struct request_queue *q, unsigned int op,
}
EXPORT_SYMBOL(blk_get_request);
-void blk_put_request(struct request *req)
-{
- blk_mq_free_request(req);
-}
-EXPORT_SYMBOL(blk_put_request);
-
static void handle_bad_sector(struct bio *bio, sector_t maxsector)
{
char b[BDEVNAME_SIZE];
@@ -845,7 +845,7 @@ int blk_attempt_req_merge(struct request_queue *q, struct request *rq,
free = attempt_merge(q, rq, next);
if (free) {
- blk_put_request(free);
+ blk_mq_free_request(free);
return 1;
}
@@ -67,7 +67,7 @@ static int bsg_transport_fill_hdr(struct request *rq, struct sg_io_v4 *hdr,
out_free_bidi_rq:
if (job->bidi_rq)
- blk_put_request(job->bidi_rq);
+ blk_mq_free_request(job->bidi_rq);
out:
kfree(job->request);
return ret;
@@ -128,7 +128,7 @@ static void bsg_transport_free_rq(struct request *rq)
if (job->bidi_rq) {
blk_rq_unmap_user(job->bidi_bio);
- blk_put_request(job->bidi_rq);
+ blk_mq_free_request(job->bidi_rq);
}
kfree(job->request);
@@ -158,7 +158,7 @@ static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
ret = q->bsg_dev.ops->fill_hdr(rq, &hdr, mode);
if (ret) {
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return ret;
}
@@ -189,7 +189,7 @@ static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
out_free_rq:
rq->q->bsg_dev.ops->free_rq(rq);
- blk_put_request(rq);
+ blk_mq_free_request(rq);
if (!ret && copy_to_user(uarg, &hdr, sizeof(hdr)))
return -EFAULT;
return ret;
@@ -366,7 +366,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
out_free_cdb:
scsi_req_free_cmd(req);
out_put_request:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return ret;
}
@@ -509,7 +509,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
}
error:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
error_free_buffer:
kfree(buffer);
@@ -534,7 +534,7 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
scsi_req(rq)->cmd_len = 6;
blk_execute_rq(bd_disk, rq, 0);
err = scsi_req(rq)->result ? -EIO : 0;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return err;
}
@@ -782,7 +782,7 @@ static int pd_special_command(struct pd_unit *disk,
req->func = func;
blk_execute_rq(disk->gd, rq, 0);
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return 0;
}
@@ -726,7 +726,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
if (scsi_req(rq)->result)
ret = -EIO;
out:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return ret;
}
@@ -323,7 +323,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
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);
+ blk_mq_free_request(req);
return err;
}
@@ -2195,7 +2195,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
ret = blk_rq_map_user(q, rq, NULL, ubuf, len, GFP_KERNEL);
if (ret) {
- blk_put_request(rq);
+ blk_mq_free_request(rq);
break;
}
@@ -2226,7 +2226,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
if (blk_rq_unmap_user(bio))
ret = -EFAULT;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
if (ret)
break;
@@ -110,7 +110,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
blk_execute_rq(disk, rq, 0);
error = scsi_req(rq)->result ? -EIO : 0;
put_req:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return error;
}
EXPORT_SYMBOL_GPL(ide_queue_pc_tail);
@@ -462,7 +462,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
error = blk_rq_map_kern(drive->queue, rq, buffer,
*bufflen, GFP_NOIO);
if (error) {
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return error;
}
}
@@ -501,7 +501,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
}
--retries;
}
- blk_put_request(rq);
+ blk_mq_free_request(rq);
if (delay)
ssleep(2);
} while (failed && retries >= 0);
@@ -301,7 +301,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi)
rq->rq_flags = RQF_QUIET;
blk_execute_rq(cd->disk, rq, 0);
ret = scsi_req(rq)->result ? -EIO : 0;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
/*
* A reset will unlock the door. If it was previously locked,
* lock it again.
@@ -175,7 +175,7 @@ int ide_devset_execute(ide_drive_t *drive, const struct ide_devset *setting,
blk_execute_rq(NULL, rq, 0);
ret = scsi_req(rq)->result;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return ret;
}
@@ -483,7 +483,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_put_request(rq);
+ blk_mq_free_request(rq);
return (drive->mult_count == arg) ? 0 : -EIO;
}
@@ -139,7 +139,7 @@ static int ide_cmd_ioctl(ide_drive_t *drive, void __user *argp)
ide_req(rq)->type = ATA_PRIV_TASKFILE;
blk_execute_rq(NULL, rq, 0);
err = scsi_req(rq)->result ? -EIO : 0;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return err;
}
@@ -237,7 +237,7 @@ static int generic_drive_reset(ide_drive_t *drive)
scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET;
blk_execute_rq(NULL, rq, 1);
ret = scsi_req(rq)->result;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return ret;
}
@@ -39,7 +39,7 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout)
ide_req(rq)->special = &timeout;
blk_execute_rq(NULL, rq, 1);
rc = scsi_req(rq)->result ? -EIO : 0;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
if (rc)
goto out;
@@ -29,7 +29,7 @@ int generic_ide_suspend(struct device *dev, pm_message_t mesg)
blk_execute_rq(NULL, rq, 0);
ret = scsi_req(rq)->result ? -EIO : 0;
- blk_put_request(rq);
+ blk_mq_free_request(rq);
if (ret == 0 && ide_port_acpi(hwif)) {
/* call ACPI _PS3 only after both devices are suspended */
@@ -84,7 +84,7 @@ int generic_ide_resume(struct device *dev)
rqpm.pm_state = PM_EVENT_ON;
err = ide_pm_execute_rq(rq);
- blk_put_request(rq);
+ blk_mq_free_request(rq);
if (err == 0 && dev->driver) {
struct ide_driver *drv = to_ide_driver(dev->driver);
@@ -882,7 +882,7 @@ static int idetape_queue_rw_tail(ide_drive_t *drive, int cmd, int size)
if (scsi_req(rq)->result == IDE_DRV_ERROR_GENERAL)
ret = -EIO;
out_put:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return ret;
}
@@ -446,7 +446,7 @@ int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf,
blk_execute_rq(NULL, rq, 0);
error = scsi_req(rq)->result ? -EIO : 0;
put_req:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
return error;
}
EXPORT_SYMBOL(ide_raw_taskfile);
@@ -579,7 +579,7 @@ static void multipath_release_clone(struct request *clone,
clone->io_start_time_ns);
}
- blk_put_request(clone);
+ blk_mq_free_request(clone);
}
/*
@@ -255,7 +255,7 @@ static ssize_t power_ro_lock_store(struct device *dev,
req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_BOOT_WP;
blk_execute_rq(NULL, req, 0);
ret = req_to_mmc_queue_req(req)->drv_op_result;
- blk_put_request(req);
+ blk_mq_free_request(req);
if (!ret) {
pr_info("%s: Locking boot partition ro until next power on\n",
@@ -632,7 +632,7 @@ static int mmc_blk_ioctl_cmd(struct mmc_blk_data *md,
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);
+ blk_mq_free_request(req);
cmd_done:
kfree(idata->buf);
@@ -705,7 +705,7 @@ static int mmc_blk_ioctl_multi_cmd(struct mmc_blk_data *md,
for (i = 0; i < num_of_cmds && !err; i++)
err = mmc_blk_ioctl_copy_to_user(&cmds[i], idata[i]);
- blk_put_request(req);
+ blk_mq_free_request(req);
cmd_err:
for (i = 0; i < num_of_cmds; i++) {
@@ -2728,7 +2728,7 @@ static int mmc_dbg_card_status_get(void *data, u64 *val)
*val = ret;
ret = 0;
}
- blk_put_request(req);
+ blk_mq_free_request(req);
return ret;
}
@@ -2763,7 +2763,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
req_to_mmc_queue_req(req)->drv_op_data = &ext_csd;
blk_execute_rq(NULL, req, 0);
err = req_to_mmc_queue_req(req)->drv_op_result;
- blk_put_request(req);
+ blk_mq_free_request(req);
if (err) {
pr_err("FAILED %d\n", err);
goto out_free;
@@ -1971,7 +1971,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
static void eh_lock_door_done(struct request *req, blk_status_t status)
{
- blk_put_request(req);
+ blk_mq_free_request(req);
}
/**
@@ -288,7 +288,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
scsi_normalize_sense(rq->sense, rq->sense_len, sshdr);
ret = rq->result;
out:
- blk_put_request(req);
+ blk_mq_free_request(req);
return ret;
}
@@ -811,7 +811,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
if (atomic_read(&sdp->detaching)) {
if (srp->bio) {
scsi_req_free_cmd(scsi_req(srp->rq));
- blk_put_request(srp->rq);
+ blk_mq_free_request(srp->rq);
srp->rq = NULL;
}
@@ -1407,7 +1407,7 @@ sg_rq_end_io(struct request *rq, blk_status_t status)
*/
srp->rq = NULL;
scsi_req_free_cmd(scsi_req(rq));
- blk_put_request(rq);
+ blk_mq_free_request(rq);
write_lock_irqsave(&sfp->rq_list_lock, iflags);
if (unlikely(srp->orphan)) {
@@ -1862,7 +1862,7 @@ sg_finish_rem_req(Sg_request *srp)
if (srp->rq) {
scsi_req_free_cmd(scsi_req(srp->rq));
- blk_put_request(srp->rq);
+ blk_mq_free_request(srp->rq);
}
if (srp->res_used)
@@ -534,7 +534,7 @@ static void st_scsi_execute_end(struct request *req, blk_status_t status)
complete(SRpnt->waiting);
blk_rq_unmap_user(tmp);
- blk_put_request(req);
+ blk_mq_free_request(req);
}
static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd,
@@ -561,7 +561,7 @@ static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd,
err = blk_rq_map_user(req->q, req, mdata, NULL, bufflen,
GFP_KERNEL);
if (err) {
- blk_put_request(req);
+ blk_mq_free_request(req);
return DRIVER_ERROR << 24;
}
}
@@ -2871,7 +2871,7 @@ static int ufshcd_exec_dev_cmd(struct ufs_hba *hba,
err ? "query_complete_err" : "query_complete");
out_put_tag:
- blk_put_request(req);
+ blk_mq_free_request(req);
out_unlock:
up_read(&hba->clk_scaling_lock);
return err;
@@ -6409,7 +6409,7 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,
__clear_bit(free_slot, &hba->outstanding_tasks);
spin_unlock_irqrestore(hba->host->host_lock, flags);
- blk_put_request(req);
+ blk_mq_free_request(req);
ufshcd_release(hba);
return err;
@@ -6584,7 +6584,7 @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
}
out:
- blk_put_request(req);
+ blk_mq_free_request(req);
out_unlock:
up_read(&hba->clk_scaling_lock);
return err;
@@ -1006,7 +1006,7 @@ pscsi_execute_cmd(struct se_cmd *cmd)
return 0;
fail_put_request:
- blk_put_request(req);
+ blk_mq_free_request(req);
fail:
kfree(pt);
return ret;
@@ -1061,7 +1061,7 @@ static void pscsi_req_done(struct request *req, blk_status_t status)
break;
}
- blk_put_request(req);
+ blk_mq_free_request(req);
kfree(pt);
}
@@ -265,7 +265,7 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev,
len = (buf[2] << 8) + buf[3] + 4;
if (len > bufflen) {
if (len <= maxlen && retries--) {
- blk_put_request(rq);
+ blk_mq_free_request(rq);
kfree(buf);
bufflen = len;
goto again;
@@ -308,7 +308,7 @@ static int nfsd4_scsi_identify_device(struct block_device *bdev,
}
out_put_request:
- blk_put_request(rq);
+ blk_mq_free_request(rq);
out_free_buf:
kfree(buf);
return error;
@@ -914,7 +914,6 @@ extern int blk_register_queue(struct gendisk *disk);
extern void blk_unregister_queue(struct gendisk *disk);
blk_qc_t submit_bio_noacct(struct bio *bio);
extern void blk_rq_init(struct request_queue *q, struct request *rq);
-extern void blk_put_request(struct request *);
extern struct request *blk_get_request(struct request_queue *, unsigned int op,
blk_mq_req_flags_t flags);
extern int blk_lld_busy(struct request_queue *q);
The function blk_put_request() is just a wrapper to blk_mq_free_request(), remove the unnecessary wrapper. Any feedback is welcome on this RFC. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> --- block/blk-core.c | 6 ------ block/blk-merge.c | 2 +- block/bsg-lib.c | 4 ++-- block/bsg.c | 4 ++-- block/scsi_ioctl.c | 6 +++--- drivers/block/paride/pd.c | 2 +- drivers/block/pktcdvd.c | 2 +- drivers/block/virtio_blk.c | 2 +- drivers/cdrom/cdrom.c | 4 ++-- drivers/ide/ide-atapi.c | 2 +- drivers/ide/ide-cd.c | 4 ++-- 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/md/dm-mpath.c | 2 +- drivers/mmc/core/block.c | 10 +++++----- drivers/scsi/scsi_error.c | 2 +- drivers/scsi/scsi_lib.c | 2 +- drivers/scsi/sg.c | 6 +++--- drivers/scsi/st.c | 4 ++-- drivers/scsi/ufs/ufshcd.c | 6 +++--- drivers/target/target_core_pscsi.c | 4 ++-- fs/nfsd/blocklayout.c | 4 ++-- include/linux/blkdev.h | 1 - 29 files changed, 46 insertions(+), 53 deletions(-)