[Concept,14/34] vfs: Add block-device fields to struct fs_plat

Message ID 20260403140523.1998228-15-sjg@u-boot.org
State New
Headers
Series Add a virtual filesystem (VFS) layer to U-Boot |

Commit Message

Simon Glass April 3, 2026, 2:04 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Add block device descriptor and partition information to struct fs_plat
so that block-backed filesystems (ext4, FAT) can access the underlying
storage. Non-block filesystems like the sandbox hostfs leave the
descriptor as NULL.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 include/fs.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/include/fs.h b/include/fs.h
index 6696b9e26c7..c6b6323be3e 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -12,6 +12,7 @@ 
 #define __FS_H
 
 #include <fs_common.h>
+#include <part.h>
 
 struct udevice;
 
@@ -23,10 +24,18 @@  enum {
 /**
  * struct fs_plat - Filesystem information
  *
+ * For block-device-backed filesystems, @desc and @part identify the
+ * underlying storage. Non-block filesystems (hostfs, rootfs) leave
+ * @desc as NULL.
+ *
  * @name: Name of the filesystem, or empty if not available
+ * @desc: Block device descriptor, or NULL if not block-backed
+ * @part: Partition information (valid only when @desc is non-NULL)
  */
 struct fs_plat {
 	char name[FS_MAX_NAME_LEN];
+	struct blk_desc *desc;
+	struct disk_partition part;
 };
 
 /**