[DLM] change lkid format
authorDavid Teigland <teigland@redhat.com>
Mon, 2 Apr 2007 17:12:55 +0000 (12:12 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 1 May 2007 08:11:15 +0000 (09:11 +0100)
commitce03f12b37c0bd81ad707d3642241cc55c944711
tree11f6eba9b44a29d0c203c99c47d351152d25529a
parent72c2be776bd6eec5186e316e6d9dd4aab78d314d
[DLM] change lkid format

A lock id is a uint32 and is used as an opaque reference to the lock.  For
userland apps, the lkid is passed up, through libdlm, as the return value
from a write() on the dlm device.  This created a problem when the high
bit was 1, making the lkid look like an error.  This is fixed by changing
how the lkid is composed.  The low 16 bits identified the hash bucket for
the lock and the high 16 bits were a per-bucket counter (which eventually
hit 0x8000 causing the problem).  These are simply swapped around; the
number of hash table buckets is far below 0x8000, making all lkid's
positive when viewed as signed.

Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/dlm/lock.c