uuid_t shared_uuid; /* validator for safety */
};
+#define HAMMER_IOC_MIRROR_NODATA 0x0001 /* do not include bulk data */
+
/*
* NOTE: crc is for the data block starting at rec_size, not including the
* data[] array.
#define HAMMER_MREC_TYPE_REC_BADCRC (HAMMER_MREC_TYPE_REC | \
HAMMER_MRECF_CRC_ERROR)
+#define HAMMER_MREC_TYPE_REC_NODATA (HAMMER_MREC_TYPE_REC | \
+ HAMMER_MRECF_NODATA)
#define HAMMER_MRECF_TYPE_LOMASK 0x000000FF
#define HAMMER_MRECF_TYPE_MASK 0x800000FF
#define HAMMER_MRECF_DATA_CRC_BAD 0x40000000
#define HAMMER_MRECF_RECD_CRC_BAD 0x20000000
+#define HAMMER_MRECF_NODATA 0x10000000
#define HAMMER_MREC_CRCOFF (offsetof(struct hammer_ioc_mrecord_head, rec_size))
#define HAMMER_MREC_HEADSIZE sizeof(struct hammer_ioc_mrecord_head)
*
* CRC errors on data are reported but passed through,
* but the data must be washed by the user program.
+ *
+ * If userland just wants the btree records it can
+ * request that bulk data not be returned. This is
+ * use during mirror-stream histogram generation.
*/
mrec_flags = 0;
data_len = (elm->data_offset) ? elm->data_len : 0;
+ if (data_len &&
+ (mirror->head.flags & HAMMER_IOC_MIRROR_NODATA)) {
+ data_len = 0;
+ mrec_flags |= HAMMER_MRECF_NODATA;
+ }
if (data_len) {
error = hammer_btree_extract(&cursor,
HAMMER_CURSOR_GET_DATA);
if (error == 0)
error = hammer_ioc_mirror_write_rec(&cursor, &mrec.rec, mirror, localization, uptr + sizeof(mrec.rec));
break;
+ case HAMMER_MREC_TYPE_REC_NODATA:
case HAMMER_MREC_TYPE_REC_BADCRC:
/*
* Records with bad data payloads are ignored XXX.
+ * Records with no data payload have to be skipped
+ * (they shouldn't have been written in the first
+ * place).
*/
if (mrec.head.rec_size < sizeof(mrec.rec))
error = EINVAL;