I have to say that I think this patch is ugly, and a complete duplicate
of existing code. This is always bad, especially in the case of
something not really straight forward (like blk_rq_map_sg()). A hack.
I can understand the need for something like this, for drivers that
can't use a struct scatterlist directly. I'd rather do this in a
different way, though.
__blk_rq_map(q, rq, sglist, callback)
{
...
/* do the mapping *.
if (sglist) {
sglist[nsegs].page = bvec->bv_page;
...
} else
callback(q, bvec, nsegs);
}
blk_rq_map_rq(q, rq, sglist)
{
return __blk_rq_map(q, rq, sglist, NULL);
}
blk_rq_map_callback(q, rq, callback)
{
return __blk_rq_map(q, rq, NULL, callback);
}
Or use a cookie like you currently do.
Oh, and do try to follow the style. It's
if (cond)
foo();
not
if (fond) foo();
-- 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/