netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6][NET-2.6.24] Consolidate private allocations in seq files
@ 2007-10-09 15:50 Pavel Emelyanov
  2007-10-09 15:52 ` [PATCH 1/6][NET-2.6.24] Introduce the seq_open_private() Pavel Emelyanov
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Pavel Emelyanov @ 2007-10-09 15:50 UTC (permalink / raw)
  To: David Miller; +Cc: Linux Netdev List, devel

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).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-10-10  9:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-09 15:50 [PATCH 0/6][NET-2.6.24] Consolidate private allocations in seq files Pavel Emelyanov
2007-10-09 15:52 ` [PATCH 1/6][NET-2.6.24] Introduce the seq_open_private() Pavel Emelyanov
2007-10-10  9:32   ` David Miller
2007-10-09 15:55 ` [PATCH 2/6][NET-2.6.24] Make core networking code use seq_open_private Pavel Emelyanov
2007-10-10  9:32   ` David Miller
2007-10-09 15:57 ` [PATCH 3/6][NET-2.6.24] Make netfilter code use the seq_open_private Pavel Emelyanov
2007-10-10  9:33   ` David Miller
2007-10-09 15:59 ` [PATCH 4/6][NET-2.6.24] Make decnet code use the seq_open_private() Pavel Emelyanov
2007-10-10  9:33   ` David Miller
2007-10-09 16:01 ` [PATCH 5/6][NET-2.6.24] Make the IRDA " Pavel Emelyanov
2007-10-10  9:33   ` David Miller
2007-10-09 16:04 ` [PATCH 6/6][NET-2.6.24] Make the sunrpc " Pavel Emelyanov
2007-10-10  9:33   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).