fs/lock: add new callback, lm_lock_expired, to lock_manager_operations
authorDai Ngo <dai.ngo@oracle.com>
Sat, 12 Feb 2022 18:12:53 +0000 (10:12 -0800)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 28 Feb 2022 15:26:41 +0000 (10:26 -0500)
commitcd4fa4bf150c2a1b1c41b3d8f1b5ba18f090a1d0
tree7927d6fc0a52e4ad50be52a8b432ea077c6ab112
parentc7234469ac65f87feaf7620e902ac6fc921c5111
fs/lock: add new callback, lm_lock_expired, to lock_manager_operations

Add new callback, lm_lock_expired, to lock_manager_operations to allow
the lock manager to take appropriate action to resolve the lock conflict
if possible. The callback takes 1 argument, the file_lock of the blocker
and returns true if the conflict was resolved else returns false. Note
that the lock manager has to be able to resolve the conflict while
the spinlock flc_lock is held.

Lock manager, such as NFSv4 courteous server, uses this callback to
resolve conflict by destroying lock owner, or the NFSv4 courtesy client
(client that has expired but allowed to maintains its states) that owns
the lock.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Documentation/filesystems/locking.rst
fs/locks.c
include/linux/fs.h