Sure you can do that, you would probably have to provide quite a bit of
the mapping infrastructure (or make it generic, probably Ben's work in
this area would be the best way forward). But bio is a generic container
for block I/O, and you are allowed to use it directly.
> 2) I don't see how to wait for a "bio" to complete. I don't see any
> wait_queue in bio structure. How can I wait for bio to complete ?
allocate a private bio, and you 'own' the bi_private and bi_end_io. So
you could do something ala
DECLARE_COMPLETION(wait);
bio = bio_alloc(GFP_XXX, 1);
/* fill in bvec, target, etc */
bio->bi_private = &wait;
bio->bi_end_io = my_end_io;
...
wait_for_completion(&wait);
int my_end_io(struct bio *bio, int nr_sectors)
{
struct completion *wait = bio->bi_private;
/* do end i/o stuff */
...
/* wake up waiters */
complete(wait);
return 0;
}
-- Jens Axboe- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/