/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
#ifndef _ZIO_H
ZIO_COMPRESS_GZIP_8,
ZIO_COMPRESS_GZIP_9,
ZIO_COMPRESS_ZLE,
+ ZIO_COMPRESS_LZ4,
ZIO_COMPRESS_FUNCTIONS
};
#define BOOTFS_COMPRESS_VALID(compress) \
((compress) == ZIO_COMPRESS_LZJB || \
+ (compress) == ZIO_COMPRESS_LZ4 || \
((compress) == ZIO_COMPRESS_ON && \
ZIO_COMPRESS_ON_VALUE == ZIO_COMPRESS_LZJB) || \
(compress) == ZIO_COMPRESS_OFF)
#define ZB_ZIL_OBJECT (0ULL)
#define ZB_ZIL_LEVEL (-2LL)
+#define ZB_IS_ZERO(zb) \
+ ((zb)->zb_objset == 0 && (zb)->zb_object == 0 && \
+ (zb)->zb_level == 0 && (zb)->zb_blkid == 0)
+#define ZB_IS_ROOT(zb) \
+ ((zb)->zb_object == ZB_ROOT_OBJECT && \
+ (zb)->zb_level == ZB_ROOT_LEVEL && \
+ (zb)->zb_blkid == ZB_ROOT_BLKID)
+
typedef struct zio_prop {
enum zio_checksum zp_checksum;
enum zio_compress zp_compress;
typedef void zio_cksum_free_f(void *cbdata, size_t size);
struct zio_bad_cksum; /* defined in zio_checksum.h */
+struct dnode_phys;
struct zio_cksum_report {
struct zio_cksum_report *zcr_next;
const zio_vsd_ops_t *io_vsd_ops;
uint64_t io_offset;
- uint64_t io_deadline;
+ uint64_t io_deadline; /* expires at timestamp + deadline */
+ uint64_t io_timestamp; /* submitted at (ticks) */
+ uint64_t io_delta; /* vdev queue service delta (ticks) */
+ uint64_t io_delay; /* vdev disk service delta (ticks) */
avl_node_t io_offset_node;
avl_node_t io_deadline_node;
avl_tree_t *io_vdev_tree;
enum zio_flag io_orig_flags;
enum zio_stage io_orig_stage;
enum zio_stage io_orig_pipeline;
- uint64_t io_delay;
int io_error;
int io_child_error[ZIO_CHILD_TYPES];
uint64_t io_children[ZIO_CHILD_TYPES][ZIO_WAIT_TYPES];
extern int zio_handle_device_injection(vdev_t *vd, zio_t *zio, int error);
extern int zio_handle_label_injection(zio_t *zio, int error);
extern void zio_handle_ignored_writes(zio_t *zio);
+extern uint64_t zio_handle_io_delay(zio_t *zio);
/*
* Checksum ereport functions
/* Called from spa_sync(), but primarily an injection handler */
extern void spa_handle_ignored_writes(spa_t *spa);
+/* zbookmark functions */
+boolean_t zbookmark_is_before(const struct dnode_phys *dnp,
+ const zbookmark_t *zb1, const zbookmark_t *zb2);
+
#ifdef __cplusplus
}
#endif