mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-20 11:11:24 +00:00
Just use MAXPHYS as maximum I/O request size, instead of using my own
#define for this purpose. No functional change.
This commit is contained in:
parent
932fc0bcb3
commit
604fce4f60
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135872
@ -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++;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user