diff options
author | pjd <pjd@FreeBSD.org> | 2004-09-28 07:33:37 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-09-28 07:33:37 +0000 |
commit | 63dd0f756be07fcbaa764dfb7930f49f32d41de7 (patch) | |
tree | 44982f9aecc1ddf9c2fd83f432924589e487affc /sys/geom/mirror/g_mirror.c | |
parent | 9f0701f21f891873b4762df032c61da73a76dd24 (diff) | |
download | FreeBSD-src-63dd0f756be07fcbaa764dfb7930f49f32d41de7.zip FreeBSD-src-63dd0f756be07fcbaa764dfb7930f49f32d41de7.tar.gz |
Just use MAXPHYS as maximum I/O request size, instead of using my own
#define for this purpose.
No functional change.
Diffstat (limited to 'sys/geom/mirror/g_mirror.c')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 61cec14..dd8c584 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++; } |