From: John Garry <[email protected]>
To: [email protected], [email protected], [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected]
Cc: [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
John Garry <[email protected]>,
Luis Chamberlain <[email protected]>
Subject: [PATCH v8 01/10] block: Pass blk_queue_get_max_sectors() a request pointer
Date: Mon, 10 Jun 2024 10:43:20 +0000 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Currently blk_queue_get_max_sectors() is passed a enum req_op. In future
the value returned from blk_queue_get_max_sectors() may depend on certain
request flags, so pass a request pointer.
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
Reviewed-by: Luis Chamberlain <[email protected]>
Signed-off-by: John Garry <[email protected]>
---
block/blk-merge.c | 3 ++-
block/blk-mq.c | 2 +-
block/blk.h | 6 ++++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 8534c35e0497..8957e08e020c 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -593,7 +593,8 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq,
if (blk_rq_is_passthrough(rq))
return q->limits.max_hw_sectors;
- max_sectors = blk_queue_get_max_sectors(q, req_op(rq));
+ max_sectors = blk_queue_get_max_sectors(rq);
+
if (!q->limits.chunk_sectors ||
req_op(rq) == REQ_OP_DISCARD ||
req_op(rq) == REQ_OP_SECURE_ERASE)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 3b4df8e5ac9e..e690b9c6afb7 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3041,7 +3041,7 @@ void blk_mq_submit_bio(struct bio *bio)
blk_status_t blk_insert_cloned_request(struct request *rq)
{
struct request_queue *q = rq->q;
- unsigned int max_sectors = blk_queue_get_max_sectors(q, req_op(rq));
+ unsigned int max_sectors = blk_queue_get_max_sectors(rq);
unsigned int max_segments = blk_rq_get_max_segments(rq);
blk_status_t ret;
diff --git a/block/blk.h b/block/blk.h
index 189bc25beb50..75c1683fc320 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -181,9 +181,11 @@ static inline unsigned int blk_rq_get_max_segments(struct request *rq)
return queue_max_segments(rq->q);
}
-static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q,
- enum req_op op)
+static inline unsigned int blk_queue_get_max_sectors(struct request *rq)
{
+ struct request_queue *q = rq->q;
+ enum req_op op = req_op(rq);
+
if (unlikely(op == REQ_OP_DISCARD || op == REQ_OP_SECURE_ERASE))
return min(q->limits.max_discard_sectors,
UINT_MAX >> SECTOR_SHIFT);
--
2.31.1
next prev parent reply other threads:[~2024-06-10 10:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 10:43 [PATCH v8 00/10] block atomic writes John Garry
2024-06-10 10:43 ` John Garry [this message]
2024-06-10 10:43 ` [PATCH v8 02/10] block: Generalize chunk_sectors support as boundary support John Garry
2024-06-10 10:43 ` [PATCH v8 03/10] fs: Initial atomic write support John Garry
2024-06-12 20:51 ` Darrick J. Wong
2024-06-10 10:43 ` [PATCH v8 04/10] fs: Add initial atomic write support info to statx John Garry
2024-06-12 20:54 ` Darrick J. Wong
2024-06-13 7:25 ` John Garry
2024-06-10 10:43 ` [PATCH v8 05/10] block: Add core atomic write support John Garry
2024-06-17 18:56 ` Keith Busch
2024-06-18 6:51 ` Christoph Hellwig
2024-06-18 7:46 ` John Garry
2024-06-18 17:25 ` Keith Busch
2024-06-19 7:59 ` John Garry
2024-06-19 8:02 ` Christoph Hellwig
2024-06-19 10:42 ` John Garry
2024-06-19 16:07 ` Martin K. Petersen
2024-06-10 10:43 ` [PATCH v8 06/10] block: Add atomic write support for statx John Garry
2024-06-10 10:43 ` [PATCH v8 07/10] block: Add fops atomic write support John Garry
2024-06-10 10:43 ` [PATCH v8 08/10] scsi: sd: Atomic " John Garry
2024-06-10 10:43 ` [PATCH v8 09/10] scsi: scsi_debug: " John Garry
2024-06-10 10:43 ` [PATCH v8 10/10] nvme: " John Garry
2024-06-17 17:24 ` Kanchan Joshi
2024-06-17 18:04 ` John Garry
2024-06-18 6:49 ` Christoph Hellwig
2024-06-18 7:22 ` John Garry
2024-06-14 2:01 ` [PATCH v8 00/10] block atomic writes Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox