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
This commit is contained in:
pjd 2007-11-01 11:04:21 +00:00
parent ad6bad8ed6
commit 12ba547cb4
2 changed files with 22 additions and 22 deletions

View File

@ -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);
}
}

View File

@ -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);
}
}