From: Harvey Harrison <harvey.harrison@gmail.com>
To: David Chinner <dgc@sgi.com>
Cc: Kentaro Makita <k-makita@np.css.fujitsu.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
akpm@linux-foundation.org, viro@ZenIV.linux.org.uk
Subject: Re: [PATCH][RFC]fix soft lock up at NFS mount by per-SB LRU-list of unused dentries
Date: Thu, 22 May 2008 16:14:38 -0700 [thread overview]
Message-ID: <1211498078.6888.21.camel@brick> (raw)
In-Reply-To: <20080522225608.GZ173056135@sgi.com>
On Fri, 2008-05-23 at 08:56 +1000, David Chinner wrote:
> On Thu, May 22, 2008 at 11:22:18AM +0900, Kentaro Makita wrote:
> > +/*
> > + * Shrink the dentry LRU on a given superblock.
> > + * @sb : superblock to shrink dentry LRU.
> > + * @count: If count is NULL, we prune all dentries on superblock.
> > + * @flags: If flags is non-zero, we need to do special processing based on
> > + * which flags are set. This means we don't need to maintain multiple
> > + * similar copies of this loop.
> > + */
> > +static void __shrink_dcache_sb(struct super_block *sb, int *count, int flags)
> > +{
> > + LIST_HEAD(referenced);
> > + LIST_HEAD(tmp);
> > + struct dentry *dentry;
> > + int cnt = 0;
> > +
> > + BUG_ON(!sb);
> > + BUG_ON((flags & DCACHE_REFERENCED) && count == NULL);
> > + spin_lock(&dcache_lock);
> > + if (count != NULL)
> > + /* called from prune_dcache() and shrink_dcache_parent() */
> > + cnt = *count;
>
> I'd convert all the 'if (count == NULL)' to 'if (!count)' and same
> for 'if (count != NULL)' to 'if (count)'....
It's a small thing, but in this case it almost makes sense to have the
explicit null to remind people it's a pointer....whenever people see
a variable named count, it's easy to assume it's an integer.
YMMV
Harvey
next prev parent reply other threads:[~2008-05-22 23:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-22 2:22 [PATCH][RFC]fix soft lock up at NFS mount by per-SB LRU-list of unused dentries Kentaro Makita
2008-05-22 6:55 ` Andrew Morton
2008-05-22 8:20 ` Kentaro Makita
2008-05-22 22:56 ` David Chinner
2008-05-22 23:14 ` Harvey Harrison [this message]
2008-05-23 2:15 ` Kentaro Makita
2008-05-23 4:22 ` David Chinner
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=1211498078.6888.21.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dgc@sgi.com \
--cc=k-makita@np.css.fujitsu.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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