Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom_io.c
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | g_clone_bio(struct bio *bp) | ||||
bp2 = uma_zalloc(biozone, M_NOWAIT | M_ZERO); | bp2 = uma_zalloc(biozone, M_NOWAIT | M_ZERO); | ||||
if (bp2 != NULL) { | if (bp2 != NULL) { | ||||
bp2->bio_parent = bp; | bp2->bio_parent = bp; | ||||
bp2->bio_cmd = bp->bio_cmd; | bp2->bio_cmd = bp->bio_cmd; | ||||
/* | /* | ||||
* BIO_ORDERED flag may be used by disk drivers to enforce | * BIO_ORDERED flag may be used by disk drivers to enforce | ||||
* ordering restrictions, so this flag needs to be cloned. | * ordering restrictions, so this flag needs to be cloned. | ||||
* BIO_UNMAPPED and BIO_VLIST should be inherited, to properly | * BIO_UNMAPPED, BIO_VLIST, and BIO_SWAP should be inherited, | ||||
* indicate which way the buffer is passed. | * to properly indicate which way the buffer is passed. | ||||
* Other bio flags are not suitable for cloning. | * Other bio flags are not suitable for cloning. | ||||
*/ | */ | ||||
bp2->bio_flags = bp->bio_flags & | bp2->bio_flags = bp->bio_flags & | ||||
(BIO_ORDERED | BIO_UNMAPPED | BIO_VLIST); | (BIO_ORDERED | BIO_UNMAPPED | BIO_VLIST | BIO_SWAP); | ||||
bp2->bio_length = bp->bio_length; | bp2->bio_length = bp->bio_length; | ||||
bp2->bio_offset = bp->bio_offset; | bp2->bio_offset = bp->bio_offset; | ||||
bp2->bio_data = bp->bio_data; | bp2->bio_data = bp->bio_data; | ||||
bp2->bio_ma = bp->bio_ma; | bp2->bio_ma = bp->bio_ma; | ||||
bp2->bio_ma_n = bp->bio_ma_n; | bp2->bio_ma_n = bp->bio_ma_n; | ||||
bp2->bio_ma_offset = bp->bio_ma_offset; | bp2->bio_ma_offset = bp->bio_ma_offset; | ||||
bp2->bio_attribute = bp->bio_attribute; | bp2->bio_attribute = bp->bio_attribute; | ||||
if (bp->bio_cmd == BIO_ZONE) | if (bp->bio_cmd == BIO_ZONE) | ||||
Show All 17 Lines | |||||
} | } | ||||
struct bio * | struct bio * | ||||
g_duplicate_bio(struct bio *bp) | g_duplicate_bio(struct bio *bp) | ||||
{ | { | ||||
struct bio *bp2; | struct bio *bp2; | ||||
bp2 = uma_zalloc(biozone, M_WAITOK | M_ZERO); | bp2 = uma_zalloc(biozone, M_WAITOK | M_ZERO); | ||||
bp2->bio_flags = bp->bio_flags & (BIO_UNMAPPED | BIO_VLIST); | bp2->bio_flags = bp->bio_flags & (BIO_UNMAPPED | BIO_VLIST | BIO_SWAP); | ||||
bp2->bio_parent = bp; | bp2->bio_parent = bp; | ||||
bp2->bio_cmd = bp->bio_cmd; | bp2->bio_cmd = bp->bio_cmd; | ||||
bp2->bio_length = bp->bio_length; | bp2->bio_length = bp->bio_length; | ||||
bp2->bio_offset = bp->bio_offset; | bp2->bio_offset = bp->bio_offset; | ||||
bp2->bio_data = bp->bio_data; | bp2->bio_data = bp->bio_data; | ||||
bp2->bio_ma = bp->bio_ma; | bp2->bio_ma = bp->bio_ma; | ||||
bp2->bio_ma_n = bp->bio_ma_n; | bp2->bio_ma_n = bp->bio_ma_n; | ||||
bp2->bio_ma_offset = bp->bio_ma_offset; | bp2->bio_ma_offset = bp->bio_ma_offset; | ||||
▲ Show 20 Lines • Show All 831 Lines • Show Last 20 Lines |