/* Once this function has returned the &struct file_system_type structure may be freed or reused.  */
int unregister_filesystem(struct file_system_type *fs)
/* Once this function has returned the &struct file_system_type structure may be freed or reused.  */
int unregister_filesystem(struct file_system_type *fs)
{
	struct file_system_type ** tmp;
	write_lock(&file_systems_lock);
	tmp = &file_systems;
	while (*tmp) {
		if (fs == *tmp) {
			*tmp = fs->next;
			fs->next = NULL;
			write_unlock(&file_systems_lock);
			return 0;
		}
		tmp = &(*tmp)->next;
	}
	write_unlock(&file_systems_lock);
	return -EINVAL;
}