From: Jens Axboe <jens.axboe@oracle.com> Date: Thu, 18 Oct 2007 12:55:17 +0200One core issue here is that we need to decide whether this thing to be iterated like an array or like a linked list. It's trying to be both. If we decide upon a looping construct for consumers and stick to it, we'll be in much better shape than we are now and bugs will be eaiser to spot. It would be so much simpler to audit if all we saw in the consumers were things like: while (sg) { do_stuff(sg); sg = sg_next(sg); } I would suggest that we just get it over with and convert the whole tree now rather than trying to do this kind of thing in stages. Because then we can say that ever scatterlist creator has to set the "end" bit and therefore you use well established patterns for scatterlist iteration such as "traverse sg_next() until NULL" as shown above. I also noticed that there is the issue of on-stack and embedded scatterlist users. We'll need some sort of "DECLARE_SCATTERLIST" and a "scatterlist_init()" thing so that we can keep DEBUG_SG working even in those cases. But for all I know Jens could be working on that already :-) The only other real option if we don't convert the whole tree now to the "end" marker stuff, is to enforce that every scatterlist iterator only traverse the number of entries there were told are in the one given to them. -
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| David Miller | Re: [RFC/PATCH] Documentation of kernel messages |
| Tony Lindgren | [PATCH 48/90] ARM: OMAP: I2C-1 init fix for 2430 |
git: | |
| Josip Rodin | bnx2_poll panicking kernel |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
