aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-merge.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2008-04-29 08:48:33 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-04-29 08:48:33 -0400
commit75ad23bc0fcb4f992a5d06982bf0857ab1738e9e (patch)
tree8668ef63b1f420252ae41aed9e13737d49fd8054 /block/blk-merge.c
parent68154e90c9d1492d570671ae181d9a8f8530da55 (diff)
block: make queue flags non-atomic
We can save some atomic ops in the IO path, if we clearly define the rules of how to modify the queue flags. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk-merge.c')
-rw-r--r--block/blk-merge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/blk-merge.c b/block/blk-merge.c
index b5c5c4a9e3f0..73b23562af20 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -55,7 +55,7 @@ void blk_recalc_rq_segments(struct request *rq)
55 if (!rq->bio) 55 if (!rq->bio)
56 return; 56 return;
57 57
58 cluster = q->queue_flags & (1 << QUEUE_FLAG_CLUSTER); 58 cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
59 hw_seg_size = seg_size = 0; 59 hw_seg_size = seg_size = 0;
60 phys_size = hw_size = nr_phys_segs = nr_hw_segs = 0; 60 phys_size = hw_size = nr_phys_segs = nr_hw_segs = 0;
61 rq_for_each_segment(bv, rq, iter) { 61 rq_for_each_segment(bv, rq, iter) {
@@ -128,7 +128,7 @@ EXPORT_SYMBOL(blk_recount_segments);
128static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio, 128static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
129 struct bio *nxt) 129 struct bio *nxt)
130{ 130{
131 if (!(q->queue_flags & (1 << QUEUE_FLAG_CLUSTER))) 131 if (!test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags))
132 return 0; 132 return 0;
133 133
134 if (!BIOVEC_PHYS_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt))) 134 if (!BIOVEC_PHYS_MERGEABLE(__BVEC_END(bio), __BVEC_START(nxt)))
@@ -175,7 +175,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
175 int nsegs, cluster; 175 int nsegs, cluster;
176 176
177 nsegs = 0; 177 nsegs = 0;
178 cluster = q->queue_flags & (1 << QUEUE_FLAG_CLUSTER); 178 cluster = test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
179 179
180 /* 180 /*
181 * for each bio in rq 181 * for each bio in rq