mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Expose dataset encryption status via fast stat path
In truenas_pylibzfs, we query list of encrypted datasets several times, which is expensive. This commit exposes a public API zfs_is_encrypted() to get encryption status from fast stat path without having to refresh the properties. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Rob Norris <robn@despairlabs.com> Signed-off-by: Ameer Hamza <ahamza@ixsystems.com> Closes #17368
This commit is contained in:
@@ -2886,6 +2886,9 @@ dsl_dataset_fast_stat(dsl_dataset_t *ds, dmu_objset_stats_t *stat)
|
||||
stat->dds_guid = dsl_get_guid(ds);
|
||||
stat->dds_redacted = dsl_get_redacted(ds);
|
||||
stat->dds_origin[0] = '\0';
|
||||
stat->dds_flags = DDS_FLAG_HAS_ENCRYPTED;
|
||||
if (ds->ds_dir->dd_crypto_obj != 0)
|
||||
stat->dds_flags |= DDS_FLAG_ENCRYPTED;
|
||||
if (ds->ds_is_snapshot) {
|
||||
stat->dds_is_snapshot = B_TRUE;
|
||||
stat->dds_num_clones = dsl_get_numclones(ds);
|
||||
|
||||
Reference in New Issue
Block a user