target: Allocate se_luns only when used
Instead of allocating the tpg_lun_list and each member of the list when
the tpg is created, make the list part of the parent struct, and use an
element being non-NULL to indicate an active LUN. This will save memory
if less than all the se_luns are actually configured.
Now that things are actually getting freed, split out core_tpg_free_lun
from core_tpg_remove_lun, because we don't want to free() the statically-
Remove array_free and array_zalloc.
Change core_dev_add_lun to take a se_lun and return int
Do not allocate tpg_lun_list, put it directly in se_portal_group.
Reviewed-by: Christoph Hellwig <email@example.com>
Signed-off-by: Andy Grover <firstname.lastname@example.org>
6 files changed