summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-11-01 11:04:21 +0000
committerpjd <pjd@FreeBSD.org>2007-11-01 11:04:21 +0000
commit12ba547cb49cd7d99c9c3e33a4832c88fb66a436 (patch)
tree2318863b8264ec70945b0630516e741eccdddbeb /sys/contrib
parentad6bad8ed6c3f69fb12700acd8f288968ec02bca (diff)
downloadFreeBSD-src-12ba547cb49cd7d99c9c3e33a4832c88fb66a436.zip
FreeBSD-src-12ba547cb49cd7d99c9c3e33a4832c88fb66a436.tar.gz
Call zil_commit() (if ZIL is not disabled) after every non-read request
(BIO_WRITE and BIO_FLUSH) as it is done is Solaris. The difference is that Solaris calls it only for sync requests, but we can't say in GEOM is the request is sync or async, so we do it for every request. MFC after: 1 week
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/opensolaris/uts/common/fs/zfs/zvol.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/contrib/opensolaris/uts/common/fs/zfs/zvol.c
index 38d164e..fedae03 100644
--- a/sys/contrib/opensolaris/uts/common/fs/zfs/zvol.c
+++ b/sys/contrib/opensolaris/uts/common/fs/zfs/zvol.c
@@ -335,13 +335,6 @@ zvol_serve_one(zvol_state_t *zv, struct bio *bp)
bp->bio_completed = bp->bio_length - resid;
if (bp->bio_completed < bp->bio_length)
bp->bio_error = (off > volsize ? EINVAL : error);
-
- /*
- * XXX: We are devilering here?
- * Looks like I don't understand something here, but I was sure it was
- * an async request.
- */
- g_io_deliver(bp, bp->bio_error);
}
static void
@@ -366,12 +359,19 @@ zvol_worker(void *arg)
continue;
}
mtx_unlock(&zv->zv_queue_mtx);
- if (bp->bio_cmd == BIO_FLUSH) {
- zil_commit(zv->zv_zilog, UINT64_MAX, ZVOL_OBJ);
- g_io_deliver(bp, 0);
- } else {
+ switch (bp->bio_cmd) {
+ case BIO_FLUSH:
+ break;
+ case BIO_READ:
+ case BIO_WRITE:
zvol_serve_one(zv, bp);
+ break;
}
+
+ if (bp->bio_cmd != BIO_READ && !zil_disable)
+ zil_commit(zv->zv_zilog, UINT64_MAX, ZVOL_OBJ);
+
+ g_io_deliver(bp, bp->bio_error);
}
}
OpenPOWER on IntegriCloud