mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: "Joshua Hudson" <joshudson@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Filesystem & mutex
Date: Mon, 24 Apr 2006 14:19:15 +0300	[thread overview]
Message-ID: <84144f020604240419w190d03cdld53432da8df6277b@mail.gmail.com> (raw)
In-Reply-To: <bda6d13a0604232154r28f23212o55b15a065fe6d648@mail.gmail.com>

Hi,

On 4/24/06, Joshua Hudson <joshudson@gmail.com> wrote:
> My filesystem has need of an extra mutex in the extended inode data area.
> From what I understand, the mutex can be initalized in inode_init_once, but
> I cannot determine how to free it.
>
> It looks wrong to destroy the mutex by just destroying the slab.
> It is wrong to destroy the inode in destroy_inode. Badness when
> an inode is reused.

There's no need to 'release' a mutex. If the mutex is unlocked, you
can do kmem_cache_free() on the owning inode. You need to do
mutex_init() in the object cache constructor (init_once) only because
the memory given to you can be arbitrary state. After the mutex has
been initialized, it will never go into an illegal state on its own
assuming you remember to unlock it before freeing the inode.

                                            Pekka

  reply	other threads:[~2006-04-24 11:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24  4:54 Joshua Hudson
2006-04-24 11:19 ` Pekka Enberg [this message]
2006-04-24 21:24   ` Joshua Hudson

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=84144f020604240419w190d03cdld53432da8df6277b@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --cc=joshudson@gmail.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

all inboxes | Powered by JetHome®