Consolidate private allocations in seq files
Status from this message: Applied, nice cleanup Pavel.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | Introduce the seq_open_private()fs/ include/ | +35 | 1 reply | |
| 2/6 | Make core networking code use seq_open_privatenet/ net/ net/ +12 more | +37 | 1 reply | |
| 3/6 | Make netfilter code use the seq_open_privatenet/ net/ net/ +3 more | +14 | 1 reply | |
| 4/6 | Make decnet code use the seq_open_private()net/ net/ | +4 | 1 reply | |
| 5/6 | Make the IRDA use the seq_open_private()net/ net/ net/ | +8 | 1 reply | |
| 6/6 | Make the sunrpc use the seq_open_private()net/ | +2 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/6][NET-2.6.24] Consolidate private allocations in seq files
Many (very many) seq files in net/ allocate some private data to use it later (mostly for iteration state). All this code was obviously get using copy-paste method, so move it into one place.
Almost all of these places either set this private to 0, or keep uninitialized. Some places, however, pre-initialize this area, but there are few of them.
The seq_open_private() call just opens the seq file with allocated and set to zero area. The __seq_open_private() call makes the same, but returns the allocated memory to the called to be initialized later.
I didn't measure how much of the .text section this saves, but I suspect a lot of :) As far as the code is concerned, this set saves ~450 lines.
Such thing may be useful for any subsystem, but I found this mostly in the networking code and fixed only it (for a while).