From: Andreas Dilger Subject: Re: inode rwlock instead of semaphore Date: Mon, 3 Feb 2003 10:47:36 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030203104736.D18636@schatzie.adilger.int> References: <20030202100155.A18636@schatzie.adilger.int> <20030203131352.GA7993@vagabond> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: To: Jan Hudec , linux-fsdevel@vger.kernel.org, Alexander Viro Content-Disposition: inline In-Reply-To: <20030203131352.GA7993@vagabond>; from bulb@ucw.cz on Mon, Feb 03, 2003 at 02:13:52PM +0100 List-Id: linux-fsdevel.vger.kernel.org On Feb 03, 2003 14:13 +0100, Jan Hudec wrote: > On Sun, Feb 02, 2003 at 10:01:55AM -0700, Andreas Dilger wrote: > > One possibility is to change the VFS to use down_read(&dir->i_rwlock) or > > similar, or alternately create VFS methods that allow pushing the locking > > down into the filesystem so they could use a rwlock or even a dir+name-based > > lock (e.g. for ext3+htree) so they can lock subsets of the directory for > > both read and write operations. > > Definitely sure lookup is a reader? AFAICT from the VFS point of view, > it's a writer and from the disk's point of view the filesystem driver > and not VFS should do the locking (eg. networking filesystems would only > do this locking on server). We have already created an API on the client side which allows the network filesystem to handle the locking itself, and we are now using the server side distributed lock manager to totally bypass the VFS locking entirely. It looks like we don't actually need any changes for our network filesystem, but it would still be a performance win for local filesystems to be able to handle locking as needed for maximum performance. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/