Page MenuHomeFreeBSD

D45155.diff
No OneTemporary

D45155.diff

diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -887,23 +887,6 @@
int ma_offs, npages;
bool mapped;
- switch (bp->bio_cmd) {
- case BIO_READ:
- auio.uio_rw = UIO_READ;
- break;
- case BIO_WRITE:
- auio.uio_rw = UIO_WRITE;
- break;
- case BIO_FLUSH:
- break;
- case BIO_DELETE:
- if (sc->candelete)
- break;
- /* FALLTHROUGH */
- default:
- return (EOPNOTSUPP);
- }
-
td = curthread;
vp = sc->vnode;
piov = NULL;
@@ -920,7 +903,14 @@
* still valid.
*/
- if (bp->bio_cmd == BIO_FLUSH) {
+ switch (bp->bio_cmd) {
+ case BIO_READ:
+ auio.uio_rw = UIO_READ;
+ break;
+ case BIO_WRITE:
+ auio.uio_rw = UIO_WRITE;
+ break;
+ case BIO_FLUSH:
do {
(void)vn_start_write(vp, &mp, V_WAIT);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
@@ -929,11 +919,17 @@
vn_finished_write(mp);
} while (error == ERELOOKUP);
return (error);
- } else if (bp->bio_cmd == BIO_DELETE) {
- error = vn_deallocate(vp, &off, &len, 0,
- sc->flags & MD_ASYNC ? 0 : IO_SYNC, sc->cred, NOCRED);
- bp->bio_resid = len;
- return (error);
+ case BIO_DELETE:
+ if (sc->candelete) {
+ error = vn_deallocate(vp, &off, &len, 0,
+ sc->flags & MD_ASYNC ? 0 : IO_SYNC, sc->cred,
+ NOCRED);
+ bp->bio_resid = len;
+ return (error);
+ }
+ /* FALLTHROUGH */
+ default:
+ return (EOPNOTSUPP);
}
auio.uio_offset = (vm_ooffset_t)bp->bio_offset;
@@ -981,7 +977,7 @@
auio.uio_iovcnt = 1;
}
iostart = auio.uio_offset;
- if (auio.uio_rw == UIO_READ) {
+ if (bp->bio_cmd == BIO_READ) {
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
error = VOP_READ(vp, &auio, 0, sc->cred);
VOP_UNLOCK(vp);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 8:25 PM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14723028
Default Alt Text
D45155.diff (1 KB)

Event Timeline