rem: int i;
add: uint32 i;
context: fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms,		size_t len, void **data, vnode_id *vnid){	/*	Kernel passes in nspace_id, (representing a disk or partition?)	and a string representing the device (eg, "/dev/scsi/disk/030/raw)	Flags will be used for things like specifying read-only mounting.	parms is parameters passed in as switches from the mount command, 	and len is the length of the otions. data is a pointer to a 	driver-specific struct that should be allocated in this routine. 	It will then be passed back in by the kernel to a number of the other 	fs driver functions. vnid should also be passed back to the kernel, 	representing the vnode id of the root vnode.	*/	int result = EINVAL;		// return EINVAL if it's not a device compatible with the driver.	bool allow_joliet = true;	nspace *vol;	(void)flags;		/* Create semaphore if it's not already created. When do we need to		use semaphores? */		// Check for a 'nojoliet' parm	// all we check for is the existance of 'nojoliet' in the parms.	if (parms != NULL) {		int i;		char *spot;		char *buf;		// Make sure the len argument isn't too large		if (len > 1024) 			return EINVAL;				buf = malloc(len + 1);		if (!buf)			return ENOMEM;				memcpy(buf, parms, len);		buf[len] = 0;		// lower case the parms data		for (i = 0; i < len + 1; i++) 			buf[i] = tolower(buf[i]);		// look for nojoliet		spot = strstr(buf, "nojoliet");		if (spot != NULL)			allow_joliet = false;		free(buf);	}	// Try and mount volume as an ISO volume.	result = ISOMount(device, O_RDONLY, &vol, allow_joliet);	// If it is ISO …	if (result == B_NO_ERROR) {		//vnode_id rootID = vol->rootDirRec.startLBN[FS_DATA_FORMAT];		//*vnid = rootID;		*vnid = ISO_ROOTNODE_ID;		*data = (void*)vol;				vol->id = nsid;		// You MUST do this. Create the vnode for the root.		result = new_vnode(nsid, *vnid, (void*)&(vol->rootDirRec));		if (result != B_NO_ERROR) {			remove_cached_device_blocks(vol->fd, 0);			free(vol);			result = EINVAL;		} else 			result = B_NO_ERROR;		}	return result;}