[Concept,11/12] ext4l: Fix dir_emit() to call the actor callback

Message ID 20251223011632.380026-12-sjg@u-boot.org
State New
Headers
Series ext4l: Add support for listing directoties (Part H) |

Commit Message

Simon Glass Dec. 23, 2025, 1:16 a.m. UTC
  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(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index 116f0475217..52f479e9673 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -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 */