From: Jan Hudec <bulb@ucw.cz>
To: Ian Kent <raven@themaw.net>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: Some questions about memory allocation and BKL
Date: Sun, 26 Oct 2003 15:01:13 +0100 [thread overview]
Message-ID: <20031026140113.GL1465@vagabond> (raw)
In-Reply-To: <Pine.LNX.4.44.0310262103180.3029-100000@raven.themaw.net>
On Sun, Oct 26, 2003 at 21:21:31 +0800, Ian Kent wrote:
> On Sun, 26 Oct 2003, Jan Hudec wrote:
> > No. It is forbiden to turn dentry to negative one unless you are the
> > only holder (it has refcount 1). See d_delete().
>
> Sorry, my bad description. I was thinking about if (...) to check
> fields which I think, acording to the discussion, is OK but ...
inode and name are constant, so don't need lock. all the lists need
dcache_lock (subdirs, hash etc...). Parent should need dcache_lock too
(try to look it up in rename code). I don't know about mountpoint, but
obviously requires some locking.
> > You only need to hold the lock when you check whether the dentry is
> > hashed. And you need to use the atomic_* functions to access the
> > refcount.
>
> Does that also include tests on a list in the dentry.
> I think that you said that this is what needs the lock, correct?
>
> For example:
>
> if (!d_mountpoint(dentry) && list_empty(&dentry->d_subdirs))
> ...
>
> needs the dcache_lock?
I assume yes. The tree lists should need dcache_lock.
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
next prev parent reply other threads:[~2003-10-26 14:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-26 4:42 Some questions about memory allocation and BKL Ian Kent
2003-10-26 9:44 ` Jan Hudec
2003-10-26 11:27 ` Ian Kent
2003-10-26 12:43 ` Jan Hudec
2003-10-26 13:21 ` Ian Kent
2003-10-26 14:01 ` Jan Hudec [this message]
2003-10-26 15:59 ` Ian Kent
2003-10-26 15:54 ` Jan Hudec
2003-10-26 18:37 ` dirty buffer_head, but not marked dirty Mark B
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=20031026140113.GL1465@vagabond \
--to=bulb@ucw.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=raven@themaw.net \
/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