From: jblunck@suse.de
To: linux-kernel@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, akpm@osdl.org,
viro@zeniv.linux.org.uk, dgc@sgi.com, balbir@in.ibm.com,
neilb@suse.de
Subject: [PATCH 2/5] vfs: d_genocide() doesnt add dentries to unused list
Date: Fri, 16 Jun 2006 12:43:23 +0200 [thread overview]
Message-ID: <20060616104322.204073000@hasse.suse.de> (raw)
In-Reply-To: 20060616104321.778718000@hasse.suse.de
[-- Attachment #1: patches.jbl/vfs-d_genocide-fix.diff --]
[-- Type: text/plain, Size: 1188 bytes --]
Calling d_genocide() is only lowering the reference count of the dentries but
doesn't add them to the unused list.
Signed-off-by: Jan Blunck <jblunck@suse.de>
---
fs/dcache.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
Index: work-2.6/fs/dcache.c
===================================================================
--- work-2.6.orig/fs/dcache.c
+++ work-2.6/fs/dcache.c
@@ -1612,11 +1612,25 @@ resume:
this_parent = dentry;
goto repeat;
}
- atomic_dec(&dentry->d_count);
+ if (!list_empty(&dentry->d_lru)) {
+ dentry_stat.nr_unused--;
+ list_del_init(&dentry->d_lru);
+ }
+ if (atomic_dec_and_test(&dentry->d_count)) {
+ list_add(&dentry->d_lru, dentry_unused.prev);
+ dentry_stat.nr_unused++;
+ }
}
if (this_parent != root) {
next = this_parent->d_u.d_child.next;
- atomic_dec(&this_parent->d_count);
+ if (!list_empty(&this_parent->d_lru)) {
+ dentry_stat.nr_unused--;
+ list_del_init(&this_parent->d_lru);
+ }
+ if (atomic_dec_and_test(&this_parent->d_count)) {
+ list_add(&this_parent->d_lru, dentry_unused.prev);
+ dentry_stat.nr_unused++;
+ }
this_parent = this_parent->d_parent;
goto resume;
}
next prev parent reply other threads:[~2006-06-16 10:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-16 10:43 [PATCH 0/5] vfs: per-superblock unused dentries list (3rd version) jblunck
2006-06-16 10:43 ` [PATCH 1/5] vfs: remove whitespace noise from fs/dcache.c jblunck
2006-06-16 10:43 ` jblunck [this message]
2006-06-18 19:34 ` [PATCH 2/5] vfs: d_genocide() doesnt add dentries to unused list Balbir Singh
2006-06-19 9:22 ` Jan Blunck
2006-06-19 10:38 ` Balbir Singh
2006-06-16 10:43 ` [PATCH 3/5] vfs: remove shrink_dcache_anon() jblunck
2006-06-16 10:43 ` [PATCH 4/5] vfs: per superblock dentry stats jblunck
2006-06-16 10:43 ` [PATCH 5/5] vfs: per superblock dentry unused list jblunck
-- strict thread matches above, loose matches on Subject: below --
2006-06-01 9:51 [patch 0/5] [PATCH,RFC] vfs: per-superblock unused dentries list (2nd version) jblunck
2006-06-01 9:51 ` [patch 2/5] vfs: d_genocide() doesnt add dentries to unused list jblunck
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=20060616104322.204073000@hasse.suse.de \
--to=jblunck@suse.de \
--cc=akpm@osdl.org \
--cc=balbir@in.ibm.com \
--cc=dgc@sgi.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=viro@zeniv.linux.org.uk \
/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).