Cleanups - MM_MapTemp to return void*, VFS use Unlink instead of Relink
[tpg/acess2.git] / KernelLand / Kernel / vfs / mount.c
index 1773218..f281247 100644 (file)
@@ -74,13 +74,34 @@ int VFS_Mount(const char *Device, const char *MountPoint, const char *Filesystem
        mnt->Options = &mnt->StrData[deviceLen+1+mountLen+1];
        memcpy( mnt->Options, Options, argLen+1 );
        
+       // Parse options string
+       char    *str = mnt->Options;
+        int    nArg = 0;
+       do {
+               nArg ++;
+       } while( (str = strchr(str, ',')) );
+
+       char    *args[nArg + 1];
+       str = mnt->Options;
+       nArg = 0;
+       do {
+               args[nArg++] = str;
+               str = strchr(str, ',');
+               if(str) *str = '\0';
+       } while( str );
+       args[nArg] = 0; // NULL terminal
+
        // Initialise Volume
-       mnt->RootNode = fs->InitDevice(Device, NULL);   //&ArgString);
+       mnt->RootNode = fs->InitDevice(Device, (const char **)args);
        if(!mnt->RootNode) {
                free(mnt);
                return -2;
        }
 
+       // Repair the options string
+       while( nArg -- > 1 )
+               args[nArg][-1] = ',';
+
        mnt->Identifier = giVFS_NextMountIdent++;
        #if 0
        // Ensure identifiers don't repeat

UCC git Repository :: git.ucc.asn.au