zio.c (268079) | zio.c (268123) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 536 unchanged lines hidden (view full) --- 545 * ========================================================================== 546 * Create the various types of I/O (read, write, free, etc) 547 * ========================================================================== 548 */ 549static zio_t * 550zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, 551 void *data, uint64_t size, zio_done_func_t *done, void *private, 552 zio_type_t type, zio_priority_t priority, enum zio_flag flags, | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 536 unchanged lines hidden (view full) --- 545 * ========================================================================== 546 * Create the various types of I/O (read, write, free, etc) 547 * ========================================================================== 548 */ 549static zio_t * 550zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, 551 void *data, uint64_t size, zio_done_func_t *done, void *private, 552 zio_type_t type, zio_priority_t priority, enum zio_flag flags, |
553 vdev_t *vd, uint64_t offset, const zbookmark_t *zb, | 553 vdev_t *vd, uint64_t offset, const zbookmark_phys_t *zb, |
554 enum zio_stage stage, enum zio_stage pipeline) 555{ 556 zio_t *zio; 557 558 ASSERT3U(type == ZIO_TYPE_FREE || size, <=, SPA_MAXBLOCKSIZE); 559 ASSERT(P2PHASE(size, SPA_MINBLOCKSIZE) == 0); 560 ASSERT(P2PHASE(offset, SPA_MINBLOCKSIZE) == 0); 561 --- 92 unchanged lines hidden (view full) --- 654zio_root(spa_t *spa, zio_done_func_t *done, void *private, enum zio_flag flags) 655{ 656 return (zio_null(NULL, spa, NULL, done, private, flags)); 657} 658 659zio_t * 660zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, 661 void *data, uint64_t size, zio_done_func_t *done, void *private, | 554 enum zio_stage stage, enum zio_stage pipeline) 555{ 556 zio_t *zio; 557 558 ASSERT3U(type == ZIO_TYPE_FREE || size, <=, SPA_MAXBLOCKSIZE); 559 ASSERT(P2PHASE(size, SPA_MINBLOCKSIZE) == 0); 560 ASSERT(P2PHASE(offset, SPA_MINBLOCKSIZE) == 0); 561 --- 92 unchanged lines hidden (view full) --- 654zio_root(spa_t *spa, zio_done_func_t *done, void *private, enum zio_flag flags) 655{ 656 return (zio_null(NULL, spa, NULL, done, private, flags)); 657} 658 659zio_t * 660zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, 661 void *data, uint64_t size, zio_done_func_t *done, void *private, |
662 zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb) | 662 zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb) |
663{ 664 zio_t *zio; 665 666 zio = zio_create(pio, spa, BP_PHYSICAL_BIRTH(bp), bp, 667 data, size, done, private, 668 ZIO_TYPE_READ, priority, flags, NULL, 0, zb, 669 ZIO_STAGE_OPEN, (flags & ZIO_FLAG_DDT_CHILD) ? 670 ZIO_DDT_CHILD_READ_PIPELINE : ZIO_READ_PIPELINE); 671 672 return (zio); 673} 674 675zio_t * 676zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, 677 void *data, uint64_t size, const zio_prop_t *zp, 678 zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, 679 void *private, | 663{ 664 zio_t *zio; 665 666 zio = zio_create(pio, spa, BP_PHYSICAL_BIRTH(bp), bp, 667 data, size, done, private, 668 ZIO_TYPE_READ, priority, flags, NULL, 0, zb, 669 ZIO_STAGE_OPEN, (flags & ZIO_FLAG_DDT_CHILD) ? 670 ZIO_DDT_CHILD_READ_PIPELINE : ZIO_READ_PIPELINE); 671 672 return (zio); 673} 674 675zio_t * 676zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, 677 void *data, uint64_t size, const zio_prop_t *zp, 678 zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, 679 void *private, |
680 zio_priority_t priority, enum zio_flag flags, const zbookmark_t *zb) | 680 zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb) |
681{ 682 zio_t *zio; 683 684 ASSERT(zp->zp_checksum >= ZIO_CHECKSUM_OFF && 685 zp->zp_checksum < ZIO_CHECKSUM_FUNCTIONS && 686 zp->zp_compress >= ZIO_COMPRESS_OFF && 687 zp->zp_compress < ZIO_COMPRESS_FUNCTIONS && 688 DMU_OT_IS_VALID(zp->zp_type) && --- 21 unchanged lines hidden (view full) --- 710 } 711 712 return (zio); 713} 714 715zio_t * 716zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, 717 uint64_t size, zio_done_func_t *done, void *private, | 681{ 682 zio_t *zio; 683 684 ASSERT(zp->zp_checksum >= ZIO_CHECKSUM_OFF && 685 zp->zp_checksum < ZIO_CHECKSUM_FUNCTIONS && 686 zp->zp_compress >= ZIO_COMPRESS_OFF && 687 zp->zp_compress < ZIO_COMPRESS_FUNCTIONS && 688 DMU_OT_IS_VALID(zp->zp_type) && --- 21 unchanged lines hidden (view full) --- 710 } 711 712 return (zio); 713} 714 715zio_t * 716zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, 717 uint64_t size, zio_done_func_t *done, void *private, |
718 zio_priority_t priority, enum zio_flag flags, zbookmark_t *zb) | 718 zio_priority_t priority, enum zio_flag flags, zbookmark_phys_t *zb) |
719{ 720 zio_t *zio; 721 722 zio = zio_create(pio, spa, txg, bp, data, size, done, private, 723 ZIO_TYPE_WRITE, priority, flags, NULL, 0, zb, 724 ZIO_STAGE_OPEN, ZIO_REWRITE_PIPELINE); 725 726 return (zio); --- 2638 unchanged lines hidden (view full) --- 3365 zio_vdev_io_done, 3366 zio_vdev_io_assess, 3367 zio_checksum_verify, 3368 zio_done 3369}; 3370 3371/* dnp is the dnode for zb1->zb_object */ 3372boolean_t | 719{ 720 zio_t *zio; 721 722 zio = zio_create(pio, spa, txg, bp, data, size, done, private, 723 ZIO_TYPE_WRITE, priority, flags, NULL, 0, zb, 724 ZIO_STAGE_OPEN, ZIO_REWRITE_PIPELINE); 725 726 return (zio); --- 2638 unchanged lines hidden (view full) --- 3365 zio_vdev_io_done, 3366 zio_vdev_io_assess, 3367 zio_checksum_verify, 3368 zio_done 3369}; 3370 3371/* dnp is the dnode for zb1->zb_object */ 3372boolean_t |
3373zbookmark_is_before(const dnode_phys_t *dnp, const zbookmark_t *zb1, 3374 const zbookmark_t *zb2) | 3373zbookmark_is_before(const dnode_phys_t *dnp, const zbookmark_phys_t *zb1, 3374 const zbookmark_phys_t *zb2) |
3375{ 3376 uint64_t zb1nextL0, zb2thisobj; 3377 3378 ASSERT(zb1->zb_objset == zb2->zb_objset); 3379 ASSERT(zb2->zb_level == 0); 3380 3381 /* The objset_phys_t isn't before anything. */ 3382 if (dnp == NULL) --- 22 unchanged lines hidden --- | 3375{ 3376 uint64_t zb1nextL0, zb2thisobj; 3377 3378 ASSERT(zb1->zb_objset == zb2->zb_objset); 3379 ASSERT(zb2->zb_level == 0); 3380 3381 /* The objset_phys_t isn't before anything. */ 3382 if (dnp == NULL) --- 22 unchanged lines hidden --- |