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:
Ameer Hamza
2025-05-27 07:11:03 +05:00
committed by GitHub
parent b048bfa9c1
commit 2a91d577b1
6 changed files with 32 additions and 0 deletions
+6
View File
@@ -997,6 +997,11 @@ void dmu_object_size_from_db(dmu_buf_t *db, uint32_t *blksize,
void dmu_object_dnsize_from_db(dmu_buf_t *db, int *dnsize);
typedef enum {
DDS_FLAG_ENCRYPTED = (1<<0),
DDS_FLAG_HAS_ENCRYPTED = (1<<7),
} dmu_objset_flag_t;
typedef struct dmu_objset_stats {
uint64_t dds_num_clones; /* number of clones of this */
uint64_t dds_creation_txg;
@@ -1006,6 +1011,7 @@ typedef struct dmu_objset_stats {
uint8_t dds_inconsistent;
uint8_t dds_redacted;
char dds_origin[ZFS_MAX_DATASET_NAME_LEN];
uint8_t dds_flags; /* dmu_objset_flag_t */
} dmu_objset_stats_t;
/*