* two simple block patches
@ 2015-02-11 13:07 Christoph Hellwig
2015-02-11 13:07 ` [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov Christoph Hellwig
2015-02-11 13:07 ` [PATCH 2/2] block: remove unused function blk_bio_map_sg Christoph Hellwig
0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2015-02-11 13:07 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
First is a fix for a regression recently introduced by me in the
block/for-next tree, and the second is a trivial removal of an
unused function.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov
2015-02-11 13:07 two simple block patches Christoph Hellwig
@ 2015-02-11 13:07 ` Christoph Hellwig
2015-02-11 18:23 ` Jens Axboe
2015-02-11 13:07 ` [PATCH 2/2] block: remove unused function blk_bio_map_sg Christoph Hellwig
1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2015-02-11 13:07 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] block: remove unused function blk_bio_map_sg
2015-02-11 13:07 two simple block patches Christoph Hellwig
2015-02-11 13:07 ` [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov Christoph Hellwig
@ 2015-02-11 13:07 ` Christoph Hellwig
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2015-02-11 13:07 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-kernel
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-merge.c | 29 -----------------------------
include/linux/blkdev.h | 2 --
2 files changed, 31 deletions(-)
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 89b97b5..891611a 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -283,35 +283,6 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
}
EXPORT_SYMBOL(blk_rq_map_sg);
-/**
- * blk_bio_map_sg - map a bio to a scatterlist
- * @q: request_queue in question
- * @bio: bio being mapped
- * @sglist: scatterlist being mapped
- *
- * Note:
- * Caller must make sure sg can hold bio->bi_phys_segments entries
- *
- * Will return the number of sg entries setup
- */
-int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
- struct scatterlist *sglist)
-{
- struct scatterlist *sg = NULL;
- int nsegs;
- struct bio *next = bio->bi_next;
- bio->bi_next = NULL;
-
- nsegs = __blk_bios_map_sg(q, bio, sglist, &sg);
- bio->bi_next = next;
- if (sg)
- sg_mark_end(sg);
-
- BUG_ON(bio->bi_phys_segments && nsegs > bio->bi_phys_segments);
- return nsegs;
-}
-EXPORT_SYMBOL(blk_bio_map_sg);
-
static inline int ll_new_hw_segment(struct request_queue *q,
struct request *req,
struct bio *bio)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bf4ef66..7f9a516 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1049,8 +1049,6 @@ extern void blk_queue_flush_queueable(struct request_queue *q, bool queueable);
extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *);
-extern int blk_bio_map_sg(struct request_queue *q, struct bio *bio,
- struct scatterlist *sglist);
extern void blk_dump_rq_flags(struct request *, char *);
extern long nr_blockdev_pages(void);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov
2015-02-11 13:07 ` [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov Christoph Hellwig
@ 2015-02-11 18:23 ` Jens Axboe
0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2015-02-11 18:23 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-kernel
On 02/11/2015 06:07 AM, Christoph Hellwig wrote:
> 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.
So this fixes a regression caused by:
commit ddad8dd0a162fde61646a627a3017c258601dc8a
Author: Christoph Hellwig <hch@lst.de>
Date: Sun Jan 18 16:16:29 2015 +0100
block: use blk_rq_map_user_iov to implement blk_rq_map_user
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
which we should probably note in the commit. I'll add that.
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-11 18:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-11 13:07 two simple block patches Christoph Hellwig
2015-02-11 13:07 ` [PATCH 1/2] block: handle the null_mapped flag correctly in blk_rq_map_user_iov Christoph Hellwig
2015-02-11 18:23 ` Jens Axboe
2015-02-11 13:07 ` [PATCH 2/2] block: remove unused function blk_bio_map_sg Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.