zfs/module/zcommon
наб eb51a9d747
zcommon: pre-iterate over sysfs instead of statting every feature
If sufficient memory (<2K, realistically) is available, libzfs_init()
can be significantly shorted by iterating over the correct sysfs
directory before registrations, we can turn 168 stats into 15/18
syscalls (3 opens (6 if built in), 3 fstats, 6 getdentses, and 3
closes), a tenfoldish reduction; this is probably a bit faster, too.

The list is always optional, and registration functions (and one-off
users) can simply pass NULL, which will fall back to the previous
mechanism

Also, don't allocate in zfs_mod_supported_impl, and use use access()
instead of stat(), since existence is really what we care about

Also, fix pre-prop-checking compat in fallback for built-in ZFS

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Nguyen <tony.nguyen@delphix.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #12089
2021-12-16 16:43:10 -08:00
..
Makefile.in Linux 5.10 compat: use iov_iter in uio structure 2020-12-18 08:48:26 -08:00
cityhash.c Compile cityhash code into libzfs 2020-03-27 09:11:22 -07:00
zfeature_common.c zcommon: pre-iterate over sysfs instead of statting every feature 2021-12-16 16:43:10 -08:00
zfs_comutil.c Fix various typos 2021-04-02 18:52:15 -07:00
zfs_deleg.c Remove code for zfs remap 2019-06-24 16:44:01 -07:00
zfs_fletcher.c FreeBSD: Implement sysctl for fletcher4 impl 2020-12-11 10:29:01 -08:00
zfs_fletcher_aarch64_neon.c OpenZFS restructuring - move platform specific headers 2019-09-05 09:34:54 -07:00
zfs_fletcher_avx512.c Fix AVX512BW Fletcher code on AVX512-but-not-BW machines 2021-04-26 12:42:42 -07:00
zfs_fletcher_intel.c OpenZFS restructuring - move platform specific headers 2019-09-05 09:34:54 -07:00
zfs_fletcher_sse.c OpenZFS restructuring - move platform specific headers 2019-09-05 09:34:54 -07:00
zfs_fletcher_superscalar.c Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
zfs_fletcher_superscalar4.c Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
zfs_namecheck.c Allow pool names that look like Solaris disk names 2021-04-01 08:49:41 -07:00
zfs_prop.c zcommon: pre-iterate over sysfs instead of statting every feature 2021-12-16 16:43:10 -08:00
zpool_prop.c zcommon: pre-iterate over sysfs instead of statting every feature 2021-12-16 16:43:10 -08:00
zprop_common.c zcommon: pre-iterate over sysfs instead of statting every feature 2021-12-16 16:43:10 -08:00