summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_misc.c
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2018-04-06 13:30:26 -0700
committerBrian Behlendorf <[email protected]>2018-04-06 13:30:26 -0700
commit5c27ec10889d3d8f12d59fb7e5068ed2d8697c85 (patch)
tree299ac1b7654029e6c3281baf560a1fcde4f60751 /module/zfs/spa_misc.c
parent0ba106e75c6cda806cb5d2003b918e658f2ff86c (diff)
Fixes for SNPRINTF_BLKPTR with encrypted BP's
mdb doesn't have dmu_ot[], so we need a different mechanism for its SNPRINTF_BLKPTR() to determine if the BP is encrypted vs authenticated. Additionally, since it already relies on BP_IS_ENCRYPTED (etc), SNPRINTF_BLKPTR might as well figure out the "crypt_type" on its own, rather than making the caller do so. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tom Caputi <[email protected]> Signed-off-by: Matthew Ahrens <[email protected]> Closes #7390
Diffstat (limited to 'module/zfs/spa_misc.c')
-rw-r--r--module/zfs/spa_misc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
index 5e2af24e3..17f8c1638 100644
--- a/module/zfs/spa_misc.c
+++ b/module/zfs/spa_misc.c
@@ -1421,7 +1421,6 @@ snprintf_blkptr(char *buf, size_t buflen, const blkptr_t *bp)
char type[256];
char *checksum = NULL;
char *compress = NULL;
- char *crypt_type = NULL;
if (bp != NULL) {
if (BP_GET_TYPE(bp) & DMU_OT_NEWTYPE) {
@@ -1435,15 +1434,6 @@ snprintf_blkptr(char *buf, size_t buflen, const blkptr_t *bp)
(void) strlcpy(type, dmu_ot[BP_GET_TYPE(bp)].ot_name,
sizeof (type));
}
- if (BP_IS_ENCRYPTED(bp)) {
- crypt_type = "encrypted";
- } else if (BP_IS_AUTHENTICATED(bp)) {
- crypt_type = "authenticated";
- } else if (BP_HAS_INDIRECT_MAC_CKSUM(bp)) {
- crypt_type = "indirect-MAC";
- } else {
- crypt_type = "unencrypted";
- }
if (!BP_IS_EMBEDDED(bp)) {
checksum =
zio_checksum_table[BP_GET_CHECKSUM(bp)].ci_name;
@@ -1452,7 +1442,7 @@ snprintf_blkptr(char *buf, size_t buflen, const blkptr_t *bp)
}
SNPRINTF_BLKPTR(snprintf, ' ', buf, buflen, bp, type, checksum,
- crypt_type, compress);
+ compress);
}
void