loader: open file list should be dynamic
Summary:
Open file list is currently created as statically allocated array
(64 items). Once this array is filled up, loader will not be able
to operate with files. In most cases, this mechanism is good enough,
but the problem appears, when we have many disks with zfs pool(s).
In current loader implementation, all discovered zfs pool
configurations are kept in memory and disk devices open - consuming
the open file array. Rewrite the open file mechanism to use
dynamically allocated list.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D31364
(cherry picked from commit 97cbd5e722389a575e820c4e03f38053308f08ea)