Skip to contentSkip to conversation

clean up a few end_request variants

PATCH In review Christoph Hellwig 3 participants 7 messages Apr 12, 2017 – Apr 19, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

Just some trivial cleanup patches that I'd like to offload from a big series in the pipe..

#1 lore raw

PATCH 1/3 block: remove blk_end_request_err and __blk_end_request_err

Both functions are entirely unused.

---
 block/blk-core.c       | 39 ---------------------------------------
 include/linux/blkdev.h |  2 --
 2 files changed, 41 deletions(-)
block/blk-core.c +0 -39
index 4f95bdaa1e16..8aee417c1e4f 100644
@@ -2856,25 +2856,6 @@ bool blk_end_request_cur(struct request *rq, int error)
 EXPORT_SYMBOL(blk_end_request_cur);
 
 /**
- * blk_end_request_err - Finish a request till the next failure boundary.
- * @rq: the request to finish till the next failure boundary for
- * @error: must be negative errno
- *
- * Description:
- *     Complete @rq till the next failure boundary.
- *
- * Return:
- *     %false - we are done with this request
- *     %true  - still buffers pending for this request
- */
-bool blk_end_request_err(struct request *rq, int error)
-{
-	WARN_ON(error >= 0);
-	return blk_end_request(rq, error, blk_rq_err_bytes(rq));
-}
-EXPORT_SYMBOL_GPL(blk_end_request_err);
-
-/**
  * __blk_end_request - Helper function for drivers to complete the request.
  * @rq:       the request being processed
  * @error:    %0 for success, < %0 for error
@@ -2933,26 +2914,6 @@ bool __blk_end_request_cur(struct request *rq, int error)
 }
 EXPORT_SYMBOL(__blk_end_request_cur);
 
-/**
- * __blk_end_request_err - Finish a request till the next failure boundary.
- * @rq: the request to finish till the next failure boundary for
- * @error: must be negative errno
- *
- * Description:
- *     Complete @rq till the next failure boundary.  Must be called
- *     with queue lock held.
- *
- * Return:
- *     %false - we are done with this request
- *     %true  - still buffers pending for this request
- */
-bool __blk_end_request_err(struct request *rq, int error)
-{
-	WARN_ON(error >= 0);
-	return __blk_end_request(rq, error, blk_rq_err_bytes(rq));
-}
-EXPORT_SYMBOL_GPL(__blk_end_request_err);
-
 void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
 		     struct bio *bio)
 {
include/linux/blkdev.h +0 -2
index f912ddc39020..3b6201b1cd0e 100644
@@ -1128,12 +1128,10 @@ extern bool blk_end_request(struct request *rq, int error,
 			    unsigned int nr_bytes);
 extern void blk_end_request_all(struct request *rq, int error);
 extern bool blk_end_request_cur(struct request *rq, int error);
-extern bool blk_end_request_err(struct request *rq, int error);
 extern bool __blk_end_request(struct request *rq, int error,
 			      unsigned int nr_bytes);
 extern void __blk_end_request_all(struct request *rq, int error);
 extern bool __blk_end_request_cur(struct request *rq, int error);
-extern bool __blk_end_request_err(struct request *rq, int error);
 
 extern void blk_complete_request(struct request *);
 extern void __blk_complete_request(struct request *);
Signature · 1 line
2.11.0
#3 lore raw

PATCH 2/3 block: remove blk_end_request_cur

In reply to Christoph Hellwig

This function is not used anywhere in the kernel.

---
 block/blk-core.c       | 18 ------------------
 include/linux/blkdev.h |  1 -
 2 files changed, 19 deletions(-)
block/blk-core.c +0 -18
index 8aee417c1e4f..a01af9ca0455 100644
@@ -2838,24 +2838,6 @@ void blk_end_request_all(struct request *rq, int error)
 EXPORT_SYMBOL(blk_end_request_all);
 
 /**
- * blk_end_request_cur - Helper function to finish the current request chunk.
- * @rq: the request to finish the current chunk for
- * @error: %0 for success, < %0 for error
- *
- * Description:
- *     Complete the current consecutively mapped chunk from @rq.
- *
- * Return:
- *     %false - we are done with this request
- *     %true  - still buffers pending for this request
- */
-bool blk_end_request_cur(struct request *rq, int error)
-{
-	return blk_end_request(rq, error, blk_rq_cur_bytes(rq));
-}
-EXPORT_SYMBOL(blk_end_request_cur);
-
-/**
  * __blk_end_request - Helper function for drivers to complete the request.
  * @rq:       the request being processed
  * @error:    %0 for success, < %0 for error
include/linux/blkdev.h +0 -1
index 3b6201b1cd0e..f770a17d2fbf 100644
@@ -1127,7 +1127,6 @@ extern void blk_finish_request(struct request *rq, int error);
 extern bool blk_end_request(struct request *rq, int error,
 			    unsigned int nr_bytes);
 extern void blk_end_request_all(struct request *rq, int error);
-extern bool blk_end_request_cur(struct request *rq, int error);
 extern bool __blk_end_request(struct request *rq, int error,
 			      unsigned int nr_bytes);
 extern void __blk_end_request_all(struct request *rq, int error);
Signature · 1 line
2.11.0
#5 lore raw

PATCH 3/3 block: make __blk_end_bidi_request private

In reply to Christoph Hellwig

blk_insert_flush should be using __blk_end_request to start with.

---
 block/blk-core.c  | 2 +-
 block/blk-flush.c | 2 +-
 block/blk.h       | 2 --
 3 files changed, 2 insertions(+), 4 deletions(-)
block/blk-core.c +1 -1
index a01af9ca0455..518f5d189436 100644
@@ -2785,7 +2785,7 @@ static bool blk_end_bidi_request(struct request *rq, int error,
  *     %false - we are done with this request
  *     %true  - still buffers pending for this request
  **/
-bool __blk_end_bidi_request(struct request *rq, int error,
+static bool __blk_end_bidi_request(struct request *rq, int error,
 				   unsigned int nr_bytes, unsigned int bidi_bytes)
 {
 	if (blk_update_bidi_request(rq, error, nr_bytes, bidi_bytes))
block/blk-flush.c +1 -1
index 4e951d3bf548..c4e0880b54bb 100644
@@ -447,7 +447,7 @@ void blk_insert_flush(struct request *rq)
 		if (q->mq_ops)
 			blk_mq_end_request(rq, 0);
 		else
-			__blk_end_bidi_request(rq, 0, 0, 0);
+			__blk_end_request(rq, 0, 0);
 		return;
 	}
 
block/blk.h +0 -2
index 07d375183f31..35b3041eec1a 100644
@@ -67,8 +67,6 @@ void blk_queue_bypass_start(struct request_queue *q);
 void blk_queue_bypass_end(struct request_queue *q);
 void blk_dequeue_request(struct request *rq);
 void __blk_queue_free_tags(struct request_queue *q);
-bool __blk_end_bidi_request(struct request *rq, int error,
-			    unsigned int nr_bytes, unsigned int bidi_bytes);
 void blk_freeze_queue(struct request_queue *q);
 
 static inline void blk_queue_enter_live(struct request_queue *q)
Signature · 1 line
2.11.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] block: remove blk_end_request_err and __blk_end_request_err

In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

Both functions are entirely unused.

---

Looks good,

Signature · 6 lines
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: Felix Imend�rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N�rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] block: remove blk_end_request_cur

In reply to Christoph Hellwig
Quoted 4 lines · Christoph Hellwig

This function is not used anywhere in the kernel.

---

Looks good, though one could argue it can be merged into the last patch.

Signature · 6 lines
Johannes Thumshirn                                          Storage
[email protected]                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg
GF: Felix Imend�rffer, Jane Smithard, Graham Norton
HRB 21284 (AG N�rnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
maintainer
#6 lore raw
In reply to Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

Just some trivial cleanup patches that I'd like to offload from a big series in the pipe..

Added for 4.12, thanks.

Signature · 1 line
Jens Axboe