diff --git a/src/sys/vfs/mount.c b/src/sys/vfs/mount.c index 4294d11..b4c0425 100644 --- a/src/sys/vfs/mount.c +++ b/src/sys/vfs/mount.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -48,7 +49,8 @@ struct device_node *device = 0x0; /* Allocate Memory For Mount Point */ - mp = (vfs_mountPoint_t *)kmalloc(sizeof(vfs_mountPoint_t)); + if ((mp = (vfs_mountPoint_t *)kmalloc(sizeof(vfs_mountPoint_t)) == 0x0) + kpanic("vfs_mount: failed to allocate mp\n"); /* Copy Mount Point Into Buffer */ sprintf(mp->mountPoint,mountPoint); @@ -61,22 +63,25 @@ mp->fs = vfsFindFS(vfsType); mp->partition = partition; mp->perms = *perms; - if (device != 0x0) { - mp->diskLabel = (struct ubixDiskLabel *)kmalloc(512); - mp->device->devInfo->read(mp->device->devInfo->info,mp->diskLabel,1,1); - kprintf("READING SECTOR"); - } if (mp->fs == 0x0) { /* sysErr(systemErr,"File System Type: %i Not Found\n",fsType); */ kprintf("File System Type: %i Not Found\n",vfsType); return(0x1); } + + if (device != 0x0) { + mp->diskLabel = (struct ubixDiskLabel *)kmalloc(512); + mp->device->devInfo->read(mp->device->devInfo->info,mp->diskLabel,1,1); + kprintf("READING SECTOR"); + } + /* Add Mountpoint If It Fails Free And Return */ if (vfs_addMount(mp) != 0x0) { kfree(mp); return(0x1); } + /* Initialize The File System If It Fails Return */ if (mp->fs->vfsInitFS(mp) == 0x0) { kfree(mp); @@ -136,6 +141,11 @@ /*** $Log$ + Revision 1.9 2004/07/23 09:10:06 reddawg + ubixfs: cleaned up some functions played with the caching a bit + vfs: renamed a bunch of functions + cleaned up a few misc bugs + Revision 1.8 2004/07/21 10:02:09 reddawg devfs: renamed functions device system: renamed functions