Re: [PATCH 09/17] fs: Make last_ino, iunique independent of inode_lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 29 Sep 2010 22:18:41 +1000 Dave Chinner <david@xxxxxxxxxxxxx> wrote:

> From: Nick Piggin <npiggin@xxxxxxx>
> 
> 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-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux