summaryrefslogtreecommitdiff
path: root/include/linux/blk_types.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-02-02 18:19:29 +0100
committerJens Axboe <axboe@kernel.dk>2021-02-08 08:33:16 -0700
commit7a800a20ae6329e803c5c646b20811a6ae9ca136 (patch)
tree9c72ec387e817945bde72c5b2e75e633688509c9 /include/linux/blk_types.h
parent72b043654ba8b8ce2e0cf3da49247b2db3acb2c1 (diff)
block: use bi_max_vecs to find the bvec pool
Instead of encoding of the bvec pool using magic bio flags, just use a helper to find the pool based on the max_vecs value. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blk_types.h')
-rw-r--r--include/linux/blk_types.h29
1 files changed, 1 insertions, 28 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 1bc6f6a01070..db026b6ec15a 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -227,7 +227,7 @@ struct bio {
* top bits REQ_OP. Use
* accessors.
*/
- unsigned short bi_flags; /* status, etc and bvec pool number */
+ unsigned short bi_flags; /* BIO_* below */
unsigned short bi_ioprio;
unsigned short bi_write_hint;
blk_status_t bi_status;
@@ -307,33 +307,6 @@ enum {
BIO_FLAG_LAST
};
-/* See BVEC_POOL_OFFSET below before adding new flags */
-
-/*
- * We support 6 different bvec pools, the last one is magic in that it
- * is backed by a mempool.
- */
-#define BVEC_POOL_NR 6
-#define BVEC_POOL_MAX (BVEC_POOL_NR - 1)
-
-/*
- * Top 3 bits of bio flags indicate the pool the bvecs came from. We add
- * 1 to the actual index so that 0 indicates that there are no bvecs to be
- * freed.
- */
-#define BVEC_POOL_BITS (3)
-#define BVEC_POOL_OFFSET (16 - BVEC_POOL_BITS)
-#define BVEC_POOL_IDX(bio) ((bio)->bi_flags >> BVEC_POOL_OFFSET)
-#if (1<< BVEC_POOL_BITS) < (BVEC_POOL_NR+1)
-# error "BVEC_POOL_BITS is too small"
-#endif
-
-/*
- * Flags starting here get preserved by bio_reset() - this includes
- * only BVEC_POOL_IDX()
- */
-#define BIO_RESET_BITS BVEC_POOL_OFFSET
-
typedef __u32 __bitwise blk_mq_req_flags_t;
/*