[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20100929215302.1f4536be.akpm@linux-foundation.org>
Date: Wed, 29 Sep 2010 21:53:02 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Dave Chinner <david@...morbit.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/17] fs: Make last_ino, iunique independent of
inode_lock
On Wed, 29 Sep 2010 22:18:41 +1000 Dave Chinner <david@...morbit.com> wrote:
> From: Nick Piggin <npiggin@...e.de>
>
> Before removing the inode_lock, we need to make the last_ino and iunique
> counters independent of the inode_lock. last_ino can be trivially converted to
> an atomic variable, while the iunique counter needs a new lock nested inside
> the inode_lock to provide the same protection that the inode_lock previously
> provided.
>
>
> ...
>
> +static int test_inode_iunique(struct super_block * sb, struct hlist_head *head, unsigned long ino)
> +{
> + struct hlist_node *node;
> + struct inode * inode = NULL;
> +
> + spin_lock(&inode_hash_lock);
> + hlist_for_each_entry(inode, node, head, i_hash) {
> + if (inode->i_ino == ino && inode->i_sb == sb) {
> + spin_unlock(&inode_hash_lock);
> + return 0;
> + }
> + }
> + spin_unlock(&inode_hash_lock);
> + return 1;
> +}
Please run all the patches through checkpatch.
Please document this function. Why does it exist? What does it do?
How does it do it? Try to improve the code!
>
> ...
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists