summaryrefslogtreecommitdiffstats
path: root/fs/squashfs/namei.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-05-31 16:31:53 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-07-13 08:56:52 +0200
commit551219844e92e33c0f41757d225474ebd3bc569c (patch)
treeb86c6c89e0b97ae8a10c51fc99e5a30db0af23d0 /fs/squashfs/namei.c
parent0a5e0f40f958b07462a19ac796adfcf4955a6b1a (diff)
downloadbarebox-551219844e92e33c0f41757d225474ebd3bc569c.tar.gz
barebox-551219844e92e33c0f41757d225474ebd3bc569c.tar.xz
fs: squashfs: Switch to dentry cache implementation
While at it implement symlink support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/squashfs/namei.c')
-rw-r--r--fs/squashfs/namei.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/squashfs/namei.c b/fs/squashfs/namei.c
index 482fda5a11..baf1e8b646 100644
--- a/fs/squashfs/namei.c
+++ b/fs/squashfs/namei.c
@@ -48,11 +48,11 @@
* and doesn't require much extra storage on disk.
*/
+#include <common.h>
#include <linux/fs.h>
#include <malloc.h>
#include <linux/string.h>
#include <linux/dcache.h>
-#include <common.h>
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
@@ -130,11 +130,11 @@ out:
}
-struct inode *squashfs_lookup(struct inode *dir, const char *cur_name,
- unsigned int flags)
+static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,
+ unsigned int flags)
{
- const unsigned char *name = cur_name;
- int len = strlen(cur_name);
+ const unsigned char *name = dentry->d_name.name;
+ int len = dentry->d_name.len;
struct inode *inode = NULL;
struct squashfs_sb_info *msblk = dir->i_sb->s_fs_info;
struct squashfs_dir_header dirh;
@@ -223,7 +223,8 @@ struct inode *squashfs_lookup(struct inode *dir, const char *cur_name,
exit_lookup:
kfree(dire);
- return inode;
+ d_add(dentry, inode);
+ return NULL;
data_error:
err = -EIO;
@@ -344,3 +345,7 @@ failed:
kfree(dire);
return 1;
}
+
+const struct inode_operations squashfs_dir_inode_ops = {
+ .lookup = squashfs_lookup,
+};