linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>, Mike Snitzer <snitzer@redhat.com>
Cc: linux-block@vger.kernel.org,
	Jeffle Xu <jefflexu@linux.alibaba.com>,
	dm-devel@redhat.com, Hannes Reinecke <hare@suse.de>,
	Christoph Hellwig <hch@lst.de>, Ming Lei <ming.lei@redhat.com>
Subject: [RFC PATCH 2/4] block: add field of .bi_bio_drv_data to bio
Date: Wed, 16 Jun 2021 21:05:31 +0800	[thread overview]
Message-ID: <20210616130533.754248-3-ming.lei@redhat.com> (raw)
In-Reply-To: <20210616130533.754248-1-ming.lei@redhat.com>

After bio is submitted, bio->bi_next is used for IO merge for request
based queue only.

Reuse the filed for bio based driver for storing driver data, and name
it as .bi_bio_drv_data.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 include/linux/blk_types.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 6e6c2af48d74..acb45213338c 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -220,7 +220,16 @@ typedef unsigned int blk_qc_t;
  * stacking drivers)
  */
 struct bio {
-	struct bio		*bi_next;	/* request queue link */
+	union {
+		/* request queue link */
+		struct bio		*bi_next;
+
+		/*
+		 * once bio is submitted to bio based queue, driver can use
+		 * this field to store its own data
+		 */
+		void			*bi_bio_drv_data;
+	};
 	struct block_device	*bi_bdev;
 	unsigned int		bi_opf;		/* bottom bits req flags,
 						 * top bits REQ_OP. Use
-- 
2.31.1


  parent reply	other threads:[~2021-06-16 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 13:05 [RFC PATCH 0/4] block/dm: support bio polling Ming Lei
2021-06-16 13:05 ` [RFC PATCH 1/4] block: add helper of blk_queue_poll Ming Lei
2021-06-16 13:05 ` Ming Lei [this message]
2021-06-16 13:05 ` [RFC PATCH 3/4] block: add ->poll_bio to block_device_operations Ming Lei
2021-06-16 13:05 ` [RFC PATCH 4/4] dm: support bio polling Ming Lei
2021-06-16 16:05   ` Mike Snitzer
2021-06-17  2:14     ` Ming Lei
2021-06-18 14:33     ` Christoph Hellwig

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 \
    --in-reply-to=20210616130533.754248-3-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jefflexu@linux.alibaba.com \
    --cc=linux-block@vger.kernel.org \
    --cc=snitzer@redhat.com \
    --subject='Re: [RFC PATCH 2/4] block: add field of .bi_bio_drv_data to bio' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).