Re: [PATCH 09/18] fs: Introduce per-bucket inode hash locks

From: Christoph Hellwig
Date: Wed Oct 13 2010 - 07:41:31 EST


> #include <linux/mount.h>
> #include <linux/async.h>
> #include <linux/posix_acl.h>
> +#include <linux/bit_spinlock.h>

list_bl.h already includes bit_spinlock.h, so you shouldn't actually
need it here.

> @@ -2154,7 +2154,7 @@ static int shmem_encode_fh(struct dentry *dentry, __u32 *fh, int *len,
> */
> static DEFINE_SPINLOCK(lock);
> spin_lock(&lock);
> - if (hlist_unhashed(&inode->i_hash))
> + if (inode_unhashed(inode))
> __insert_inode_hash(inode,
> inode->i_ino + inode->i_generation);
> spin_unlock(&lock);

That's some amazingly ugly code. Just keeping the hash bucket lock
over the inode_unhashed check and the insert would remove the need for
the weird local spinlock. But that's probably best left for a later
patch.

Looks good,


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/