rem: mutex_lock(&gMountMutex);
add: mount = get_mount(mountID); if (mount == NULL) return B_BAD_VALUE;
context: index_dir_open(mount_id mountID, bool kernel){	struct fs_mount *mount;	fs_cookie cookie;	int status;	FUNCTION(("index_dir_open(mountID = %ld, kernel = %d)\n", mountID, kernel));	mutex_lock(&gMountMutex);		mount = find_mount(mountID);	if (mount == NULL)		goto err;	// ToDo: lock the mount in some way - i.e. increment the root node's ref counter	mutex_unlock(&gMountMutex);		if (FS_MOUNT_CALL(mount, open_index_dir) == NULL)		return EOPNOTSUPP;	status = FS_MOUNT_CALL(mount, open_index_dir)(mount->cookie, &cookie);	if (status < B_OK)		return status;	// get fd for the index directory	status = get_new_fd(FDTYPE_INDEX_DIR, (void *)mount, cookie, 0, kernel);	if (status >= 0)		return status;err1:	FS_MOUNT_CALL(mount, close_index_dir)(mount->cookie, cookie);	FS_MOUNT_CALL(mount, free_index_dir_cookie)(mount->cookie, cookie);	return status;err:	mutex_unlock(&gMountMutex);		return B_BAD_VALUE;}