From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wendy Cheng Date: Wed, 17 Jan 2007 18:05:05 -0500 Subject: [Cluster-devel] cluster/gfs-kernel/src/gfs inode.h ops_export.c In-Reply-To: <1169043158.11844.88.camel@quoit.chygwyn.com> References: <20070116203903.15912.qmail@sourceware.org> <1169043158.11844.88.camel@quoit.chygwyn.com> Message-ID: <45AEABA1.2010408@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Steven Whitehouse wrote: > Hi, > > Just wondering why this: > > On Tue, 2007-01-16 at 20:39 +0000, wcheng at sourceware.org wrote: > [snip] >> - >> error = gfs_glock_nq_num(sdp, >> - inum.no_formal_ino, &gfs_inode_glops, >> + inum->no_formal_ino, &gfs_inode_glops, >> LM_ST_SHARED, LM_FLAG_ANY | GL_LOCAL_EXCL, >> &i_gh); >> > needs the GL_LOCAL_EXCL flag. I would have thought an ordinary shared > lock would be enough? > It is required to prevent (by serializing) other process (on the same node) to create this gfs inode at the same time (equivalence of an semaphore or mutex). Lookup (and several other GFS1 mount/umount) code needs this flag too. This (my guess) is to reduce the need to create another set of semaphores/mutex. In summary, I think it has two advantages: 1. Less locks 2. Easier to track who owns what (since glock holder is easy to find when compared with sempahore/mutex). The down-side is that it makes glock code difficult to understand. For GFS1, let's keep it this way. For GFS2, your call :) ... -- Wendy > In GFS2 I'd like to try and eliminate this flag since it would be just > as easy to use a combination of a mutex or rwsem and a glock to achieve > the same thing and it makes the glock code simpler. Its only used in > about three places anyway and I'm not so sure that its required at all > in this case, > > Steve. > > >