Thread (4 messages) 4 messages, 3 authors, 2023-02-27

Re: [PATCH v2] blk-mq: enforce op-specific segment limits in blk_insert_cloned_request

From: Uday Shankar <hidden>
Date: 2023-02-23 19:34:52
Also in: dm-devel

On Wed, Feb 22, 2023 at 12:16:02PM -0700, Keith Busch wrote:
On Wed, Feb 22, 2023 at 11:52:25AM -0700, Uday Shankar wrote:
quoted
 static inline unsigned int blk_rq_get_max_segments(struct request *rq)
 {
-	if (req_op(rq) == REQ_OP_DISCARD)
-		return queue_max_discard_segments(rq->q);
-	return queue_max_segments(rq->q);
+	return blk_queue_get_max_segments(rq->q, req_op(rq));
 }
I think you should just move this function to blk.h instead of
introducing a new one.
I chose to add blk_queue_get_max_segments as a public function because
it parallels blk_queue_get_max_sectors. If you don't want two functions,
I could manually inline the (2) uses of blk_rq_get_max_segments(rq),
converting them to blk_queue_get_max_segments(rq->q, req_op(rq)).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help