usr/src/uts/common/fs/zfs/sys/zio.h
changeset 13700 2889e2596bd6
parent 13414 b42c1f0432b6
child 13869 921a99998bb4
equal deleted inserted replaced
13699:733714f4dc24 13700:2889e2596bd6
    22 /*
    22 /*
    23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    23  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
    24  */
    24  */
    25 /*
    25 /*
    26  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
    26  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
       
    27  * Copyright (c) 2012 by Delphix. All rights reserved.
    27  */
    28  */
    28 
    29 
    29 #ifndef _ZIO_H
    30 #ifndef _ZIO_H
    30 #define	_ZIO_H
    31 #define	_ZIO_H
    31 
    32 
   270 #define	ZB_ROOT_BLKID		(0ULL)
   271 #define	ZB_ROOT_BLKID		(0ULL)
   271 
   272 
   272 #define	ZB_ZIL_OBJECT		(0ULL)
   273 #define	ZB_ZIL_OBJECT		(0ULL)
   273 #define	ZB_ZIL_LEVEL		(-2LL)
   274 #define	ZB_ZIL_LEVEL		(-2LL)
   274 
   275 
       
   276 #define	ZB_IS_ZERO(zb)						\
       
   277 	((zb)->zb_objset == 0 && (zb)->zb_object == 0 &&	\
       
   278 	(zb)->zb_level == 0 && (zb)->zb_blkid == 0)
       
   279 #define	ZB_IS_ROOT(zb)				\
       
   280 	((zb)->zb_object == ZB_ROOT_OBJECT &&	\
       
   281 	(zb)->zb_level == ZB_ROOT_LEVEL &&	\
       
   282 	(zb)->zb_blkid == ZB_ROOT_BLKID)
       
   283 
   275 typedef struct zio_prop {
   284 typedef struct zio_prop {
   276 	enum zio_checksum	zp_checksum;
   285 	enum zio_checksum	zp_checksum;
   277 	enum zio_compress	zp_compress;
   286 	enum zio_compress	zp_compress;
   278 	dmu_object_type_t	zp_type;
   287 	dmu_object_type_t	zp_type;
   279 	uint8_t			zp_level;
   288 	uint8_t			zp_level;
   287 typedef void zio_cksum_finish_f(zio_cksum_report_t *rep,
   296 typedef void zio_cksum_finish_f(zio_cksum_report_t *rep,
   288     const void *good_data);
   297     const void *good_data);
   289 typedef void zio_cksum_free_f(void *cbdata, size_t size);
   298 typedef void zio_cksum_free_f(void *cbdata, size_t size);
   290 
   299 
   291 struct zio_bad_cksum;				/* defined in zio_checksum.h */
   300 struct zio_bad_cksum;				/* defined in zio_checksum.h */
       
   301 struct dnode_phys;
   292 
   302 
   293 struct zio_cksum_report {
   303 struct zio_cksum_report {
   294 	struct zio_cksum_report *zcr_next;
   304 	struct zio_cksum_report *zcr_next;
   295 	nvlist_t		*zcr_ereport;
   305 	nvlist_t		*zcr_ereport;
   296 	nvlist_t		*zcr_detector;
   306 	nvlist_t		*zcr_detector;
   556     const void *good_data, const void *bad_data, struct zio_bad_cksum *info);
   566     const void *good_data, const void *bad_data, struct zio_bad_cksum *info);
   557 
   567 
   558 /* Called from spa_sync(), but primarily an injection handler */
   568 /* Called from spa_sync(), but primarily an injection handler */
   559 extern void spa_handle_ignored_writes(spa_t *spa);
   569 extern void spa_handle_ignored_writes(spa_t *spa);
   560 
   570 
       
   571 /* zbookmark functions */
       
   572 boolean_t zbookmark_is_before(const struct dnode_phys *dnp,
       
   573     const zbookmark_t *zb1, const zbookmark_t *zb2);
       
   574 
   561 #ifdef	__cplusplus
   575 #ifdef	__cplusplus
   562 }
   576 }
   563 #endif
   577 #endif
   564 
   578 
   565 #endif	/* _ZIO_H */
   579 #endif	/* _ZIO_H */