summaryrefslogtreecommitdiffstats
path: root/sys/geom
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2016-03-10 06:25:39 +0000
committerimp <imp@FreeBSD.org>2016-03-10 06:25:39 +0000
commit79cf687df773e4637e3a4dbf7264956d5f2f1d62 (patch)
treedf87aac276f7db73a01242944d24ec0f70f1b416 /sys/geom
parentcfe83b08022f108bd2b9ae151aee3f21c37c1d09 (diff)
downloadFreeBSD-src-79cf687df773e4637e3a4dbf7264956d5f2f1d62.zip
FreeBSD-src-79cf687df773e4637e3a4dbf7264956d5f2f1d62.tar.gz
Don't assume that bio_cmd is a bit mask.
Differential Revision: https://reviews.freebsd.org/D5592
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/sched/g_sched.c10
-rw-r--r--sys/geom/sched/gs_rr.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/geom/sched/g_sched.c b/sys/geom/sched/g_sched.c
index f1c9a3d..ea1fd41 100644
--- a/sys/geom/sched/g_sched.c
+++ b/sys/geom/sched/g_sched.c
@@ -269,7 +269,7 @@ g_sched_update_stats(struct bio *bio)
me.gs_done++;
me.gs_in_flight--;
me.gs_bytes_in_flight -= bio->bio_length;
- if (bio->bio_cmd & BIO_WRITE) {
+ if (bio->bio_cmd == BIO_WRITE) {
me.gs_writes_in_flight--;
me.gs_write_bytes_in_flight -= bio->bio_length;
}
@@ -754,9 +754,9 @@ static inline char
g_sched_type(struct bio *bp)
{
- if (0 != (bp->bio_cmd & BIO_READ))
+ if (bp->bio_cmd == BIO_READ)
return ('R');
- else if (0 != (bp->bio_cmd & BIO_WRITE))
+ else if (bp->bio_cmd == BIO_WRITE)
return ('W');
return ('U');
}
@@ -829,7 +829,7 @@ g_sched_start(struct bio *bp)
KASSERT(cbp->bio_to != NULL, ("NULL provider"));
/* We only schedule reads and writes. */
- if (0 == (bp->bio_cmd & (BIO_READ | BIO_WRITE)))
+ if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE)
goto bypass;
G_SCHED_LOGREQ(cbp, "Sending request.");
@@ -860,7 +860,7 @@ g_sched_start(struct bio *bp)
me.gs_in_flight++;
me.gs_requests++;
me.gs_bytes_in_flight += bp->bio_length;
- if (bp->bio_cmd & BIO_WRITE) {
+ if (bp->bio_cmd == BIO_WRITE) {
me.gs_writes_in_flight++;
me.gs_write_bytes_in_flight += bp->bio_length;
}
diff --git a/sys/geom/sched/gs_rr.c b/sys/geom/sched/gs_rr.c
index 7742ef6..2473c42 100644
--- a/sys/geom/sched/gs_rr.c
+++ b/sys/geom/sched/gs_rr.c
@@ -375,7 +375,7 @@ g_rr_should_anticipate(struct g_rr_queue *qp, struct bio *bp)
{
int wait = get_bounded(&me.wait_ms, 2);
- if (!me.w_anticipate && (bp->bio_cmd & BIO_WRITE))
+ if (!me.w_anticipate && (bp->bio_cmd == BIO_WRITE))
return (0);
if (g_savg_valid(&qp->q_thinktime) &&
OpenPOWER on IntegriCloud