mailing list.
When initiating a write, ccdbuffer() returns two "struct ccdbuf *"s
linked together by the cb_mirror field. "cb_pflags &
CCDPF_MIRROR_DONE" is set to 0 on both of them.
When a component returns to ccdiodone(), it checks if "cb_pflags &
CCDPF_MIRROR_DONE" is set or not. If not, it sets the partner's
flag and returns. If it is, it means its partner has already
returned, so it will go to the regular cleanup (which is in the
fallthrough code).
There should be no performance or functionality changes unless the
higher-level scsi driver does something with the resid value. The change
is purely aesthetical and prepares us for the parity implementation.
caused by a different reason):
. #ifndef __FreeBSD__ around check for negative size, FreeBSD size_t is
unsigned
. Disable mirror/parity if interleave size is 0 (i.e., serial concatenation).
(1) The reads are always done from the first n/2 disks.
(2) Each write is done twice, to the "data" disk (in the first half) and
the "mirror" disk (in the second half).
ccdbuffer() now takes an extra argument (struct ccdbuf **) and stores
the pointer to ccdbuf in there. In case of a mirrored write, it
allocates and stores two pointers. The "residual" is also doubled
for mirrored writes so that ccdiodone() can correctly tell when all
the writes are done.