diff options
| author | Miguel <m.i@gmx.at> | 2018-09-19 01:52:14 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-19 01:52:14 +0200 |
| commit | 1e08b64b43bf9c50b644da3f76d5a8bcc73f62da (patch) | |
| tree | 53aca729b7faeb781b04b9c62a7b1b13efa21991 /fs/mount.c | |
| parent | 2d91384197847a7e8fe2c3f548918a8277d3086d (diff) | |
addding sysfs and pipes etc
Diffstat (limited to 'fs/mount.c')
| -rw-r--r-- | fs/mount.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; } |
