From 5d55e2a922a3d5e24a2141aa5069687dcdb2bca8 Mon Sep 17 00:00:00 2001 From: Mark Browning Date: Thu, 28 Jun 2018 15:30:59 +0000 Subject: [PATCH] Pass stat to filler in readdir for dirent->d_type. We have SD card reading code that iterates over the file system using opendir() and readdir() recursively by checking the struct dirent::d_type field, which is technically non-portable but works in ext2, ext3, ext4, and vfat. However, it wasn't working with exfat. Allows fuse to fill in the d_type field. --- fuse/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fuse/main.c b/fuse/main.c index 2fd523b..c645390 100644 --- a/fuse/main.c +++ b/fuse/main.c @@ -102,6 +102,7 @@ static int fuse_exfat_readdir(const char* path, void* buffer, struct exfat_iterator it; int rc; char name[EXFAT_UTF8_NAME_BUFFER_MAX]; + struct stat stbuf; exfat_debug("[%s] %s", __func__, path); @@ -131,7 +132,8 @@ static int fuse_exfat_readdir(const char* path, void* buffer, exfat_debug("[%s] %s: %s, %"PRId64" bytes, cluster 0x%x", __func__, name, node->is_contiguous ? "contiguous" : "fragmented", node->size, node->start_cluster); - filler(buffer, name, NULL, 0); + exfat_stat(&ef, node, &stbuf); + filler(buffer, name, &stbuf, 0); exfat_put_node(&ef, node); } exfat_closedir(&ef, &it); -- 2.11.0