zfs/lib/libzfs
наб 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
..
os Vdev Properties Feature 2021-11-30 07:46:25 -07:00
.gitignore Clean up lib dependencies 2020-07-10 14:26:00 -07:00
Makefile.am Simplify and document OpenZFS library dependencies 2021-10-07 11:31:26 -06:00
THIRDPARTYLICENSE.openssl Fix typos in lib/ 2019-09-02 17:53:27 -07:00
THIRDPARTYLICENSE.openssl.descrip Encryption patch follow-up 2017-10-11 16:54:48 -04:00
libzfs.abi zcommon: pre-iterate over sysfs instead of statting every feature 2021-12-16 16:43:10 -08:00
libzfs.pc.in Spruce up pkg-config files for libzfs/libzfs_core 2020-09-04 11:11:18 -07:00
libzfs.suppr Library ABI tracking with abigail 2020-11-17 09:18:52 -08:00
libzfs_changelist.c zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2021-12-16 11:56:22 -08:00
libzfs_config.c Use zfs_ioctl with zfs_cmd_t in libzfs 2019-10-23 17:29:43 -07:00
libzfs_crypto.c zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2021-12-16 11:56:22 -08:00
libzfs_dataset.c zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2021-12-16 11:56:22 -08:00
libzfs_diff.c libzfs: diff: simplify superfluous stdio 2021-12-13 15:50:38 -08:00
libzfs_impl.h zfs, libzfs: diff: accept -h/ZFS_DIFF_NO_MANGLE, disabling path escaping 2021-12-13 15:49:40 -08:00
libzfs_import.c libzfs: don't distribute libzfs_impl.h 2021-06-03 13:17:35 -07:00
libzfs_iter.c zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2021-12-16 11:56:22 -08:00
libzfs_mount.c zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2021-12-16 11:56:22 -08:00
libzfs_pool.c libzfs: zpool_set_vdev_prop: remove unused vprop 2021-12-13 15:50:09 -08:00
libzfs_sendrecv.c zfs list: Allow more fields in ZFS_ITER_SIMPLE mode 2021-12-16 11:56:22 -08:00
libzfs_status.c Improvements to the 'compatibility' property 2021-04-12 09:08:56 -07:00
libzfs_util.c Vdev Properties Feature 2021-11-30 07:46:25 -07:00