diff options
author | Alexander Aring <aahringo@redhat.com> | 2023-09-12 17:53:21 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2023-09-17 19:05:43 -0400 |
commit | f5c52493bddf968f8e22472e265f38eeb07eb8aa (patch) | |
tree | 5970fd95bb9fa649ed4b315a3331209189a1e749 | |
parent | a0ae2a1dcc2b0a64e491d64fdcb1709bc6565c78 (diff) | |
download | linux-f5c52493bddf968f8e22472e265f38eeb07eb8aa.tar.gz |
lockd: add doc to enable EXPORT_OP_ASYNC_LOCK
This patch adds a note to enable EXPORT_OP_ASYNC_LOCK for
asynchronous lock request handling.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
-rw-r--r-- | fs/locks.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/locks.c b/fs/locks.c index 76ad05f8070ad9..d4e49a990a8daa 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -2264,11 +2264,13 @@ out: * To avoid blocking kernel daemons, such as lockd, that need to acquire POSIX * locks, the ->lock() interface may return asynchronously, before the lock has * been granted or denied by the underlying filesystem, if (and only if) - * lm_grant is set. Callers expecting ->lock() to return asynchronously - * will only use F_SETLK, not F_SETLKW; they will set FL_SLEEP if (and only if) - * the request is for a blocking lock. When ->lock() does return asynchronously, - * it must return FILE_LOCK_DEFERRED, and call ->lm_grant() when the lock - * request completes. + * lm_grant is set. Additionally EXPORT_OP_ASYNC_LOCK in export_operations + * flags need to be set. + * + * Callers expecting ->lock() to return asynchronously will only use F_SETLK, + * not F_SETLKW; they will set FL_SLEEP if (and only if) the request is for a + * blocking lock. When ->lock() does return asynchronously, it must return + * FILE_LOCK_DEFERRED, and call ->lm_grant() when the lock request completes. * If the request is for non-blocking lock the file system should return * FILE_LOCK_DEFERRED then try to get the lock and call the callback routine * with the result. If the request timed out the callback routine will return a |