Give a couple of predication functions a bool return type.

No functional change intended.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Mark Johnston 2017-12-15 19:14:21 +00:00
parent 204d94f161
commit 68eadcec0f

View file

@ -1204,7 +1204,7 @@ g_mirror_start(struct bio *bp)
* Return TRUE if the given request is colliding with a in-progress * Return TRUE if the given request is colliding with a in-progress
* synchronization request. * synchronization request.
*/ */
static int static bool
g_mirror_sync_collision(struct g_mirror_softc *sc, struct bio *bp) g_mirror_sync_collision(struct g_mirror_softc *sc, struct bio *bp)
{ {
struct g_mirror_disk *disk; struct g_mirror_disk *disk;
@ -1213,7 +1213,7 @@ g_mirror_sync_collision(struct g_mirror_softc *sc, struct bio *bp)
u_int i; u_int i;
if (sc->sc_sync.ds_ndisks == 0) if (sc->sc_sync.ds_ndisks == 0)
return (0); return (false);
rstart = bp->bio_offset; rstart = bp->bio_offset;
rend = bp->bio_offset + bp->bio_length; rend = bp->bio_offset + bp->bio_length;
LIST_FOREACH(disk, &sc->sc_disks, d_next) { LIST_FOREACH(disk, &sc->sc_disks, d_next) {
@ -1226,33 +1226,33 @@ g_mirror_sync_collision(struct g_mirror_softc *sc, struct bio *bp)
sstart = sbp->bio_offset; sstart = sbp->bio_offset;
send = sbp->bio_offset + sbp->bio_length; send = sbp->bio_offset + sbp->bio_length;
if (rend > sstart && rstart < send) if (rend > sstart && rstart < send)
return (1); return (true);
} }
} }
return (0); return (false);
} }
/* /*
* Return TRUE if the given sync request is colliding with a in-progress regular * Return TRUE if the given sync request is colliding with a in-progress regular
* request. * request.
*/ */
static int static bool
g_mirror_regular_collision(struct g_mirror_softc *sc, struct bio *sbp) g_mirror_regular_collision(struct g_mirror_softc *sc, struct bio *sbp)
{ {
off_t rstart, rend, sstart, send; off_t rstart, rend, sstart, send;
struct bio *bp; struct bio *bp;
if (sc->sc_sync.ds_ndisks == 0) if (sc->sc_sync.ds_ndisks == 0)
return (0); return (false);
sstart = sbp->bio_offset; sstart = sbp->bio_offset;
send = sbp->bio_offset + sbp->bio_length; send = sbp->bio_offset + sbp->bio_length;
TAILQ_FOREACH(bp, &sc->sc_inflight.queue, bio_queue) { TAILQ_FOREACH(bp, &sc->sc_inflight.queue, bio_queue) {
rstart = bp->bio_offset; rstart = bp->bio_offset;
rend = bp->bio_offset + bp->bio_length; rend = bp->bio_offset + bp->bio_length;
if (rend > sstart && rstart < send) if (rend > sstart && rstart < send)
return (1); return (true);
} }
return (0); return (false);
} }
/* /*