[Linux-cachefs] Re: [PATCH 7/5] Optimise d_find_alias()

Andrew Morton akpm at osdl.org
Fri Mar 3 11:45:52 UTC 2006


David Howells <dhowells at redhat.com> wrote:
>
>  struct dentry * d_find_alias(struct inode *inode)
>   {
>  -	struct dentry *de;
>  -	spin_lock(&dcache_lock);
>  -	de = __d_find_alias(inode, 0);
>  -	spin_unlock(&dcache_lock);
>  +	struct dentry *de = NULL;
>  +	if (!list_empty(&inode->i_dentry)) {
>  +		spin_lock(&dcache_lock);
>  +		de = __d_find_alias(inode, 0);
>  +		spin_unlock(&dcache_lock);
>  +	}
>   	return de;
>   }

How can we get away without a barrier?




More information about the Linux-cachefs mailing list