diff options
author | delphij <delphij@FreeBSD.org> | 2014-07-15 04:53:34 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-07-15 04:53:34 +0000 |
commit | 9d1dc5bcc93f630c5fc480593d45fbcfebef15f2 (patch) | |
tree | 8bb48019ff1fadeaecb28e32888ab6093a430843 /sys/boot | |
parent | 5ed76404fecd3da81f3708db0259176767603aa5 (diff) | |
download | FreeBSD-src-9d1dc5bcc93f630c5fc480593d45fbcfebef15f2.zip FreeBSD-src-9d1dc5bcc93f630c5fc480593d45fbcfebef15f2.tar.gz |
MFC r268075: MFV r267565:
4757 ZFS embedded-data block pointers ("zero block compression")
4913 zfs release should not be subject to space checks
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/zfs/zfsimpl.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c index b240b96..16b57c7 100644 --- a/sys/boot/zfs/zfsimpl.c +++ b/sys/boot/zfs/zfsimpl.c @@ -56,6 +56,7 @@ static const char *features_for_read[] = { "org.illumos:lz4_compress", "com.delphix:hole_birth", "com.delphix:extensible_dataset", + "com.delphix:embedded_data", NULL }; @@ -1133,6 +1134,34 @@ zio_read(const spa_t *spa, const blkptr_t *bp, void *buf) void *pbuf; int i, error; + /* + * Process data embedded in block pointer + */ + if (BP_IS_EMBEDDED(bp)) { + ASSERT(BPE_GET_ETYPE(bp) == BP_EMBEDDED_TYPE_DATA); + + size = BPE_GET_PSIZE(bp); + ASSERT(size <= BPE_PAYLOAD_SIZE); + + if (cpfunc != ZIO_COMPRESS_OFF) + pbuf = zfs_alloc(size); + else + pbuf = buf; + + decode_embedded_bp_compressed(bp, pbuf); + error = 0; + + if (cpfunc != ZIO_COMPRESS_OFF) { + error = zio_decompress_data(cpfunc, pbuf, + size, buf, BP_GET_LSIZE(bp)); + zfs_free(pbuf, size); + } + if (error != 0) + printf("ZFS: i/o error - unable to decompress block pointer data, error %d\n", + error); + return (error); + } + error = EIO; for (i = 0; i < SPA_DVAS_PER_BP; i++) { |