summaryrefslogtreecommitdiff
path: root/fs/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/mount.c')
-rw-r--r--fs/mount.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/mount.c b/fs/mount.c
index 009647a..01a90b2 100644
--- a/fs/mount.c
+++ b/fs/mount.c
@@ -27,7 +27,7 @@ void mount_add(mount mnt)
{
if(mounts_count==MAX_MOUNTS)kpanic("maxium number of mounts exceeded. increase MAX_MOUNTS in kernel.h and recomplie kernel.");
mounts[mounts_count++]=mnt;
- klog("mounted %s",mnt.path);
+ klog("Mounted %s at %s",mount_type_to_str(mnt.type),mnt.path);
}
void mount_dump()
@@ -70,8 +70,9 @@ static char* get_mount_for_path(char *path,mount *mnt)
{
if(path[0]!='/')kpanic("this works only for absolute paths!");
+ // start with root as default
uint32_t best=0;
- uint32_t best_len=0;
+ uint32_t best_len=1;
for(int i=0;i<mounts_count;i++)
{
@@ -83,9 +84,8 @@ static char* get_mount_for_path(char *path,mount *mnt)
best=i;
best_len=len;
}
-
}
- if(best_len==0)return 0;
+
*mnt=mounts[best];
return path+best_len-1;
}