summaryrefslogtreecommitdiff
path: root/src/sys/os/vfs_namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys/os/vfs_namei.c')
-rw-r--r--src/sys/os/vfs_namei.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/sys/os/vfs_namei.c b/src/sys/os/vfs_namei.c
index 8727965..18d35f2 100644
--- a/src/sys/os/vfs_namei.c
+++ b/src/sys/os/vfs_namei.c
@@ -43,6 +43,10 @@ int
namei(struct nameidata *ndp)
{
struct mount *mp = NULL;
+ struct vnode *vp;
+ struct vop *vops;
+ struct vop_lookup_args lookup;
+ struct fs_info *fip;
char namebuf[NAME_MAX];
const char *p, *pcur;
size_t len, i = 0;
@@ -63,6 +67,31 @@ namei(struct nameidata *ndp)
return error;
}
+ vp = mp->vp;
+ fip = mp->fs;
+
+ if ((vops = vp->vops) == NULL) {
+ printf("namei: failed to get vops\n");
+ return -EIO;
+ }
+
+ /* We need vops->lookup() */
+ if (vops->lookup == NULL) {
+ printf("namei: vops does not have lookup op\n");
+ return -EIO;
+ }
+
+ /*
+ * If this is an image we are looking up, then throw
+ * a path right at it.
+ */
+ if (ISSET(fip->attr, FS_ATTR_IMAGE)) {
+ lookup.name = ndp->path;
+ lookup.dirvp = mp->vp;
+ lookup.vpp = &vp;
+ return vops->lookup(&lookup);
+ }
+
printf("namei: f: %s\n", ndp->path);
printf("namei: d: /\n", ndp->path);