On Thu, 25 Oct 2007, Rusty Russell wrote:Nobody should *ever* walk the list to find the length. Does anybody really do that? Yes, we pass the thing down, but do people *need* it? [ Side note: some of the users of that length currently would seem to be buggy in the presense of continuation entries, and seem to assume that the "list" is just a contiguous array. In fatc, that's almost the only valid use for the "count" thing, since any other use _has_ to walk it entry by entry anyway, no? ] The thing is, nobody should care. You walk the list to fill things in, or to write it out to some HW-specific DMA table, you should never care about the length. However, you *do* care about the "where does it end" part: to be able to detect overflows (which should never happen, but from a debugging standpoint it needs to be detectable rather than just silently use or corrupt memory). But if people really want/need the length, then we damn well should have a "header" thing, not two independent "list + length" parameters. Linus -
| Stephane Jourdois | Re: 2.6.21-rc4-mm1 [PATCH] init/missing_syscalls.h fix |
| David Brown | Re: Linux 2.6.21-rc2 |
| Andi Kleen | [PATCH] [1/12] x86: Work around mmio config space quirk on AMD Fam10h |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| David Miller | Re: [GIT]: Networking |
| David Woodhouse | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
git: | |
