[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Cluster-devel] cluster/gfs-kernel/src/gfs inode.h ops_export.c

Steven Whitehouse wrote:

Just wondering why this:

On Tue, 2007-01-16 at 20:39 +0000, wcheng sourceware org wrote:
 	error = gfs_glock_nq_num(sdp,
-				 inum.no_formal_ino, &gfs_inode_glops,
+				 inum->no_formal_ino, &gfs_inode_glops,
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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]