Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/nvme/nvme_ns.c
Show First 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | nvme_bio_child_inbed(struct bio *parent, int bio_error) | ||||
* must add 1 to get the updated inbed number. Save bio_children | * must add 1 to get the updated inbed number. Save bio_children | ||||
* before incrementing to guard against race conditions when | * before incrementing to guard against race conditions when | ||||
* two children bios complete on different queues. | * two children bios complete on different queues. | ||||
*/ | */ | ||||
children = atomic_load_acq_int(&parent->bio_children); | children = atomic_load_acq_int(&parent->bio_children); | ||||
inbed = atomic_fetchadd_int(&parent->bio_inbed, 1) + 1; | inbed = atomic_fetchadd_int(&parent->bio_inbed, 1) + 1; | ||||
if (inbed == children) { | if (inbed == children) { | ||||
bzero(&parent_cpl, sizeof(parent_cpl)); | bzero(&parent_cpl, sizeof(parent_cpl)); | ||||
if (parent->bio_flags & BIO_ERROR) { | if (parent->bio_flags & BIO_ERROR) | ||||
parent_cpl.status &= ~(NVME_STATUS_SC_MASK << NVME_STATUS_SC_SHIFT); | parent_cpl.status.sc = NVME_SC_DATA_TRANSFER_ERROR; | ||||
mst_semihalf.com: Again, broken on big-endian. | |||||
parent_cpl.status |= (NVME_SC_DATA_TRANSFER_ERROR) << NVME_STATUS_SC_SHIFT; | |||||
} | |||||
nvme_ns_bio_done(parent, &parent_cpl); | nvme_ns_bio_done(parent, &parent_cpl); | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
nvme_bio_child_done(void *arg, const struct nvme_completion *cpl) | nvme_bio_child_done(void *arg, const struct nvme_completion *cpl) | ||||
{ | { | ||||
struct bio *child = arg; | struct bio *child = arg; | ||||
▲ Show 20 Lines • Show All 312 Lines • Show Last 20 Lines |
Again, broken on big-endian.