From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997AbbBKNJY (ORCPT ); Wed, 11 Feb 2015 08:09:24 -0500 Received: from casper.infradead.org ([85.118.1.10]:38156 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbbBKNJU (ORCPT ); Wed, 11 Feb 2015 08:09:20 -0500 From: Christoph Hellwig To: Jens Axboe 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 Message-Id: <1423660070-24652-2-git-send-email-hch@lst.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423660070-24652-1-git-send-email-hch@lst.de> References: <1423660070-24652-1-git-send-email-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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