On Thu, 18 Oct 2007, Jens Axboe wrote:Umm. May I suggest (I haven't read the whole thread yet, maybe somebody else already did) that static inline unsigned long sg_phys(struct scatterlist *sg) { return page_to_phys(sg_page(sg)) + sg->offset; } would be a good thing to have? Very few drivers should care so much about the *page* itself (or the offset). That's something that the generic allocation code etc cares about, but the driver is almost bound to care mostly about the actual DMA address, so adding that helper function that abstracts the sg access would be helpful in hiding some of the cruft? Linus -
