static void cgdstrategy(struct buf *bp) { struct cgd_softc *cs = getcgd_softc(bp->b_dev); struct dk_softc *dksc = &cs->sc_dksc; struct disk_geom *dg = &dksc->sc_dkdev.dk_geom; DPRINTF_FOLLOW(("cgdstrategy(%p): b_bcount = %ld\n", bp, (long)bp->b_bcount)); /* * Reject unaligned writes. We can encrypt and decrypt only * complete disk sectors, and we let the ciphers require their * buffers to be aligned to 32-bit boundaries. */ if (bp->b_blkno < 0 || (bp->b_bcount % dg->dg_secsize) != 0 || ((uintptr_t)bp->b_data & 3) != 0) { bp->b_error = EINVAL; bp->b_resid = bp->b_bcount; biodone(bp); return; } /* XXXrcd: Should we test for (cs != NULL)? */ dk_strategy(&cs->sc_dksc, bp); return; }
void xbdstrategy(struct buf *bp) { struct xbd_softc *xs = getxbd_softc(bp->b_dev); DPRINTF_FOLLOW(("xbdstrategy(%p): b_bcount = %ld\n", bp, (long)bp->b_bcount)); if (xs == NULL || xs->sc_shutdown) { bp->b_flags |= B_ERROR; bp->b_error = EIO; biodone(bp); return; } dk_strategy(xs->sc_di, &xs->sc_dksc, bp); return; }