On Mon, Oct 12, 2026 at 04:00:41PM +0200, Heinrich Schuchardt wrote:

> fs_ls_generic() displays file sizes but no timestamps. The FAT
> filesystem stores a change date in every directory entry and already
> populates fs_dirent::change_time in fat_readdir(). Print the date
> alongside the file size for filesystems that provide it.
> 
> Add a u32 capability bitmap (caps) to struct fstype_info. Each bit
> documents a property that the filesystem's readdir() implementation
> guarantees:
> 
>   FS_CAP_DATE  BIT(0)  change_time in fs_dirent is valid
> 
> fs_ls_generic() tests FS_CAP_DATE once before the loop to select a
> consistent output format for the entire listing:
> 
>   12345678  2024-03-15 09:30  filename.txt    (FAT)
>   12345678   filename.txt                     (ext4, squashfs, ...)
> 
> Set FS_CAP_DATE for FAT. fat2rtc() loses the __maybe_unused annotation
> since it is now called unconditionally outside XPL builds. The attr,
> create_time, change_time, and access_time fields that were previously
> only populated under CONFIG_EFI_LOADER are now populated whenever
> CONFIG_XPL_BUILD is not set.
> 
> Extending the feature to another filesystem requires only adding
> .caps = FS_CAP_DATE to its fstype_info entry and ensuring its readdir()
> fills in fs_dirent::change_time.
> 
> Signed-off-by: Heinrich Schuchardt <[email protected]>
> ---
>  fs/fat/fat.c |  2 +-
>  fs/fs.c      | 38 +++++++++++++++++++++++++++++++++++---
>  2 files changed, 36 insertions(+), 4 deletions(-)

We should split the generic feature part from enabling it on FAT.

And, building on the comments I've already sent, I assume you've not
been inspired on some way to re-structure this code to avoid having to
have forward declarations of *something*.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to