[Concept,11/12] ext4l: Fix dir_emit() to call the actor callback
Commit Message
From: Simon Glass <simon.glass@canonical.com>
The dir_emit() macro was stubbed to do nothing, which meant directory
listing would never output any entries. Replace it with a proper
inline function that calls ctx->actor() to emit each directory entry.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
fs/ext4l/ext4_uboot.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
@@ -1703,8 +1703,12 @@ extern struct inode *iget_locked(struct super_block *sb, unsigned long ino);
#define inode_eq_iversion(i, v) ({ (void)(i); (void)(v); 1; })
#define inode_query_iversion(i) ({ (void)(i); 0ULL; })
-/* Directory context operations */
-#define dir_emit(ctx, name, len, ino, type) ({ (void)(ctx); (void)(name); (void)(len); (void)(ino); (void)(type); 1; })
+/* Directory context operations - call the actor callback */
+static inline bool dir_emit(struct dir_context *ctx, const char *name, int len,
+ u64 ino, unsigned int type)
+{
+ return ctx->actor(ctx, name, len, ctx->pos, ino, type) == 0;
+}
#define dir_relax_shared(i) ({ (void)(i); 1; })
/* File llseek */