On Fri, 26 Oct 2007, Paul Mackerras wrote:Yes, for allocation purposes you'd need the size ahead of time, agreed. Otherwise you have to walk the list twice. Hmm. Depending on where you do this, and if this is some block-layer specific driver/code (rather than necessarily a generic SG thing), you do have the req->nr_phys_segments thing which should be that for you (ie the SG list may have _fewer_ requests in it in case some of those entries got squashed together due to be contiguous). But yeah, I don't think it would be wrong at all to have a struct scatterlist_head { unsigned int entries; unsigned int flags; /* ? */ struct scatterlist *sg; }; which would be passed down at higher levels. Linus -
| Linus Torvalds | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Artem Bityutskiy | [RFC PATCH 06/26] UBIFS: add superblock and master node |
| Joe Perches | [PATCH 001/148] include/asm-x86/acpi.h: checkpatch cleanups - formatting only |
| Linus Torvalds | Re: LSM conversion to static interface |
git: | |
| Alexey Dobriyan | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Christoph Lameter | Network latency regressions from 2.6.22 to 2.6.29 |
