ti->typeid = target_type_id++;
int tgt_target_template_register(struct tgt_target_template *tt){	static int target_type_id;	unsigned long flags;	struct target_type_internal *ti;	int err;	ti = kzalloc(sizeof(*ti), GFP_KERNEL);	if (!ti)		return -ENOMEM;	INIT_LIST_HEAD(&ti->list);	ti->tt = tt;	ti->proto = tgt_protocol_get(tt->protocol);	if (!ti->proto) {		eprintk("Could not find %s protocol\n", tt->protocol);		kfree(ti);		return -EINVAL;	}	err = tgt_sysfs_register_type(ti);	if (err)		goto proto_put;	spin_lock_irqsave(&target_tmpl_lock, flags);	list_add_tail(&ti->list, &target_tmpl_list);	ti->typeid = target_type_id++;	spin_unlock_irqrestore(&target_tmpl_lock, flags);	return 0;proto_put:	tgt_protocol_put(ti->proto);	kfree(ti);	return err;}