diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-29 13:47:12 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-07-11 09:58:38 +0200 |
commit | b3fbfad7aeaf8ee36216e1d14b5d7be27ba612de (patch) | |
tree | 61299cecd2c49902ff831813daa81926bacd69db /fs/squashfs | |
parent | 4c7b877a5c90bcf80d42086d246981f0686d1e27 (diff) | |
download | barebox-b3fbfad7aeaf8ee36216e1d14b5d7be27ba612de.tar.gz barebox-b3fbfad7aeaf8ee36216e1d14b5d7be27ba612de.tar.xz |
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>
Diffstat (limited to 'fs/squashfs')
-rw-r--r-- | fs/squashfs/Kconfig | 1 | ||||
-rw-r--r-- | fs/squashfs/super.c | 9 |
2 files changed, 1 insertions, 9 deletions
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig index 19b8297af6..fce05c5730 100644 --- a/fs/squashfs/Kconfig +++ b/fs/squashfs/Kconfig @@ -1,6 +1,7 @@ menuconfig FS_SQUASHFS bool prompt "squashfs support" + select FS_LEGACY help Saying Y here includes support for SquashFS 4.0 (a Compressed Read-Only File System). Squashfs is a highly compressed read-only diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 4c730e09e4..34e92e3c1d 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c @@ -39,15 +39,6 @@ #include "squashfs.h" #include "decompressor.h" -static struct dentry *d_make_root(struct inode *inode) -{ - struct dentry *de = malloc(sizeof(struct dentry)); - de->d_name.name = "/"; - de->d_name.len = strlen("/"); - de->d_inode = inode; - return de; -} - static const struct squashfs_decompressor *supported_squashfs_filesystem(short major, short minor, short id) { |