[Ocfs2-tools-devel] [PATCH 0/6] libo2dlm with dlmfs improvements

Joel Becker joel.becker at oracle.com
Wed Feb 10 01:34:19 PST 2010


ocfs2 ships with its own cluster stack, o2cb.  The dlm portion, o2dlm,
is accessible to userspace via a custom filesystem, ocfs2_dlmfs.  Files
in this filesytem represent cluster lock resources.  Open the file, and
you take the lock.  The libo2dlm library wraps this filesystem,
providing a very simplified cluster locking API to userspace programs.

One of the things left out of the simplified interface is the ability to
learn that other nodes want a lock.  Notification that another node
wants the lock is called a "blocking asynchronous system trap", or
"bast".  Kernel users of o2dlm can register basts as they please, but
programs using libo2dlm and ocfs2_dlmfs cannot.  Thus, they must not
hold a lock forever; other nodes will never get the lock.  

The kernel filesystem has now added BAST support via poll(2).
POLLIN on an open ocfs2_dlmfs flie signals a bast.  libo2dlm has added
o2dlm_lock_with_past() and o2dlm_process_bast() to use this
functionality.  Now user programs can hold a lock until they are
notified to release it.

ocfs2_dlmfs has also been improved to use stackglue.  Now ocfs2_dlmfs
can be used with fsdlm.  o2cb.init will mount ocfs2_dlmfs if it is new
enough, and libocfs2 will use ocfs2_dlmfs for all locking when capable.

Finally, libo2dlm will not drop unlocked locks unless explicitly asked
too.  This makes LVBs work correctly on both DLMs.

Joel

[Pull]
git://oss.oracle.com/git/ocfs2-tools.git
[View]
http://git.kernel.org/?p=linux/kernel/git/jlbec/ocfs2.git;a=shortlog;h=refs/heads/dlmfs-stackglue

 include/o2dlm/o2dlm.h      |   36 +++++++-
 libo2dlm/.gitignore        |    1 +
 libo2dlm/Makefile          |    2 +-
 libo2dlm/capabilities.c    |  131 ++++++++++++++++++++++++++++
 libo2dlm/o2dlm.c           |  208 +++++++++++++++++++++++++++++++++++++++++---
 libo2dlm/o2dlm_err.et      |    6 ++
 libocfs2/dlm.c             |   20 +++-
 vendor/common/o2cb.init.sh |   33 +++++++
 8 files changed, 415 insertions(+), 22 deletions(-)






More information about the Ocfs2-tools-devel mailing list