sanlock: persistent and orphan resource leases
If a resource lease has the PERSISTENT flag set when it is
acquired, then sanlock will not release the lease if the
process holding the lease exits. Instead, the lease is
moved to the orphans list. From the perspective of other
hosts, and on disk, there is no difference between a held
lease and an orphan lease. On the origin host, another
process can acquire an orphan lease by using the
ACQUIRE_ORPHAN flag, or release an orphan lease using
the REL_ORPHAN flag. All orphan leases in a lockspace can
be released using REL_ORPHAN and setting the lockspace name
and an empty resource name.
If the lockspace config flag SANLK_CONFIG_USED_BY_ORPHANS
is set, then an orphan resource in a lockspace will have
the same effect on the lockspace as the USED flag or clients
holding resources that have not exited. Other things on the
host may still be using resources that are protected by the
orphaned resource lease, so it is not safe to release the
lockspace, which would allow another host to acquire the
orphan lease.
If SANLK_CONFIG_USED_BY_ORPHANS is not set, then orphans
will have no effect on the removal of a lockspace. When
the lockspace is removed, the orphans will just be left.
Signed-off-by: David Teigland <teigland@redhat.com>