Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Jens Axboe
ff005a06 a9a14d36

+42 -59
+3 -11
block/blk-core.c
··· 1605 1605 } 1606 1606 1607 1607 /** 1608 - * blk_get_request_flags - allocate a request 1608 + * blk_get_request - allocate a request 1609 1609 * @q: request queue to allocate a request for 1610 1610 * @op: operation (REQ_OP_*) and REQ_* flags, e.g. REQ_SYNC. 1611 1611 * @flags: BLK_MQ_REQ_* flags, e.g. BLK_MQ_REQ_NOWAIT. 1612 1612 */ 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) 1615 1615 { 1616 1616 struct request *req; 1617 1617 ··· 1629 1629 } 1630 1630 1631 1631 return req; 1632 - } 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 1632 } 1641 1633 EXPORT_SYMBOL(blk_get_request); 1642 1634
+2 -3
block/bsg.c
··· 226 226 return ERR_PTR(ret); 227 227 228 228 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); 231 230 if (IS_ERR(rq)) 232 231 return rq; 233 232 ··· 248 249 goto out; 249 250 } 250 251 251 - next_rq = blk_get_request(q, REQ_OP_SCSI_IN, GFP_KERNEL); 252 + next_rq = blk_get_request(q, REQ_OP_SCSI_IN, 0); 252 253 if (IS_ERR(next_rq)) { 253 254 ret = PTR_ERR(next_rq); 254 255 goto out;
+3 -5
block/scsi_ioctl.c
··· 321 321 at_head = 1; 322 322 323 323 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); 326 325 if (IS_ERR(rq)) 327 326 return PTR_ERR(rq); 328 327 req = scsi_req(rq); ··· 448 449 449 450 } 450 451 451 - rq = blk_get_request(q, in_len ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 452 - __GFP_RECLAIM); 452 + rq = blk_get_request(q, in_len ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0); 453 453 if (IS_ERR(rq)) { 454 454 err = PTR_ERR(rq); 455 455 goto error_free_buffer; ··· 536 538 struct request *rq; 537 539 int err; 538 540 539 - rq = blk_get_request(q, REQ_OP_SCSI_OUT, __GFP_RECLAIM); 541 + rq = blk_get_request(q, REQ_OP_SCSI_OUT, 0); 540 542 if (IS_ERR(rq)) 541 543 return PTR_ERR(rq); 542 544 rq->timeout = BLK_DEFAULT_SG_TIMEOUT;
+1 -1
drivers/block/paride/pd.c
··· 740 740 { 741 741 struct request *rq; 742 742 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); 744 744 if (IS_ERR(rq)) 745 745 return PTR_ERR(rq); 746 746
+1 -1
drivers/block/pktcdvd.c
··· 704 704 int ret = 0; 705 705 706 706 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); 708 708 if (IS_ERR(rq)) 709 709 return PTR_ERR(rq); 710 710
+1 -1
drivers/block/sx8.c
··· 567 567 if (!crq) 568 568 return NULL; 569 569 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); 571 571 if (IS_ERR(rq)) { 572 572 spin_lock_irqsave(&host->lock, flags); 573 573 carm_put_request(host, crq);
+1 -1
drivers/block/virtio_blk.c
··· 298 298 struct request *req; 299 299 int err; 300 300 301 - req = blk_get_request(q, REQ_OP_DRV_IN, GFP_KERNEL); 301 + req = blk_get_request(q, REQ_OP_DRV_IN, 0); 302 302 if (IS_ERR(req)) 303 303 return PTR_ERR(req); 304 304
+1 -1
drivers/cdrom/cdrom.c
··· 2192 2192 2193 2193 len = nr * CD_FRAMESIZE_RAW; 2194 2194 2195 - rq = blk_get_request(q, REQ_OP_SCSI_IN, GFP_KERNEL); 2195 + rq = blk_get_request(q, REQ_OP_SCSI_IN, 0); 2196 2196 if (IS_ERR(rq)) { 2197 2197 ret = PTR_ERR(rq); 2198 2198 break;
+1 -1
drivers/ide/ide-atapi.c
··· 92 92 struct request *rq; 93 93 int error; 94 94 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); 96 96 ide_req(rq)->type = ATA_PRIV_MISC; 97 97 rq->special = (char *)pc; 98 98
+1 -1
drivers/ide/ide-cd.c
··· 437 437 bool delay = false; 438 438 439 439 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); 441 441 memcpy(scsi_req(rq)->cmd, cmd, BLK_MAX_CDB); 442 442 ide_req(rq)->type = ATA_PRIV_PC; 443 443 rq->rq_flags |= rq_flags;
+1 -1
drivers/ide/ide-cd_ioctl.c
··· 304 304 struct request *rq; 305 305 int ret; 306 306 307 - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 307 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 308 308 ide_req(rq)->type = ATA_PRIV_MISC; 309 309 rq->rq_flags = RQF_QUIET; 310 310 blk_execute_rq(drive->queue, cd->disk, rq, 0);
+1 -1
drivers/ide/ide-devsets.c
··· 166 166 if (!(setting->flags & DS_SYNC)) 167 167 return setting->set(drive, arg); 168 168 169 - rq = blk_get_request(q, REQ_OP_DRV_IN, __GFP_RECLAIM); 169 + rq = blk_get_request(q, REQ_OP_DRV_IN, 0); 170 170 ide_req(rq)->type = ATA_PRIV_MISC; 171 171 scsi_req(rq)->cmd_len = 5; 172 172 scsi_req(rq)->cmd[0] = REQ_DEVSET_EXEC;
+1 -1
drivers/ide/ide-disk.c
··· 478 478 if (drive->special_flags & IDE_SFLAG_SET_MULTMODE) 479 479 return -EBUSY; 480 480 481 - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 481 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 482 482 ide_req(rq)->type = ATA_PRIV_TASKFILE; 483 483 484 484 drive->mult_req = arg;
+2 -2
drivers/ide/ide-ioctls.c
··· 125 125 if (NULL == (void *) arg) { 126 126 struct request *rq; 127 127 128 - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 128 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 129 129 ide_req(rq)->type = ATA_PRIV_TASKFILE; 130 130 blk_execute_rq(drive->queue, NULL, rq, 0); 131 131 err = scsi_req(rq)->result ? -EIO : 0; ··· 222 222 struct request *rq; 223 223 int ret = 0; 224 224 225 - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 225 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 226 226 ide_req(rq)->type = ATA_PRIV_MISC; 227 227 scsi_req(rq)->cmd_len = 1; 228 228 scsi_req(rq)->cmd[0] = REQ_DRIVE_RESET;
+2 -2
drivers/ide/ide-park.c
··· 32 32 } 33 33 spin_unlock_irq(&hwif->lock); 34 34 35 - rq = blk_get_request(q, REQ_OP_DRV_IN, __GFP_RECLAIM); 35 + rq = blk_get_request(q, REQ_OP_DRV_IN, 0); 36 36 scsi_req(rq)->cmd[0] = REQ_PARK_HEADS; 37 37 scsi_req(rq)->cmd_len = 1; 38 38 ide_req(rq)->type = ATA_PRIV_MISC; ··· 47 47 * Make sure that *some* command is sent to the drive after the 48 48 * timeout has expired, so power management will be reenabled. 49 49 */ 50 - rq = blk_get_request(q, REQ_OP_DRV_IN, GFP_NOWAIT); 50 + rq = blk_get_request(q, REQ_OP_DRV_IN, BLK_MQ_REQ_NOWAIT); 51 51 if (IS_ERR(rq)) 52 52 goto out; 53 53
+2 -3
drivers/ide/ide-pm.c
··· 19 19 } 20 20 21 21 memset(&rqpm, 0, sizeof(rqpm)); 22 - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 22 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 23 23 ide_req(rq)->type = ATA_PRIV_PM_SUSPEND; 24 24 rq->special = &rqpm; 25 25 rqpm.pm_step = IDE_PM_START_SUSPEND; ··· 90 90 } 91 91 92 92 memset(&rqpm, 0, sizeof(rqpm)); 93 - rq = blk_get_request_flags(drive->queue, REQ_OP_DRV_IN, 94 - BLK_MQ_REQ_PREEMPT); 93 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, BLK_MQ_REQ_PREEMPT); 95 94 ide_req(rq)->type = ATA_PRIV_PM_RESUME; 96 95 rq->special = &rqpm; 97 96 rqpm.pm_step = IDE_PM_START_RESUME;
+1 -1
drivers/ide/ide-tape.c
··· 854 854 BUG_ON(cmd != REQ_IDETAPE_READ && cmd != REQ_IDETAPE_WRITE); 855 855 BUG_ON(size < 0 || size % tape->blk_size); 856 856 857 - rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 857 + rq = blk_get_request(drive->queue, REQ_OP_DRV_IN, 0); 858 858 ide_req(rq)->type = ATA_PRIV_MISC; 859 859 scsi_req(rq)->cmd[13] = cmd; 860 860 rq->rq_disk = tape->disk;
+1 -1
drivers/ide/ide-taskfile.c
··· 431 431 432 432 rq = blk_get_request(drive->queue, 433 433 (cmd->tf_flags & IDE_TFLAG_WRITE) ? 434 - REQ_OP_DRV_OUT : REQ_OP_DRV_IN, __GFP_RECLAIM); 434 + REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); 435 435 ide_req(rq)->type = ATA_PRIV_TASKFILE; 436 436 437 437 /*
+2 -1
drivers/md/dm-mpath.c
··· 520 520 521 521 bdev = pgpath->path.dev->bdev; 522 522 q = bdev_get_queue(bdev); 523 - clone = blk_get_request(q, rq->cmd_flags | REQ_NOMERGE, GFP_ATOMIC); 523 + clone = blk_get_request(q, rq->cmd_flags | REQ_NOMERGE, 524 + BLK_MQ_REQ_NOWAIT); 524 525 if (IS_ERR(clone)) { 525 526 /* EBUSY, ENODEV or EWOULDBLOCK: requeue */ 526 527 if (blk_queue_dying(q)) {
+5 -7
drivers/mmc/core/block.c
··· 244 244 mq = &md->queue; 245 245 246 246 /* Dispatch locking to the block layer */ 247 - req = blk_get_request(mq->queue, REQ_OP_DRV_OUT, __GFP_RECLAIM); 247 + req = blk_get_request(mq->queue, REQ_OP_DRV_OUT, 0); 248 248 if (IS_ERR(req)) { 249 249 count = PTR_ERR(req); 250 250 goto out_put; ··· 650 650 */ 651 651 mq = &md->queue; 652 652 req = blk_get_request(mq->queue, 653 - idata->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 654 - __GFP_RECLAIM); 653 + idata->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); 655 654 if (IS_ERR(req)) { 656 655 err = PTR_ERR(req); 657 656 goto cmd_done; ··· 720 721 */ 721 722 mq = &md->queue; 722 723 req = blk_get_request(mq->queue, 723 - idata[0]->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 724 - __GFP_RECLAIM); 724 + idata[0]->ic.write_flag ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0); 725 725 if (IS_ERR(req)) { 726 726 err = PTR_ERR(req); 727 727 goto cmd_err; ··· 2748 2750 int ret; 2749 2751 2750 2752 /* Ask the block layer about the card status */ 2751 - req = blk_get_request(mq->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 2753 + req = blk_get_request(mq->queue, REQ_OP_DRV_IN, 0); 2752 2754 if (IS_ERR(req)) 2753 2755 return PTR_ERR(req); 2754 2756 req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_CARD_STATUS; ··· 2784 2786 return -ENOMEM; 2785 2787 2786 2788 /* Ask the block layer for the EXT CSD */ 2787 - req = blk_get_request(mq->queue, REQ_OP_DRV_IN, __GFP_RECLAIM); 2789 + req = blk_get_request(mq->queue, REQ_OP_DRV_IN, 0); 2788 2790 if (IS_ERR(req)) { 2789 2791 err = PTR_ERR(req); 2790 2792 goto out_free;
+1 -1
drivers/scsi/osd/osd_initiator.c
··· 1570 1570 int ret; 1571 1571 1572 1572 req = blk_get_request(q, has_write ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 1573 - GFP_KERNEL); 1573 + 0); 1574 1574 if (IS_ERR(req)) 1575 1575 return req; 1576 1576
+1 -1
drivers/scsi/osst.c
··· 368 368 int write = (data_direction == DMA_TO_DEVICE); 369 369 370 370 req = blk_get_request(SRpnt->stp->device->request_queue, 371 - write ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, GFP_KERNEL); 371 + write ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0); 372 372 if (IS_ERR(req)) 373 373 return DRIVER_ERROR << 24; 374 374
+1 -1
drivers/scsi/scsi_error.c
··· 1937 1937 * blk_get_request with GFP_KERNEL (__GFP_RECLAIM) sleeps until a 1938 1938 * request becomes available 1939 1939 */ 1940 - req = blk_get_request(sdev->request_queue, REQ_OP_SCSI_IN, GFP_KERNEL); 1940 + req = blk_get_request(sdev->request_queue, REQ_OP_SCSI_IN, 0); 1941 1941 if (IS_ERR(req)) 1942 1942 return; 1943 1943 rq = scsi_req(req);
+1 -1
drivers/scsi/scsi_lib.c
··· 265 265 struct scsi_request *rq; 266 266 int ret = DRIVER_ERROR << 24; 267 267 268 - req = blk_get_request_flags(sdev->request_queue, 268 + req = blk_get_request(sdev->request_queue, 269 269 data_direction == DMA_TO_DEVICE ? 270 270 REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, BLK_MQ_REQ_PREEMPT); 271 271 if (IS_ERR(req))
+1 -1
drivers/scsi/sg.c
··· 1715 1715 * does not sleep except under memory pressure. 1716 1716 */ 1717 1717 rq = blk_get_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ? 1718 - REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, GFP_KERNEL); 1718 + REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0); 1719 1719 if (IS_ERR(rq)) { 1720 1720 kfree(long_cmdp); 1721 1721 return PTR_ERR(rq);
+1 -1
drivers/scsi/st.c
··· 545 545 546 546 req = blk_get_request(SRpnt->stp->device->request_queue, 547 547 data_direction == DMA_TO_DEVICE ? 548 - REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, GFP_KERNEL); 548 + REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0); 549 549 if (IS_ERR(req)) 550 550 return DRIVER_ERROR << 24; 551 551 rq = scsi_req(req);
+1 -2
drivers/target/target_core_pscsi.c
··· 986 986 987 987 req = blk_get_request(pdv->pdv_sd->request_queue, 988 988 cmd->data_direction == DMA_TO_DEVICE ? 989 - REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 990 - GFP_KERNEL); 989 + REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0); 991 990 if (IS_ERR(req)) { 992 991 pr_err("PSCSI: blk_get_request() failed\n"); 993 992 ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
+1 -1
fs/nfsd/blocklayout.c
··· 227 227 if (!buf) 228 228 return -ENOMEM; 229 229 230 - rq = blk_get_request(q, REQ_OP_SCSI_IN, GFP_KERNEL); 230 + rq = blk_get_request(q, REQ_OP_SCSI_IN, 0); 231 231 if (IS_ERR(rq)) { 232 232 error = -ENOMEM; 233 233 goto out_free_buf;
+1 -4
include/linux/blkdev.h
··· 976 976 extern void blk_init_request_from_bio(struct request *req, struct bio *bio); 977 977 extern void blk_put_request(struct request *); 978 978 extern void __blk_put_request(struct request_queue *, struct request *); 979 - extern struct request *blk_get_request_flags(struct request_queue *, 980 - unsigned int op, 981 - blk_mq_req_flags_t flags); 982 979 extern struct request *blk_get_request(struct request_queue *, unsigned int op, 983 - gfp_t gfp_mask); 980 + blk_mq_req_flags_t flags); 984 981 extern void blk_requeue_request(struct request_queue *, struct request *); 985 982 extern int blk_lld_busy(struct request_queue *q); 986 983 extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src,