summaryrefslogtreecommitdiff
path: root/block/blk.h
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2022-03-24 16:35:24 -0400
committerJens Axboe <axboe@kernel.dk>2022-04-17 16:49:40 -0600
commit0df71650c051ab106c921de257f4b38e9e3dd251 (patch)
tree39bed0b9aae98b2357378bbfb077a192d2f4dcbd /block/blk.h
parentb2d229d4ddb17db541098b83524d901257e93845 (diff)
block: allow using the per-cpu bio cache from bio_alloc_bioset
Replace the BIO_PERCPU_CACHE bio-internal flag with a REQ_ALLOC_CACHE one that can be passed to bio_alloc / bio_alloc_bioset, and implement the percpu cache allocation logic in a helper called from bio_alloc_bioset. This allows any bio_alloc_bioset user to use the percpu caches instead of having the functionality tied to struct kiocb. Signed-off-by: Mike Snitzer <snitzer@kernel.org> [hch: refactored a bit] Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220324203526.62306-2-snitzer@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/blk.h b/block/blk.h
index 8ccbc6e07636..0d33e4ca2c52 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -453,8 +453,7 @@ extern struct device_attribute dev_attr_events_poll_msecs;
static inline void bio_clear_polled(struct bio *bio)
{
/* can't support alloc cache if we turn off polling */
- bio_clear_flag(bio, BIO_PERCPU_CACHE);
- bio->bi_opf &= ~REQ_POLLED;
+ bio->bi_opf &= ~(REQ_POLLED | REQ_ALLOC_CACHE);
}
long blkdev_ioctl(struct file *file, unsigned cmd, unsigned long arg);