From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 7/5] Optimise d_find_alias() Date: Fri, 3 Mar 2006 15:46:17 +0000 Message-ID: <20060303154617.GC27946@ftp.linux.org.uk> References: <20060302213356.7282.26463.stgit@warthog.cambridge.redhat.com> <25676.1141385408@warthog.cambridge.redhat.com> <20060303034552.5fcedc49.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Howells , torvalds@osdl.org, steved@redhat.com, trond.myklebust@fys.uio.no, aviro@redhat.com, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com, nfsv4@linux-nfs.org, linux-kernel@vger.kernel.org Return-path: To: Andrew Morton Content-Disposition: inline In-Reply-To: <20060303034552.5fcedc49.akpm@osdl.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Mar 03, 2006 at 03:45:52AM -0800, Andrew Morton wrote: > 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? What would it buy you?