diff options
author | pjd <pjd@FreeBSD.org> | 2004-08-04 21:35:05 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-08-04 21:35:05 +0000 |
commit | 0b32901632214fa88085bdbeb1c2e94bb3fa2d07 (patch) | |
tree | c0a8d5c029b11ea1effeb49bac7f946df7e11fc7 /sys/geom/mirror | |
parent | e67812831a97ba1b8beee675349e516de65b73cd (diff) | |
download | FreeBSD-src-0b32901632214fa88085bdbeb1c2e94bb3fa2d07.zip FreeBSD-src-0b32901632214fa88085bdbeb1c2e94bb3fa2d07.tar.gz |
- Add two fields to bio structure: 'bio_cflags' which can be used by
consumer and 'bio_pflags' which can be used by provider.
- Remove BIO_FLAG1 and BIO_FLAG2 flags. From now on new fields should be
used for internal flags.
- Update g_bio(9) manual page.
- Update some comments.
- Update GEOM_MIRROR, which was the only one using BIO_FLAGs.
Idea from: phk
Reviewed by: phk
Diffstat (limited to 'sys/geom/mirror')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 12 | ||||
-rw-r--r-- | sys/geom/mirror/g_mirror.h | 3 |
2 files changed, 9 insertions, 6 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index ffc067c..137b041 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -752,7 +752,7 @@ g_mirror_done(struct bio *bp) struct g_mirror_softc *sc; sc = bp->bio_from->geom->softc; - bp->bio_flags = BIO_FLAG1; + bp->bio_cflags |= G_MIRROR_BIO_FLAG_REGULAR; mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); wakeup(sc); @@ -853,7 +853,7 @@ g_mirror_sync_done(struct bio *bp) G_MIRROR_LOGREQ(3, bp, "Synchronization request delivered."); sc = bp->bio_from->geom->softc; - bp->bio_flags = BIO_FLAG2; + bp->bio_cflags |= G_MIRROR_BIO_FLAG_SYNC; mtx_lock(&sc->sc_queue_mtx); bioq_disksort(&sc->sc_queue, bp); wakeup(sc); @@ -914,7 +914,7 @@ g_mirror_sync_one(struct g_mirror_disk *disk) bp->bio_offset = disk->d_sync.ds_offset; bp->bio_length = MIN(sc->sc_sync.ds_block, sc->sc_mediasize - bp->bio_offset); - bp->bio_flags = 0; + bp->bio_cflags = 0; bp->bio_done = g_mirror_sync_done; bp->bio_data = uma_zalloc(sc->sc_sync.ds_zone, M_NOWAIT | M_ZERO); if (bp->bio_data == NULL) { @@ -961,7 +961,7 @@ g_mirror_sync_request(struct bio *bp) return; } bp->bio_cmd = BIO_WRITE; - bp->bio_flags = 0; + bp->bio_cflags = 0; G_MIRROR_LOGREQ(3, bp, "Synchronization request finished."); cp = disk->d_consumer; KASSERT(cp->acr == 0 && cp->acw == 1 && cp->ace == 1, @@ -1423,9 +1423,9 @@ end: bioq_remove(&sc->sc_queue, bp); mtx_unlock(&sc->sc_queue_mtx); - if ((bp->bio_flags & BIO_FLAG1) != 0) { + if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_REGULAR) != 0) { g_mirror_regular_request(bp); - } else if ((bp->bio_flags & BIO_FLAG2) != 0) { + } else if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_SYNC) != 0) { u_int timeout, sps; g_mirror_sync_request(bp); diff --git a/sys/geom/mirror/g_mirror.h b/sys/geom/mirror/g_mirror.h index 110a9f5..5be5cda 100644 --- a/sys/geom/mirror/g_mirror.h +++ b/sys/geom/mirror/g_mirror.h @@ -83,6 +83,9 @@ extern u_int g_mirror_debug; } \ } while (0) +#define G_MIRROR_BIO_FLAG_REGULAR 0x01 +#define G_MIRROR_BIO_FLAG_SYNC 0x02 + /* * Informations needed for synchronization. */ |