* [PATCH, scsi-block-2.6] remove bio_map_user
@ 2005-06-19 9:29 Christoph Hellwig
2005-06-20 10:37 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2005-06-19 9:29 UTC (permalink / raw)
To: axboe, jejb; +Cc: linux-scsi
It's only used by blk_rq_map_user and that's the only sensible caller.
So do the iov wrapping there and kill bio_map_user.
Index: linux-2.6/drivers/block/ll_rw_blk.c
===================================================================
--- linux-2.6.orig/drivers/block/ll_rw_blk.c 2005-06-18 17:15:17.000000000 +0200
+++ linux-2.6/drivers/block/ll_rw_blk.c 2005-06-18 17:26:55.000000000 +0200
@@ -2126,9 +2126,10 @@
* direct dma. else, set up kernel bounce buffers
*/
uaddr = (unsigned long) ubuf;
- if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q)))
- bio = bio_map_user(q, NULL, uaddr, len, reading);
- else
+ if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q))) {
+ struct sg_iovec iov = { .iov_base = ubuf, .iov_len = len };
+ bio = bio_map_user_iov(q, NULL, &iov, 1, reading);
+ } else
bio = bio_copy_user(q, uaddr, len, reading);
if (!IS_ERR(bio)) {
Index: linux-2.6/fs/bio.c
===================================================================
--- linux-2.6.orig/fs/bio.c 2005-06-18 17:15:21.000000000 +0200
+++ linux-2.6/fs/bio.c 2005-06-18 17:26:42.000000000 +0200
@@ -662,28 +662,6 @@
}
/**
- * bio_map_user - map user address into bio
- * @q: the request_queue_t for the bio
- * @bdev: destination block device
- * @uaddr: start of user address
- * @len: length in bytes
- * @write_to_vm: bool indicating writing to pages or not
- *
- * Map the user space address into a bio suitable for io to a block
- * device. Returns an error pointer in case of error.
- */
-struct bio *bio_map_user(request_queue_t *q, struct block_device *bdev,
- unsigned long uaddr, unsigned int len, int write_to_vm)
-{
- struct sg_iovec iov;
-
- iov.iov_base = (__user void *)uaddr;
- iov.iov_len = len;
-
- return bio_map_user_iov(q, bdev, &iov, 1, write_to_vm);
-}
-
-/**
* bio_map_user_iov - map user sg_iovec table into bio
* @q: the request_queue_t for the bio
* @bdev: destination block device
@@ -1222,7 +1200,6 @@
EXPORT_SYMBOL(bio_hw_segments);
EXPORT_SYMBOL(bio_add_page);
EXPORT_SYMBOL(bio_get_nr_vecs);
-EXPORT_SYMBOL(bio_map_user);
EXPORT_SYMBOL(bio_unmap_user);
EXPORT_SYMBOL(bio_map_kern);
EXPORT_SYMBOL(bio_pair_release);
Index: linux-2.6/include/linux/bio.h
===================================================================
--- linux-2.6.orig/include/linux/bio.h 2005-06-18 17:15:21.000000000 +0200
+++ linux-2.6/include/linux/bio.h 2005-06-18 17:26:16.000000000 +0200
@@ -279,8 +279,6 @@
extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
extern int bio_get_nr_vecs(struct block_device *);
-extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
- unsigned long, unsigned int, int);
struct sg_iovec;
extern struct bio *bio_map_user_iov(struct request_queue *,
struct block_device *,
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH, scsi-block-2.6] remove bio_map_user
2005-06-19 9:29 [PATCH, scsi-block-2.6] remove bio_map_user Christoph Hellwig
@ 2005-06-20 10:37 ` Jens Axboe
2005-06-20 10:36 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2005-06-20 10:37 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jejb, linux-scsi
On Sun, Jun 19 2005, Christoph Hellwig wrote:
> It's only used by blk_rq_map_user and that's the only sensible caller.
That's not really true, there is/are valid uses of bio_map_user() alone.
> So do the iov wrapping there and kill bio_map_user.
While I do agree with the change, I know of external users of
bio_map_user(). It's a really trivial piece of code, so I would rather
just let bio_map_user() stay as-is.
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, scsi-block-2.6] remove bio_map_user
2005-06-20 10:37 ` Jens Axboe
@ 2005-06-20 10:36 ` Christoph Hellwig
2005-06-20 10:41 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2005-06-20 10:36 UTC (permalink / raw)
To: Jens Axboe; +Cc: Christoph Hellwig, jejb, linux-scsi
On Mon, Jun 20, 2005 at 12:37:13PM +0200, Jens Axboe wrote:
> On Sun, Jun 19 2005, Christoph Hellwig wrote:
> > It's only used by blk_rq_map_user and that's the only sensible caller.
>
> That's not really true, there is/are valid uses of bio_map_user() alone.
That would be?
>
> > So do the iov wrapping there and kill bio_map_user.
>
> While I do agree with the change, I know of external users of
> bio_map_user().
Who's that?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, scsi-block-2.6] remove bio_map_user
2005-06-20 10:36 ` Christoph Hellwig
@ 2005-06-20 10:41 ` Jens Axboe
2005-06-20 10:42 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2005-06-20 10:41 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jejb, linux-scsi
On Mon, Jun 20 2005, Christoph Hellwig wrote:
> On Mon, Jun 20, 2005 at 12:37:13PM +0200, Jens Axboe wrote:
> > On Sun, Jun 19 2005, Christoph Hellwig wrote:
> > > It's only used by blk_rq_map_user and that's the only sensible caller.
> >
> > That's not really true, there is/are valid uses of bio_map_user() alone.
>
> That would be?
Stacking drivers or file systems.
> >
> > > So do the iov wrapping there and kill bio_map_user.
> >
> > While I do agree with the change, I know of external users of
> > bio_map_user().
>
> Who's that?
ocfs2, iirc.
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, scsi-block-2.6] remove bio_map_user
2005-06-20 10:41 ` Jens Axboe
@ 2005-06-20 10:42 ` Christoph Hellwig
2005-06-20 10:59 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2005-06-20 10:42 UTC (permalink / raw)
To: Jens Axboe; +Cc: jejb, linux-scsi
On Mon, Jun 20, 2005 at 12:41:14PM +0200, Jens Axboe wrote:
> > That would be?
>
> Stacking drivers or file systems.
Doesn't make sense, a stacking driver must not deal with locking down
user memory at all, and for filesystem there's better helpers in
fs/direct-io.c
> > > While I do agree with the change, I know of external users of
> > > bio_map_user().
> >
> > Who's that?
>
> ocfs2, iirc.
ocfs2 doesn't use bio_map_user
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH, scsi-block-2.6] remove bio_map_user
2005-06-20 10:42 ` Christoph Hellwig
@ 2005-06-20 10:59 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2005-06-20 10:59 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: jejb, linux-scsi
On Mon, Jun 20 2005, Christoph Hellwig wrote:
> On Mon, Jun 20, 2005 at 12:41:14PM +0200, Jens Axboe wrote:
> > > That would be?
> >
> > Stacking drivers or file systems.
>
> Doesn't make sense, a stacking driver must not deal with locking down
> user memory at all, and for filesystem there's better helpers in
That's a very generic statement to make, there could be valid uses of
that. But the point of the matter is that I don't think we should just
remove bio_map_user() and intentionally break an exported API to save a
few bytes. We are not talking a lot of code, it's just a wrapper.
> fs/direct-io.c
That's true, I'll give you that.
> > > > While I do agree with the change, I know of external users of
> > > > bio_map_user().
> > >
> > > Who's that?
> >
> > ocfs2, iirc.
>
> ocfs2 doesn't use bio_map_user
It did at some point in time, I don't track the tree so apparently they
stopped doing so at some point.
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-06-20 10:58 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-19 9:29 [PATCH, scsi-block-2.6] remove bio_map_user Christoph Hellwig
2005-06-20 10:37 ` Jens Axboe
2005-06-20 10:36 ` Christoph Hellwig
2005-06-20 10:41 ` Jens Axboe
2005-06-20 10:42 ` Christoph Hellwig
2005-06-20 10:59 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox