From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 7/5] Optimise d_find_alias() Date: Fri, 3 Mar 2006 03:45:52 -0800 Message-ID: <20060303034552.5fcedc49.akpm@osdl.org> References: <20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com> <25676.1141385408@warthog.cambridge.redhat.com> Reply-To: Linux filesystem caching discussion list Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: aviro@redhat.com, linux-kernel@vger.kernel.org, nfsv4@linux-nfs.org, trond.myklebust@fys.uio.no, torvalds@osdl.org, linux-cachefs@redhat.com, linux-fsdevel@vger.kernel.org Return-path: To: David Howells In-Reply-To: <25676.1141385408@warthog.cambridge.redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cachefs-bounces@redhat.com Errors-To: linux-cachefs-bounces@redhat.com List-Id: linux-fsdevel.vger.kernel.org David Howells 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?