diff options
author | kib <kib@FreeBSD.org> | 2013-03-19 15:01:50 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-03-19 15:01:50 +0000 |
commit | 537b66a9dd41b84e2e964e6d454de85053db539d (patch) | |
tree | 88075d8fcf45bba5ec367bb1c54c7ee5c709e855 /sys/cam/ata | |
parent | 23f577dda4d41de8b5815dae3172930208a84774 (diff) | |
download | FreeBSD-src-537b66a9dd41b84e2e964e6d454de85053db539d.zip FreeBSD-src-537b66a9dd41b84e2e964e6d454de85053db539d.tar.gz |
Support unmapped i/o for the md(4).
The vnode-backed md(4) has to map the unmapped bio because VOP_READ()
and VOP_WRITE() interfaces do not allow to pass unmapped requests to
the filesystem. Vnode-backed md(4) uses pbufs instead of relying on
the bio_transient_map, to avoid usual md deadlock.
Sponsored by: The FreeBSD Foundation
Tested by: pho, scottl
Diffstat (limited to 'sys/cam/ata')
-rw-r--r-- | sys/cam/ata/ata_da.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index 4252197..c700e7c 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1167,6 +1167,8 @@ adaregister(struct cam_periph *periph, void *arg) ((softc->flags & ADA_FLAG_CAN_CFA) && !(softc->flags & ADA_FLAG_CAN_48BIT))) softc->disk->d_flags |= DISKFLAG_CANDELETE; + if ((cpi.hba_misc & PIM_UNMAPPED) != 0) + softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; strlcpy(softc->disk->d_descr, cgd->ident_data.model, MIN(sizeof(softc->disk->d_descr), sizeof(cgd->ident_data.model))); strlcpy(softc->disk->d_ident, cgd->ident_data.serial, @@ -1431,13 +1433,19 @@ adastart(struct cam_periph *periph, union ccb *start_ccb) return; } #endif + KASSERT((bp->bio_flags & BIO_UNMAPPED) == 0 || + round_page(bp->bio_bcount + bp->bio_ma_offset) / + PAGE_SIZE == bp->bio_ma_n, + ("Short bio %p", bp)); cam_fill_ataio(ataio, ada_retry_count, adadone, - bp->bio_cmd == BIO_READ ? - CAM_DIR_IN : CAM_DIR_OUT, + (bp->bio_cmd == BIO_READ ? CAM_DIR_IN : + CAM_DIR_OUT) | ((bp->bio_flags & BIO_UNMAPPED) + != 0 ? CAM_DATA_BIO : 0), tag_code, - bp->bio_data, + ((bp->bio_flags & BIO_UNMAPPED) != 0) ? (void *)bp : + bp->bio_data, bp->bio_bcount, ada_default_timeout*1000); |