subsys/fs: remove ambiguity in readdir results

Existing file system implementations do not provide the special "."
(current) and ".." (parent) directory entries in the readdir results.
littlefs does.

Remove these entries in the abstraction layer.  This simplifies code in
higher level consumers that aren't prepared to see them.  Consumers like
FUSE that need them can put them back without having to worry about
conflicts.

Closes issue #17951

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2019-08-02 09:50:52 -05:00 committed by Carles Cufí
commit a8b7a21524
3 changed files with 23 additions and 3 deletions

View file

@ -362,7 +362,12 @@ int fs_opendir(struct fs_dir_t *zdp, const char *path);
/**
* @brief Directory read entry
*
* Reads directory entries of a open directory
* Reads directory entries of a open directory.
*
* @note: Most existing underlying file systems do not generate POSIX
* special directory entries "." or "..". For consistency the
* abstraction layer will remove these from lower layer results so
* higher layers see consistent results.
*
* @param zdp Pointer to the directory object
* @param entry Pointer to zfs_dirent structure to read the entry into