ocfs2: Provide the ocfs2_dlm_lvb_valid() stack API.
authorJoel Becker <joel.becker@oracle.com>
Fri, 19 Jun 2009 22:14:13 +0000 (15:14 -0700)
committerJoel Becker <joel.becker@oracle.com>
Mon, 22 Jun 2009 21:24:30 +0000 (14:24 -0700)
commit1c520dfbf391e1617ef61553f815b8006a066c44
treebb7e7e7b1225d6e42a61c56e52cbb627c5d2f3b4
parent3fe0344faf7fdcb158bd5c1a9aec960a8d70c8e8
ocfs2: Provide the ocfs2_dlm_lvb_valid() stack API.

The Lock Value Block (LVB) of a DLM lock can be lost when nodes die and
the DLM cannot reconstruct its state.  Clients of the DLM need to know
this.

ocfs2's internal DLM, o2dlm, explicitly zeroes out the LVB when it loses
track of the state.  This is not a standard behavior, but ocfs2 has
always relied on it.  Thus, an o2dlm LVB is always "valid".

ocfs2 now supports both o2dlm and fs/dlm via the stack glue.  When
fs/dlm loses track of an LVBs state, it sets a flag
(DLM_SBF_VALNOTVALID) on the Lock Status Block (LKSB).  The contents of
the LVB may be garbage or merely stale.

ocfs2 doesn't want to try to guess at the validity of the stale LVB.
Instead, it should be checking the VALNOTVALID flag.  As this is the
'standard' way of treating LVBs, we will promote this behavior.

We add a stack glue API ocfs2_dlm_lvb_valid().  It returns non-zero when
the LVB is valid.  o2dlm will always return valid, while fs/dlm will
check VALNOTVALID.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Acked-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/dlmglue.c
fs/ocfs2/stack_o2cb.c
fs/ocfs2/stack_user.c
fs/ocfs2/stackglue.c
fs/ocfs2/stackglue.h