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>
Wed, 16 Feb 2022 17:39:03 +0000 (12:39 -0500)
commit1ef6b9b682aade0cf5547e6a0f69a184383159c6
tree5ceea3cf9d55241aa6debd469af5401ad358b76e
parent48ae14ff12a70e12430a6d884c166ac0192f1c1b
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