diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 61cec14ac689..dd8c58419b0c 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -896,8 +896,7 @@ g_mirror_sync_one(struct g_mirror_disk *disk) bp->bio_parent = NULL; bp->bio_cmd = BIO_READ; bp->bio_offset = disk->d_sync.ds_offset; - bp->bio_length = MIN(G_MIRROR_SYNC_BLOCK_SIZE, - sc->sc_mediasize - bp->bio_offset); + bp->bio_length = MIN(MAXPHYS, sc->sc_mediasize - bp->bio_offset); bp->bio_cflags = 0; bp->bio_done = g_mirror_sync_done; bp->bio_data = disk->d_sync.ds_data; @@ -980,8 +979,7 @@ g_mirror_sync_request(struct bio *bp) g_mirror_event_send(disk, G_MIRROR_DISK_STATE_ACTIVE, G_MIRROR_EVENT_DONTWAIT); return; - } else if (sync->ds_offset_done % - (G_MIRROR_SYNC_BLOCK_SIZE * 100) == 0) { + } else if (sync->ds_offset_done % (MAXPHYS * 100) == 0) { /* * Update offset_done on every 100 blocks. * XXX: This should be configurable. @@ -1236,8 +1234,7 @@ g_mirror_register_request(struct bio *bp) (bp->bio_offset < sync->ds_resync || sync->ds_resync == -1)) { sync->ds_resync = bp->bio_offset - - (bp->bio_offset % - G_MIRROR_SYNC_BLOCK_SIZE); + (bp->bio_offset % MAXPHYS); } break; default: @@ -1574,8 +1571,7 @@ g_mirror_sync_start(struct g_mirror_disk *disk) error = g_access(disk->d_sync.ds_consumer, 1, 0, 0); KASSERT(error == 0, ("Cannot open %s (error=%d).", disk->d_softc->sc_name, error)); - disk->d_sync.ds_data = malloc(G_MIRROR_SYNC_BLOCK_SIZE, M_MIRROR, - M_WAITOK); + disk->d_sync.ds_data = malloc(MAXPHYS, M_MIRROR, M_WAITOK); sc->sc_sync.ds_ndisks++; } diff --git a/sys/geom/mirror/g_mirror.h b/sys/geom/mirror/g_mirror.h index 060de9136af9..59490054a80f 100644 --- a/sys/geom/mirror/g_mirror.h +++ b/sys/geom/mirror/g_mirror.h @@ -84,8 +84,6 @@ extern u_int g_mirror_debug; } \ } while (0) -#define G_MIRROR_SYNC_BLOCK_SIZE 131072 - #define G_MIRROR_BIO_FLAG_REGULAR 0x01 #define G_MIRROR_BIO_FLAG_SYNC 0x02 diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c index 53f98582116e..36c0dd5533de 100644 --- a/sys/geom/raid3/g_raid3.c +++ b/sys/geom/raid3/g_raid3.c @@ -1229,8 +1229,7 @@ g_raid3_sync_one(struct g_raid3_softc *sc) bp->bio_parent = NULL; bp->bio_cmd = BIO_READ; bp->bio_offset = disk->d_sync.ds_offset * (sc->sc_ndisks - 1); - bp->bio_length = MIN(G_RAID3_MAX_IO_SIZE, - sc->sc_mediasize - bp->bio_offset); + bp->bio_length = MIN(MAXPHYS, sc->sc_mediasize - bp->bio_offset); bp->bio_cflags = 0; bp->bio_done = g_raid3_sync_done; bp->bio_data = disk->d_sync.ds_data; @@ -1347,8 +1346,7 @@ g_raid3_sync_request(struct bio *bp) g_raid3_event_send(disk, G_RAID3_DISK_STATE_ACTIVE, G_RAID3_EVENT_DONTWAIT); return; - } else if (sync->ds_offset_done % - (G_RAID3_MAX_IO_SIZE * 100) == 0) { + } else if (sync->ds_offset_done % (MAXPHYS * 100) == 0) { /* * Update offset_done on every 100 blocks. * XXX: This should be configurable. @@ -1425,7 +1423,7 @@ g_raid3_register_request(struct bio *pbp) break; if (offset >= sync->ds_resync && sync->ds_resync != -1) break; - sync->ds_resync = offset - (offset % G_RAID3_MAX_IO_SIZE); + sync->ds_resync = offset - (offset % MAXPHYS); break; } } @@ -1830,7 +1828,7 @@ g_raid3_sync_start(struct g_raid3_softc *sc) error = g_access(disk->d_sync.ds_consumer, 1, 0, 0); KASSERT(error == 0, ("Cannot open %s (error=%d).", disk->d_softc->sc_name, error)); - disk->d_sync.ds_data = malloc(G_RAID3_MAX_IO_SIZE, M_RAID3, M_WAITOK); + disk->d_sync.ds_data = malloc(MAXPHYS, M_RAID3, M_WAITOK); sc->sc_syncdisk = disk; } diff --git a/sys/geom/raid3/g_raid3.h b/sys/geom/raid3/g_raid3.h index f28acb882d52..948d599930a1 100644 --- a/sys/geom/raid3/g_raid3.h +++ b/sys/geom/raid3/g_raid3.h @@ -84,8 +84,6 @@ extern u_int g_raid3_debug; } \ } while (0) -#define G_RAID3_MAX_IO_SIZE (DFLTPHYS * 2) - #define G_RAID3_BIO_CFLAG_REGULAR 0x01 #define G_RAID3_BIO_CFLAG_SYNC 0x02 #define G_RAID3_BIO_CFLAG_PARITY 0x04