mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@fb.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov
Date: Wed, 11 Feb 2015 14:07:49 +0100	[thread overview]
Message-ID: <1423660070-24652-2-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1423660070-24652-1-git-send-email-hch@lst.de>

The tape drivers (and the sg driver in a special case that doesn't matter
here) use the null_mapped flag to tell blk_rq_map_user to not copy around
any data into or out of the bounce buffers.  blk_rq_map_user_iov never
got that treatment, which didn't matter until I refactored blk_rq_map_user
to be implemented in terms of blk_rq_map_user_iov.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-map.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-map.c b/block/blk-map.c
index 0f22911..b8d2725 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -93,6 +93,9 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
 	if (IS_ERR(bio))
 		return PTR_ERR(bio);
 
+	if (map_data && map_data->null_mapped)
+		bio->bi_flags |= (1 << BIO_NULL_MAPPED);
+
 	if (bio->bi_iter.bi_size != iter->count) {
 		/*
 		 * Grab an extra reference to this bio, as bio_unmap_user()
-- 
1.9.1


  reply	other threads:[~2015-02-11 13:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11 13:07 two simple block patches Christoph Hellwig
2015-02-11 13:07 ` Christoph Hellwig [this message]
2015-02-11 18:23   ` [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov Jens Axboe
2015-02-11 13:07 ` [PATCH 2/2] block: remove unused function blk_bio_map_sg 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=1423660070-24652-2-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®