Better pack struct zio_prop

By using precisely sized fields it is possible to reduce the size
of this structure and respectively struct zio it is included into
by 40 bytes (from 92 to 52).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #17619
This commit is contained in:
Alexander Motin 2025-08-12 16:28:46 -04:00 committed by GitHub
parent 531568f438
commit e0e60d319c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,26 +360,26 @@ struct zbookmark_err_phys {
(zb)->zb_blkid == ZB_ROOT_BLKID) (zb)->zb_blkid == ZB_ROOT_BLKID)
typedef struct zio_prop { typedef struct zio_prop {
enum zio_checksum zp_checksum; enum zio_checksum zp_checksum:8;
enum zio_compress zp_compress; enum zio_compress zp_compress:8;
uint8_t zp_complevel; uint8_t zp_complevel;
uint8_t zp_level; uint8_t zp_level;
uint8_t zp_copies; uint8_t zp_copies;
uint8_t zp_gang_copies; uint8_t zp_gang_copies;
dmu_object_type_t zp_type; dmu_object_type_t zp_type:8;
boolean_t zp_dedup; dmu_object_type_t zp_storage_type:8;
boolean_t zp_dedup_verify; boolean_t zp_dedup:1;
boolean_t zp_nopwrite; boolean_t zp_dedup_verify:1;
boolean_t zp_brtwrite; boolean_t zp_nopwrite:1;
boolean_t zp_encrypt; boolean_t zp_brtwrite:1;
boolean_t zp_byteorder; boolean_t zp_encrypt:1;
boolean_t zp_direct_write; boolean_t zp_byteorder:1;
boolean_t zp_rewrite; boolean_t zp_direct_write:1;
boolean_t zp_rewrite:1;
uint32_t zp_zpl_smallblk;
uint8_t zp_salt[ZIO_DATA_SALT_LEN]; uint8_t zp_salt[ZIO_DATA_SALT_LEN];
uint8_t zp_iv[ZIO_DATA_IV_LEN]; uint8_t zp_iv[ZIO_DATA_IV_LEN];
uint8_t zp_mac[ZIO_DATA_MAC_LEN]; uint8_t zp_mac[ZIO_DATA_MAC_LEN];
uint32_t zp_zpl_smallblk;
dmu_object_type_t zp_storage_type;
} zio_prop_t; } zio_prop_t;
typedef struct zio_cksum_report zio_cksum_report_t; typedef struct zio_cksum_report zio_cksum_report_t;