Index: sys/sys/bio.h =================================================================== RCS file: /private/FreeBSD/src/sys/sys/bio.h,v retrieving revision 1.138 diff -u -p -r1.138 bio.h --- sys/sys/bio.h 16 Jun 2004 09:47:24 -0000 1.138 +++ sys/sys/bio.h 4 Aug 2004 19:12:26 -0000 @@ -49,20 +49,22 @@ typedef void bio_task_t(void *); * The bio structure describes an I/O operation in the kernel. */ struct bio { - u_int bio_cmd; /* I/O operation. */ + uint8_t bio_cmd; /* I/O operation. */ + uint8_t bio_flags; /* General flags. */ + uint8_t bio_cflags; /* Private use by the consumer. */ + uint8_t bio_pflags; /* Private use by the provider. */ struct cdev *bio_dev; /* Device to do I/O on. */ struct disk *bio_disk; /* Valid below geom_disk.c only */ off_t bio_offset; /* Offset into file. */ long bio_bcount; /* Valid bytes in buffer. */ caddr_t bio_data; /* Memory, superblocks, indirect etc. */ - u_int bio_flags; /* BIO_ flags. */ int bio_error; /* Errno for BIO_ERROR. */ long bio_resid; /* Remaining I/0 in bytes. */ void (*bio_done)(struct bio *); - void *bio_driver1; /* Private use by the callee. */ - void *bio_driver2; /* Private use by the callee. */ - void *bio_caller1; /* Private use by the caller. */ - void *bio_caller2; /* Private use by the caller. */ + void *bio_driver1; /* Private use by the provider. */ + void *bio_driver2; /* Private use by the provider. */ + void *bio_caller1; /* Private use by the consumer. */ + void *bio_caller2; /* Private use by the consumer. */ TAILQ_ENTRY(bio) bio_queue; /* Disksort queue. */ const char *bio_attribute; /* Attribute for BIO_[GS]ETATTR */ struct g_consumer *bio_from; /* GEOM linkage */ @@ -82,18 +84,16 @@ struct bio { }; /* bio_cmd */ -#define BIO_READ 0x00000001 -#define BIO_WRITE 0x00000002 -#define BIO_DELETE 0x00000004 -#define BIO_GETATTR 0x00000008 -#define BIO_CMD1 0x40000000 /* Available for local hacks */ -#define BIO_CMD2 0x80000000 /* Available for local hacks */ +#define BIO_READ 0x01 +#define BIO_WRITE 0x02 +#define BIO_DELETE 0x04 +#define BIO_GETATTR 0x08 +#define BIO_CMD1 0x40 /* Available for local hacks */ +#define BIO_CMD2 0x80 /* Available for local hacks */ /* bio_flags */ -#define BIO_ERROR 0x00000001 -#define BIO_DONE 0x00000004 -#define BIO_FLAG2 0x40000000 /* Available for local hacks */ -#define BIO_FLAG1 0x80000000 /* Available for local hacks */ +#define BIO_ERROR 0x01 +#define BIO_DONE 0x02 #ifdef _KERNEL Index: share/man/man9/g_bio.9 =================================================================== RCS file: /private/FreeBSD/src/share/man/man9/g_bio.9,v retrieving revision 1.8 diff -u -p -r1.8 g_bio.9 --- share/man/man9/g_bio.9 6 Jul 2004 08:21:12 -0000 1.8 +++ share/man/man9/g_bio.9 4 Aug 2004 19:08:55 -0000 @@ -72,24 +72,24 @@ Attributes are named by ascii strings an .Va bio_attribute field. .El -.It Va bio_offset -Offset into provider. -.It Va bio_data -Pointer to data buffer. .It Va bio_flags Available flags: -.Bl -tag -width ".Dv BIO_GETATTR" +.Bl -tag -width ".Dv BIO_ERROR" .It Dv BIO_ERROR Request failed (error value is stored in .Va bio_error field). .It Dv BIO_DONE Request finished. -.It Dv BIO_FLAG1 -Available for private use. -.It Dv BIO_FLAG2 -Available for private use. .El +.It Va bio_cflags +Private use by the consumer. +.It Va bio_pflags +Private use by the provider. +.It Va bio_offset +Offset into provider. +.It Va bio_data +Pointer to data buffer. .It Va bio_error Error value when .Dv BIO_ERROR @@ -97,13 +97,13 @@ is set. .It Va bio_done Pointer to function which will be called when the request is finished. .It Va bio_driver1 -Private use by the callee (i.e., the provider). +Private use by the provider. .It Va bio_driver2 -Private use by the callee (i.e., the provider). +Private use by the provider. .It Va bio_caller1 -Private use by the caller (i.e., the consumer). +Private use by the consumer. .It Va bio_caller2 -Private use by the caller (i.e., the consumer). +Private use by the consumer. .It Va bio_attribute Attribute string for .Dv BIO_GETATTR Index: sys/geom/mirror/g_mirror.c =================================================================== RCS file: /private/FreeBSD/src/sys/geom/mirror/g_mirror.c,v retrieving revision 1.10 diff -u -p -r1.10 g_mirror.c --- sys/geom/mirror/g_mirror.c 4 Aug 2004 12:09:53 -0000 1.10 +++ sys/geom/mirror/g_mirror.c 4 Aug 2004 19:31:46 -0000 @@ -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 * 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); Index: sys/geom/mirror/g_mirror.h =================================================================== RCS file: /private/FreeBSD/src/sys/geom/mirror/g_mirror.h,v retrieving revision 1.3 diff -u -p -r1.3 g_mirror.h --- sys/geom/mirror/g_mirror.h 4 Aug 2004 12:09:53 -0000 1.3 +++ sys/geom/mirror/g_mirror.h 4 Aug 2004 19:32:23 -0000 @@ -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. */