diff options
author | delphij <delphij@FreeBSD.org> | 2014-03-19 23:55:03 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-03-19 23:55:03 +0000 |
commit | ede49d4106ad9e6d34a2592322e48604f72605bd (patch) | |
tree | 0012bcb04d95eaf4e65ed2f983e9d51d47236888 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c | |
parent | 8e41bb96f82aa123d5f4c625c68f95b253640b28 (diff) | |
download | FreeBSD-src-ede49d4106ad9e6d34a2592322e48604f72605bd.zip FreeBSD-src-ede49d4106ad9e6d34a2592322e48604f72605bd.tar.gz |
MFC r260150: MFV r259170:
4370 avoid transmitting holes during zfs send
4371 DMU code clean up
illumos/illumos-gate@43466aae47bfcd2ad9bf501faec8e75c08095e4f
NOTE: Make sure the boot code is updated if a zpool upgrade is
done on boot zpool.
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c index f6ab094..b7fbe9a 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c @@ -119,12 +119,12 @@ ddt_object_load(ddt_t *ddt, enum ddt_type type, enum ddt_class class) error = zap_lookup(ddt->ddt_os, DMU_POOL_DIRECTORY_OBJECT, name, sizeof (uint64_t), 1, &ddt->ddt_object[type][class]); - if (error) + if (error != 0) return (error); - error = zap_lookup(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name, + VERIFY0(zap_lookup(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name, sizeof (uint64_t), sizeof (ddt_histogram_t) / sizeof (uint64_t), - &ddt->ddt_histogram[type][class]); + &ddt->ddt_histogram[type][class])); /* * Seed the cached statistics. @@ -139,8 +139,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_type type, enum ddt_class class) ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; - ASSERT(error == 0); - return (error); + return (0); } static void @@ -595,7 +594,10 @@ ddt_compress(void *src, uchar_t *dst, size_t s_len, size_t d_len) bcopy(src, dst, s_len); } - *version = (ZFS_HOST_BYTEORDER & DDT_COMPRESS_BYTEORDER_MASK) | cpfunc; + *version = cpfunc; + /* CONSTCOND */ + if (ZFS_HOST_BYTEORDER) + *version |= DDT_COMPRESS_BYTEORDER_MASK; return (c_len + 1); } @@ -612,7 +614,8 @@ ddt_decompress(uchar_t *src, void *dst, size_t s_len, size_t d_len) else bcopy(src, dst, d_len); - if ((version ^ ZFS_HOST_BYTEORDER) & DDT_COMPRESS_BYTEORDER_MASK) + if (((version & DDT_COMPRESS_BYTEORDER_MASK) != 0) != + (ZFS_HOST_BYTEORDER != 0)) byteswap_uint64_array(dst, d_len); } |