summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2025-05-13 18:10:08 +0300
committerChristian Brauner <brauner@kernel.org>2025-05-15 12:26:05 +0300
commite0410e956b97e8b50b2aa7b02ba70e5f09b31ebe (patch)
treed5a6a2771ac9b29d2f65e74ecb61e4d0a627f446 /include/linux
parente7b9cea718eee4585a947b10086ca51ad27ef5d4 (diff)
downloadlinux-e0410e956b97e8b50b2aa7b02ba70e5f09b31ebe.tar.xz
readdir: supply dir_context.count as readdir buffer size hint
This is a preparation for large readdir buffers in fuse. Simply setting the fuse buffer size to the userspace buffer size should work, the record sizes are similar (fuse's is slightly larger than libc's, so no overflow should ever happen). Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Jaco Kroon <jaco@uls.co.za> Link: https://lore.kernel.org/20250513151012.1476536-1-mszeredi@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c8b5af17060e..ddd54a664916 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2071,6 +2071,13 @@ typedef bool (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
struct dir_context {
filldir_t actor;
loff_t pos;
+ /*
+ * Filesystems MUST NOT MODIFY count, but may use as a hint:
+ * 0 unknown
+ * > 0 space in buffer (assume at least one entry)
+ * INT_MAX unlimited
+ */
+ int count;
};
/* If OR-ed with d_type, pending signals are not checked */