netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Emelyanov <xemul@openvz.org>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>, devel@openvz.org
Subject: [PATCH 0/6][NET-2.6.24] Consolidate private allocations in seq files
Date: Tue, 09 Oct 2007 19:50:41 +0400	[thread overview]
Message-ID: <470BA351.3070208@openvz.org> (raw)

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>

             reply	other threads:[~2007-10-09 15:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09 15:50 Pavel Emelyanov [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=470BA351.3070208@openvz.org \
    --to=xemul@openvz.org \
    --cc=davem@davemloft.net \
    --cc=devel@openvz.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).