Re: [PATCH 12/20] block: remove the request_queue argument from blk_queue_split

2020-07-02 Thread Song Liu
On Wed, Jul 1, 2020 at 2:02 AM Christoph Hellwig  wrote:
>
> The queue can be trivially derived from the bio, so pass one less
> argument.
>
> Signed-off-by: Christoph Hellwig 
> ---
[...]
>  drivers/md/md.c   |  2 +-

For md.c:
Acked-by: Song Liu 


[PATCH 12/20] block: remove the request_queue argument from blk_queue_split

2020-07-01 Thread Christoph Hellwig
The queue can be trivially derived from the bio, so pass one less
argument.

Signed-off-by: Christoph Hellwig 
---
 block/blk-merge.c | 21 ++---
 block/blk-mq.c|  2 +-
 block/blk.h   |  3 +--
 drivers/block/drbd/drbd_req.c |  2 +-
 drivers/block/pktcdvd.c   |  2 +-
 drivers/block/ps3vram.c   |  2 +-
 drivers/block/rsxx/dev.c  |  2 +-
 drivers/block/umem.c  |  2 +-
 drivers/lightnvm/pblk-init.c  |  4 ++--
 drivers/md/dm.c   |  2 +-
 drivers/md/md.c   |  2 +-
 drivers/nvme/host/multipath.c |  9 -
 drivers/s390/block/dcssblk.c  |  2 +-
 drivers/s390/block/xpram.c|  2 +-
 include/linux/blkdev.h|  2 +-
 15 files changed, 28 insertions(+), 31 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 9c9fb21584b64e..20fa2290604105 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -283,20 +283,20 @@ static struct bio *blk_bio_segment_split(struct 
request_queue *q,
 
 /**
  * __blk_queue_split - split a bio and submit the second half
- * @q:   [in] request queue pointer
  * @bio: [in, out] bio to be split
  * @nr_segs: [out] number of segments in the first bio
  *
  * Split a bio into two bios, chain the two bios, submit the second half and
  * store a pointer to the first half in *@bio. If the second bio is still too
  * big it will be split by a recursive call to this function. Since this
- * function may allocate a new bio from @q->bio_split, it is the responsibility
- * of the caller to ensure that @q is only released after processing of the
+ * function may allocate a new bio from @bio->bi_disk->queue->bio_split, it is
+ * the responsibility of the caller to ensure that
+ * @bio->bi_disk->queue->bio_split is only released after processing of the
  * split bio has finished.
  */
-void __blk_queue_split(struct request_queue *q, struct bio **bio,
-   unsigned int *nr_segs)
+void __blk_queue_split(struct bio **bio, unsigned int *nr_segs)
 {
+   struct request_queue *q = (*bio)->bi_disk->queue;
struct bio *split = NULL;
 
switch (bio_op(*bio)) {
@@ -345,20 +345,19 @@ void __blk_queue_split(struct request_queue *q, struct 
bio **bio,
 
 /**
  * blk_queue_split - split a bio and submit the second half
- * @q:   [in] request queue pointer
  * @bio: [in, out] bio to be split
  *
  * Split a bio into two bios, chains the two bios, submit the second half and
  * store a pointer to the first half in *@bio. Since this function may allocate
- * a new bio from @q->bio_split, it is the responsibility of the caller to
- * ensure that @q is only released after processing of the split bio has
- * finished.
+ * a new bio from @bio->bi_disk->queue->bio_split, it is the responsibility of
+ * the caller to ensure that @bio->bi_disk->queue->bio_split is only released
+ * after processing of the split bio has finished.
  */
-void blk_queue_split(struct request_queue *q, struct bio **bio)
+void blk_queue_split(struct bio **bio)
 {
unsigned int nr_segs;
 
-   __blk_queue_split(q, bio, _segs);
+   __blk_queue_split(bio, _segs);
 }
 EXPORT_SYMBOL(blk_queue_split);
 
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 65e0846fd06519..dbadb7defd618a 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2166,7 +2166,7 @@ blk_qc_t blk_mq_make_request(struct request_queue *q, 
struct bio *bio)
blk_status_t ret;
 
blk_queue_bounce(q, );
-   __blk_queue_split(q, , _segs);
+   __blk_queue_split(, _segs);
 
if (!bio_integrity_prep(bio))
goto queue_exit;
diff --git a/block/blk.h b/block/blk.h
index 0184a31fe4dfaf..0114fd92c8a05b 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -220,8 +220,7 @@ ssize_t part_timeout_show(struct device *, struct 
device_attribute *, char *);
 ssize_t part_timeout_store(struct device *, struct device_attribute *,
const char *, size_t);
 
-void __blk_queue_split(struct request_queue *q, struct bio **bio,
-   unsigned int *nr_segs);
+void __blk_queue_split(struct bio **bio, unsigned int *nr_segs);
 int ll_back_merge_fn(struct request *req, struct bio *bio,
unsigned int nr_segs);
 int ll_front_merge_fn(struct request *req,  struct bio *bio,
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 3f09b2ab977822..9368680474223a 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1598,7 +1598,7 @@ blk_qc_t drbd_make_request(struct request_queue *q, 
struct bio *bio)
struct drbd_device *device = bio->bi_disk->private_data;
unsigned long start_jif;
 
-   blk_queue_split(q, );
+   blk_queue_split();
 
start_jif = jiffies;
 
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 27a33adc41e487..29b0c62dc86c1f 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2434,7 +2434,7 @@ static blk_qc_t 

[PATCH 12/20] block: remove the request_queue argument from blk_queue_split

2020-06-29 Thread Christoph Hellwig
The queue can be trivially derived from the bio, so pass one less
argument.

Signed-off-by: Christoph Hellwig 
---
 block/blk-merge.c | 21 ++---
 block/blk-mq.c|  2 +-
 block/blk.h   |  3 +--
 drivers/block/drbd/drbd_req.c |  2 +-
 drivers/block/pktcdvd.c   |  2 +-
 drivers/block/ps3vram.c   |  2 +-
 drivers/block/rsxx/dev.c  |  2 +-
 drivers/block/umem.c  |  2 +-
 drivers/lightnvm/pblk-init.c  |  4 ++--
 drivers/md/dm.c   |  2 +-
 drivers/md/md.c   |  2 +-
 drivers/nvme/host/multipath.c |  9 -
 drivers/s390/block/dcssblk.c  |  2 +-
 drivers/s390/block/xpram.c|  2 +-
 include/linux/blkdev.h|  2 +-
 15 files changed, 28 insertions(+), 31 deletions(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 9c9fb21584b64e..20fa2290604105 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -283,20 +283,20 @@ static struct bio *blk_bio_segment_split(struct 
request_queue *q,
 
 /**
  * __blk_queue_split - split a bio and submit the second half
- * @q:   [in] request queue pointer
  * @bio: [in, out] bio to be split
  * @nr_segs: [out] number of segments in the first bio
  *
  * Split a bio into two bios, chain the two bios, submit the second half and
  * store a pointer to the first half in *@bio. If the second bio is still too
  * big it will be split by a recursive call to this function. Since this
- * function may allocate a new bio from @q->bio_split, it is the responsibility
- * of the caller to ensure that @q is only released after processing of the
+ * function may allocate a new bio from @bio->bi_disk->queue->bio_split, it is
+ * the responsibility of the caller to ensure that
+ * @bio->bi_disk->queue->bio_split is only released after processing of the
  * split bio has finished.
  */
-void __blk_queue_split(struct request_queue *q, struct bio **bio,
-   unsigned int *nr_segs)
+void __blk_queue_split(struct bio **bio, unsigned int *nr_segs)
 {
+   struct request_queue *q = (*bio)->bi_disk->queue;
struct bio *split = NULL;
 
switch (bio_op(*bio)) {
@@ -345,20 +345,19 @@ void __blk_queue_split(struct request_queue *q, struct 
bio **bio,
 
 /**
  * blk_queue_split - split a bio and submit the second half
- * @q:   [in] request queue pointer
  * @bio: [in, out] bio to be split
  *
  * Split a bio into two bios, chains the two bios, submit the second half and
  * store a pointer to the first half in *@bio. Since this function may allocate
- * a new bio from @q->bio_split, it is the responsibility of the caller to
- * ensure that @q is only released after processing of the split bio has
- * finished.
+ * a new bio from @bio->bi_disk->queue->bio_split, it is the responsibility of
+ * the caller to ensure that @bio->bi_disk->queue->bio_split is only released
+ * after processing of the split bio has finished.
  */
-void blk_queue_split(struct request_queue *q, struct bio **bio)
+void blk_queue_split(struct bio **bio)
 {
unsigned int nr_segs;
 
-   __blk_queue_split(q, bio, _segs);
+   __blk_queue_split(bio, _segs);
 }
 EXPORT_SYMBOL(blk_queue_split);
 
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 72d3034fe39d87..40b8d8ba894d5e 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -2086,7 +2086,7 @@ blk_qc_t blk_mq_make_request(struct request_queue *q, 
struct bio *bio)
blk_status_t ret;
 
blk_queue_bounce(q, );
-   __blk_queue_split(q, , _segs);
+   __blk_queue_split(, _segs);
 
if (!bio_integrity_prep(bio))
goto queue_exit;
diff --git a/block/blk.h b/block/blk.h
index 41a50880c94e98..90416cdc40a36a 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -225,8 +225,7 @@ ssize_t part_timeout_show(struct device *, struct 
device_attribute *, char *);
 ssize_t part_timeout_store(struct device *, struct device_attribute *,
const char *, size_t);
 
-void __blk_queue_split(struct request_queue *q, struct bio **bio,
-   unsigned int *nr_segs);
+void __blk_queue_split(struct bio **bio, unsigned int *nr_segs);
 int ll_back_merge_fn(struct request *req, struct bio *bio,
unsigned int nr_segs);
 int ll_front_merge_fn(struct request *req,  struct bio *bio,
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 3f09b2ab977822..9368680474223a 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1598,7 +1598,7 @@ blk_qc_t drbd_make_request(struct request_queue *q, 
struct bio *bio)
struct drbd_device *device = bio->bi_disk->private_data;
unsigned long start_jif;
 
-   blk_queue_split(q, );
+   blk_queue_split();
 
start_jif = jiffies;
 
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 27a33adc41e487..29b0c62dc86c1f 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2434,7 +2434,7 @@ static blk_qc_t