diff options
author | pjd <pjd@FreeBSD.org> | 2006-02-12 17:36:09 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-02-12 17:36:09 +0000 |
commit | a9a29a482122cf63a18b559a9601ce344daa68b8 (patch) | |
tree | 448924dc998a09ce2a3072b6230c1a85392acca3 /sys/geom/mirror | |
parent | d47092b07f2dfe2f33117df393815a6d6dc4e0c9 (diff) | |
download | FreeBSD-src-a9a29a482122cf63a18b559a9601ce344daa68b8.zip FreeBSD-src-a9a29a482122cf63a18b559a9601ce344daa68b8.tar.gz |
Use time_uptime instead of time_second, as the latter may go backwards.
Suggested by: ru
MFC after: 3 days
Diffstat (limited to 'sys/geom/mirror')
-rw-r--r-- | sys/geom/mirror/g_mirror.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c index 4edd9af..80c6309 100644 --- a/sys/geom/mirror/g_mirror.c +++ b/sys/geom/mirror/g_mirror.c @@ -787,7 +787,7 @@ g_mirror_idle(struct g_mirror_softc *sc, int from_access) if (sc->sc_writes > 0) return (0); if (!from_access && sc->sc_provider->acw > 0) { - timeout = g_mirror_idletime - (time_second - sc->sc_last_write); + timeout = g_mirror_idletime - (time_uptime - sc->sc_last_write); if (timeout > 0) return (timeout); } @@ -813,7 +813,7 @@ g_mirror_unidle(struct g_mirror_softc *sc) struct g_mirror_disk *disk; sc->sc_idle = 0; - sc->sc_last_write = time_second; + sc->sc_last_write = time_uptime; g_topology_lock(); LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE) @@ -1368,7 +1368,7 @@ g_mirror_register_request(struct bio *bp) if (sc->sc_idle) g_mirror_unidle(sc); else - sc->sc_last_write = time_second; + sc->sc_last_write = time_uptime; /* * Allocate all bios before sending any request, so we can @@ -2534,7 +2534,7 @@ g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md) sc->sc_flags = md->md_mflags; sc->sc_bump_id = 0; sc->sc_idle = 1; - sc->sc_last_write = time_second; + sc->sc_last_write = time_uptime; sc->sc_writes = 0; bioq_init(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); |