Skip to content

Commit

Permalink
block: remove __blk_put_request()
Browse files Browse the repository at this point in the history
Now there's no difference between blk_put_request() and
__blk_put_request() anymore, get rid of the underscore version and
convert the few callers.

Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Nov 7, 2018
1 parent f9cd4bf commit 92bc5a2
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 18 deletions.
9 changes: 0 additions & 9 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,15 +803,6 @@ void part_round_stats(struct request_queue *q, int cpu, struct hd_struct *part)
}
EXPORT_SYMBOL_GPL(part_round_stats);

void __blk_put_request(struct request_queue *q, struct request *req)
{
if (unlikely(!q))
return;

blk_mq_free_request(req);
}
EXPORT_SYMBOL_GPL(__blk_put_request);

void blk_put_request(struct request *req)
{
blk_mq_free_request(req);
Expand Down
2 changes: 1 addition & 1 deletion block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ int blk_attempt_req_merge(struct request_queue *q, struct request *rq,

free = attempt_merge(q, rq, next);
if (free) {
__blk_put_request(q, free);
blk_put_request(free);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/osd/osd_initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@ static void osd_request_async_done(struct request *req, blk_status_t error)

_set_error_resid(or, req, error);
if (req->next_rq) {
__blk_put_request(req->q, req->next_rq);
blk_put_request(req->next_rq);
req->next_rq = NULL;
}

__blk_put_request(req->q, req);
blk_put_request(req);
or->request = NULL;
or->in.req = NULL;
or->out.req = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/osst.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ static void osst_end_async(struct request *req, blk_status_t status)
blk_rq_unmap_user(SRpnt->bio);
}

__blk_put_request(req->q, req);
blk_put_request(req);
}

/* osst_request memory management */
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,7 +1932,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->q, req);
blk_put_request(req);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/sg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,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->q, rq);
blk_put_request(rq);

write_lock_irqsave(&sfp->rq_list_lock, iflags);
if (unlikely(srp->orphan)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,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->q, req);
blk_put_request(req);
}

static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd,
Expand Down
2 changes: 1 addition & 1 deletion drivers/target/target_core_pscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ static void pscsi_req_done(struct request *req, blk_status_t status)
break;
}

__blk_put_request(req->q, req);
blk_put_request(req);
kfree(pt);
}

Expand Down
1 change: 0 additions & 1 deletion include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,6 @@ extern blk_qc_t direct_make_request(struct bio *bio);
extern void blk_rq_init(struct request_queue *q, struct request *rq);
extern void blk_init_request_from_bio(struct request *req, struct bio *bio);
extern void blk_put_request(struct request *);
extern void __blk_put_request(struct request_queue *, 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);
Expand Down

0 comments on commit 92bc5a2

Please sign in to comment.