From: Simon Glass <simon.glass@canonical.com> Add a simple folio cache array to struct address_space for U-Boot's folio management, avoiding the need for Linux's XArray/radix tree infrastructure. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- include/linux/fs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 090ee192061..0bf0d3b0379 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -50,6 +50,11 @@ struct path { /* Buffer operations are in buffer_head.h */ +#ifdef __UBOOT__ +/* Maximum number of cached folios per address_space */ +#define FOLIO_CACHE_MAX 64 +#endif + /* address_space - extended for inode.c */ struct address_space { struct inode *host; @@ -58,6 +63,11 @@ struct address_space { unsigned long writeback_index; struct list_head i_private_list; const struct address_space_operations *a_ops; +#ifdef __UBOOT__ + /* Simple folio cache for U-Boot (no XA/radix tree) */ + struct folio *folio_cache[FOLIO_CACHE_MAX]; + int folio_cache_count; +#endif }; /* block_device - minimal stub */ -- 2.43.0