void mnt_reset_fs(struct libmnt_fs *fs)
{
	int ref;

	if (!fs)
		return;

	ref = fs->refcount;

	list_del(&fs->ents);
	free(fs->source);
	free(fs->bindsrc);
	free(fs->tagname);
	free(fs->tagval);
	free(fs->root);
	free(fs->swaptype);
	free(fs->target);
	free(fs->fstype);
	free(fs->optstr);
	free(fs->vfs_optstr);
	free(fs->fs_optstr);
	free(fs->user_optstr);
	free(fs->attrs);
	free(fs->opt_fields);
	free(fs->comment);

	memset(fs, 0, sizeof(*fs));
	INIT_LIST_HEAD(&fs->ents);
	fs->refcount = ref;
}
void mnt_reset_fs(struct libmnt_fs *fs)
{
	int ref;

	if (!fs)
		return;

	ref = fs->refcount;

	list_del(&fs->ents);
	free(fs->source);
	free(fs->bindsrc);
	free(fs->tagname);
	free(fs->tagval);
	free(fs->root);
	free(fs->swaptype);
	free(fs->target);
	free(fs->fstype);
	free(fs->optstr);
	free(fs->vfs_optstr);
	free(fs->fs_optstr);
	free(fs->user_optstr);
	free(fs->attrs);
	free(fs->opt_fields);
	free(fs->comment);

	memset(fs, 0, sizeof(*fs));
	INIT_LIST_HEAD(&fs->ents);
	fs->refcount = ref;
}