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

On 4/24/06, Pekka Enberg <penberg@cs.helsinki.fi> wrote:
> 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
Tx. Your solution worked.

      reply	other threads:[~2006-04-24 21:25 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
2006-04-24 21:24   ` Joshua Hudson [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=bda6d13a0604241424r503d1b87jb44d1df1a11feb3b@mail.gmail.com \
    --to=joshudson@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@cs.helsinki.fi \
    /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®