From: Benjamin Coddington <[email protected]>

commit 2253ab99f2e978d94693d6f63c83aa5b5d4c7839 upstream.

Both GFS2 and OCFS2 use DLM locking, which will allow async lock requests.
Signal this support by setting FOP_ASYNC_LOCK.

Signed-off-by: Benjamin Coddington <[email protected]>
Link: 
https://lore.kernel.org/r/fc4163dbbf33c58e5a8b8ee8cb8c57e555f53ce5.1726083391.git.bcodd...@redhat.com
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Signed-off-by: Salvatore Bonaccorso <[email protected]>
---
 fs/gfs2/file.c  | 2 ++
 fs/ocfs2/file.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 0b5be4ad3a96..1b40ab240913 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1597,6 +1597,7 @@ const struct file_operations gfs2_file_fops = {
        .splice_write   = gfs2_file_splice_write,
        .setlease       = simple_nosetlease,
        .fallocate      = gfs2_fallocate,
+       .fop_flags      = FOP_ASYNC_LOCK,
 };
 
 const struct file_operations gfs2_dir_fops = {
@@ -1609,6 +1610,7 @@ const struct file_operations gfs2_dir_fops = {
        .lock           = gfs2_lock,
        .flock          = gfs2_flock,
        .llseek         = default_llseek,
+       .fop_flags      = FOP_ASYNC_LOCK,
 };
 
 #endif /* CONFIG_GFS2_FS_LOCKING_DLM */
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 451f0c5a5352..2bebb10a0754 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2852,6 +2852,7 @@ const struct file_operations ocfs2_fops = {
        .splice_write   = iter_file_splice_write,
        .fallocate      = ocfs2_fallocate,
        .remap_file_range = ocfs2_remap_file_range,
+       .fop_flags      = FOP_ASYNC_LOCK,
 };
 
 WRAP_DIR_ITER(ocfs2_readdir) // FIXME!
@@ -2868,6 +2869,7 @@ const struct file_operations ocfs2_dops = {
 #endif
        .lock           = ocfs2_lock,
        .flock          = ocfs2_flock,
+       .fop_flags      = FOP_ASYNC_LOCK,
 };
 
 /*
-- 
2.55.0

Reply via email to