public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Corry <kevcorry@us.ibm.com>
To: dm-devel@redhat.com
Cc: Alasdair G Kergon <agk@redhat.com>, Adrian Bunk <bunk@stusta.de>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [dm-devel] Re: [2.6 patch] dm: remove unused functions (fwd)
Date: Wed, 1 Dec 2004 08:41:06 -0600	[thread overview]
Message-ID: <200412010841.06954.kevcorry@us.ibm.com> (raw)
In-Reply-To: <20041130230525.GC24233@agk.surrey.redhat.com>

On Tuesday 30 November 2004 5:05 pm, Alasdair G Kergon wrote:
> On Mon, Nov 29, 2004 at 03:29:40AM +0100, Adrian Bunk wrote:
> > Please apply or comment on it.
>
> Please check *why* the functions aren't used first.
>
> e.g. An alloc function with a corresponding free that
> never gets called suggests a leak to me...

That one isn't a leak (referring to "kmem_cache_t *exception_cache" in 
dm-snap.c). Items are allocated from this cache using alloc_exception(). This 
can happen either when an existing snapshot is activated and it's exception 
table is read from disk into an in-memory hash-table, or when a copy-on-write 
completes and a new exception is added to this hash-table. As long as the 
snapshot is active, this hash-table remains in memory and items cannot be 
removed from it. When the snapshot is deactivated, we call 
exit_exception_table() and pass it a pointer to this hash-table and 
exception_cache. This routine calls kmem_cache_free() directly instead of 
using the free_exception() routine. The reason it doesn't use 
free_exception() is that exit_exception_table() is used to tear down two 
different but somewhat similar hash-tables, each of which uses a different 
kmem_cache_t.

So, it may be nice to keep the symmetric routines defined (alloc_exception() 
and free_exception()), but Adrian is correct in that the later is not being 
used, and it really can't be used without some more significant code changes.

As for bs_bio_init(), it can be safely removed. It was just a duplicate of 
bio_init() from fs/bio.c. The use of that call in dm-io.c was changed to use 
bio_init(), but apparently the routine itself was never removed.

-- 
Kevin Corry
kevcorry@us.ibm.com
http://evms.sourceforge.net/

      parent reply	other threads:[~2004-12-01 14:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-29  2:29 [2.6 patch] dm: remove unused functions (fwd) Adrian Bunk
2004-11-30 23:05 ` Alasdair G Kergon
2004-12-01  4:54   ` Adrian Bunk
2004-12-01 14:41   ` Kevin Corry [this message]

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=200412010841.06954.kevcorry@us.ibm.com \
    --to=kevcorry@us.ibm.com \
    --cc=agk@redhat.com \
    --cc=akpm@osdl.org \
    --cc=bunk@stusta.de \
    --cc=dm-devel@redhat.com \
    --cc=linux-kernel@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