fs: dentry cache implementation
This adds the Linux dentry cache implementation to barebox.

Until now every filesystem driver resolves the full path to a file for
itself. This leads to code duplication and is error prone since
resolving paths is a complicated task. Also it can narrow down the
lookup performance since barebox only knows ASCII paths and has no way
of caching lookups.

With this patch we get the Linux dcache implementation. The path
resolving code from fs/namei.c is nearly taken as-is, minus the RCU
and locking code. Dcaching is made simple as of now: We simply cache
everything and never release any dentries. Although we do reference
counting for inodes and dentries it is effectively not used yet.
We never free anything until a fs is unmounted in which case we free
everything no matter if references are taken or not.

This patch also contains a wrapper in fs/legacy.c to support
filesystems with the old API.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 4c7b877 commit b3fbfad7aeaf8ee36216e1d14b5d7be27ba612de
@Sascha Hauer Sascha Hauer authored on 29 Mar 2018
Showing 18 changed files
View
fs/Kconfig
View
fs/Makefile
View
fs/ext4/Kconfig
View
fs/fat/Kconfig
View
fs/fs.c
Too large (Show diff)
View
fs/legacy.c 0 → 100644
View
fs/libfs.c 0 → 100644
View
fs/pstore/Kconfig
View
fs/squashfs/Kconfig
View
fs/squashfs/super.c
View
fs/ubifs/Kconfig
View
include/dirent.h
View
include/fs.h
View
include/linux/dcache.h
View
include/linux/fs.h
View
include/linux/mount.h
View
include/linux/namei.h 0 → 100644
View
include/linux/stat.h