summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/blk-core.c7
-rw-r--r--block/blk-merge.c2
-rw-r--r--block/blk.h7
3 files changed, 10 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index c130206e9961..b2fb7e61633c 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -833,11 +833,8 @@ static noinline_for_stack bool submit_bio_checks(struct bio *bio)
}
}
- if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags)) {
- /* can't support alloc cache if we turn off polling */
- bio_clear_flag(bio, BIO_PERCPU_CACHE);
- bio->bi_opf &= ~REQ_HIPRI;
- }
+ if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+ bio_clear_hipri(bio);
switch (bio_op(bio)) {
case REQ_OP_DISCARD:
diff --git a/block/blk-merge.c b/block/blk-merge.c
index a11b3b53717e..bc25ad409fc1 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -285,7 +285,7 @@ split:
* iopoll in direct IO routine. Given performance gain of iopoll for
* big IO can be trival, disable iopoll when split needed.
*/
- bio->bi_opf &= ~REQ_HIPRI;
+ bio_clear_hipri(bio);
return bio_split(bio, sectors, GFP_NOIO, bs);
}
diff --git a/block/blk.h b/block/blk.h
index 4b885c0f6708..655561df93b0 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -368,4 +368,11 @@ extern struct device_attribute dev_attr_events;
extern struct device_attribute dev_attr_events_async;
extern struct device_attribute dev_attr_events_poll_msecs;
+static inline void bio_clear_hipri(struct bio *bio)
+{
+ /* can't support alloc cache if we turn off polling */
+ bio_clear_flag(bio, BIO_PERCPU_CACHE);
+ bio->bi_opf &= ~REQ_HIPRI;
+}
+
#endif /* BLK_INTERNAL_H */