diff mbox series

[v2,5/6] libfs: set FMODE_NOWAIT on dir open

Message ID 20230422-uring-getdents-v2-5-2db1e37dc55e@codewreck.org (mailing list archive)
State Rejected, archived
Headers show
Series io_uring: add getdents support, take 2 | expand

Commit Message

Dominique Martinet May 10, 2023, 10:52 a.m. UTC
the readdir can technically wait a bit on a spinlock, but that should
never wait for long enough to return EAGAIN -- just set the capability
flag on directories f_mode

Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
---
 fs/libfs.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/fs/libfs.c b/fs/libfs.c
index 89cf614a3271..a3c7e42d90a7 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -81,6 +81,7 @@  EXPORT_SYMBOL(simple_lookup);
 int dcache_dir_open(struct inode *inode, struct file *file)
 {
 	file->private_data = d_alloc_cursor(file->f_path.dentry);
+	file->f_mode |= FMODE_NOWAIT;
 
 	return file->private_data ? 0 : -ENOMEM;
 }