Skip to content

Commit ff005a0

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: sanitize blk_get_request calling conventions
Switch everyone to blk_get_request_flags, and then rename blk_get_request_flags to blk_get_request. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a9a14d3 commit ff005a0

29 files changed

Lines changed: 42 additions & 59 deletions

‎block/blk-core.c‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,13 +1605,13 @@ static struct request *blk_old_get_request(struct request_queue *q,
16051605
}
16061606

16071607
/**
1608-
* blk_get_request_flags - allocate a request
1608+
* blk_get_request - allocate a request
16091609
* @q: request queue to allocate a request for
16101610
* @op: operation (REQ_OP_*) and REQ_* flags, e.g. REQ_SYNC.
16111611
* @flags: BLK_MQ_REQ_* flags, e.g. BLK_MQ_REQ_NOWAIT.
16121612
*/
1613-
struct request *blk_get_request_flags(struct request_queue *q, unsigned int op,
1614-
blk_mq_req_flags_t flags)
1613+
struct request *blk_get_request(struct request_queue *q, unsigned int op,
1614+
blk_mq_req_flags_t flags)
16151615
{
16161616
struct request *req;
16171617

@@ -1630,14 +1630,6 @@ struct request *blk_get_request_flags(struct request_queue *q, unsigned int op,
16301630

16311631
return req;
16321632
}
1633-
EXPORT_SYMBOL(blk_get_request_flags);
1634-
1635-
struct request *blk_get_request(struct request_queue *q, unsigned int op,
1636-
gfp_t gfp_mask)
1637-
{
1638-
return blk_get_request_flags(q, op, gfp_mask & __GFP_DIRECT_RECLAIM ?
1639-
0 : BLK_MQ_REQ_NOWAIT);
1640-
}
16411633
EXPORT_SYMBOL(blk_get_request);
16421634

16431635
/**

‎block/bsg.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,7 @@ bsg_map_hdr(struct request_queue *q, struct sg_io_v4 *hdr, fmode_t mode)
226226
return ERR_PTR(ret);
227227

228228
rq = blk_get_request(q, hdr->dout_xfer_len ?
229-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
230-
GFP_KERNEL);
229+
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
231230
if (IS_ERR(rq))
232231
return rq;
233232

@@ -249,7 +248,7 @@ bsg_map_hdr(struct request_queue *q, struct sg_io_v4 *hdr, fmode_t mode)
249248
goto out;
250249
}
251250

252-
next_rq = blk_get_request(q, REQ_OP_SCSI_IN, GFP_KERNEL);
251+
next_rq = blk_get_request(q, REQ_OP_SCSI_IN, 0);
253252
if (IS_ERR(next_rq)) {
254253
ret = PTR_ERR(next_rq);
255254
goto out;

‎block/scsi_ioctl.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
321321
at_head = 1;
322322

323323
ret = -ENOMEM;
324-
rq = blk_get_request(q, writing ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
325-
GFP_KERNEL);
324+
rq = blk_get_request(q, writing ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
326325
if (IS_ERR(rq))
327326
return PTR_ERR(rq);
328327
req = scsi_req(rq);
@@ -449,8 +448,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
449448

450449
}
451450

452-
rq = blk_get_request(q, in_len ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
453-
__GFP_RECLAIM);
451+
rq = blk_get_request(q, in_len ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
454452
if (IS_ERR(rq)) {
455453
err = PTR_ERR(rq);
456454
goto error_free_buffer;
@@ -538,7 +536,7 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
538536
struct request *rq;
539537
int err;
540538

541-
rq = blk_get_request(q, REQ_OP_SCSI_OUT, __GFP_RECLAIM);
539+
rq = blk_get_request(q, REQ_OP_SCSI_OUT, 0);
542540
if (IS_ERR(rq))
543541
return PTR_ERR(rq);
544542
rq->timeout = BLK_DEFAULT_SG_TIMEOUT;

‎drivers/block/paride/pd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ static int pd_special_command(struct pd_unit *disk,
740740
{
741741
struct request *rq;
742742

743-
rq = blk_get_request(disk->gd->queue, REQ_OP_DRV_IN, __GFP_RECLAIM);
743+
rq = blk_get_request(disk->gd->queue, REQ_OP_DRV_IN, 0);
744744
if (IS_ERR(rq))
745745
return PTR_ERR(rq);
746746

‎drivers/block/pktcdvd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
704704
int ret = 0;
705705

706706
rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
707-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, __GFP_RECLAIM);
707+
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
708708
if (IS_ERR(rq))
709709
return PTR_ERR(rq);
710710

‎drivers/block/sx8.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ static struct carm_request *carm_get_special(struct carm_host *host)
567567
if (!crq)
568568
return NULL;
569569

570-
rq = blk_get_request(host->oob_q, REQ_OP_DRV_OUT, GFP_KERNEL);
570+
rq = blk_get_request(host->oob_q, REQ_OP_DRV_OUT, 0);
571571
if (IS_ERR(rq)) {
572572
spin_lock_irqsave(&host->lock, flags);
573573
carm_put_request(host, crq);

‎drivers/block/virtio_blk.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int virtblk_get_id(struct gendisk *disk, char *id_str)
298298
struct request *req;
299299
int err;
300300

301-
req = blk_get_request(q, REQ_OP_DRV_IN, GFP_KERNEL);
301+
req = blk_get_request(q, REQ_OP_DRV_IN, 0);
302302
if (IS_ERR(req))
303303
return PTR_ERR(req);
304304

‎drivers/cdrom/cdrom.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2192,7 +2192,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
21922192

21932193
len = nr * CD_FRAMESIZE_RAW;
21942194

2195-
rq = blk_get_request(q, REQ_OP_SCSI_IN, GFP_KERNEL);
2195+
rq = blk_get_request(q, REQ_OP_SCSI_IN, 0);
21962196
if (IS_ERR(rq)) {
21972197
ret = PTR_ERR(rq);
21982198
break;

‎drivers/ide/ide-atapi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int ide_queue_pc_tail(ide_drive_t *drive, struct gendisk *disk,
9292
struct request *rq;
9393
int error;
9494

95-
rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM);
95+
rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
9696
ide_req(rq)->type = ATA_PRIV_MISC;
9797
rq->special = (char *)pc;
9898

‎drivers/ide/ide-cd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
437437
bool delay = false;
438438

439439
rq = blk_get_request(drive->queue,
440-
write ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, __GFP_RECLAIM);
440+
write ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
441441
memcpy(scsi_req(rq)->cmd, cmd, BLK_MAX_CDB);
442442
ide_req(rq)->type = ATA_PRIV_PC;
443443
rq->rq_flags |= rq_flags;

0 commit comments

Comments
 (0)