block: bio: ensure newly added bio flags don't override BVEC_POOL_IDX
authorJohannes Thumshirn <jthumshirn@suse.de>
Wed, 3 Apr 2019 09:15:19 +0000 (11:15 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 4 Apr 2019 15:30:37 +0000 (09:30 -0600)
commit2b24e6f63ac9e817630424c6d8f008256348dfc4
tree04e523e6f47a8d5b251f86ad827e2ab3ee8c7640
parent2bc13b83e6298486371761de503faeffd15b7534
block: bio: ensure newly added bio flags don't override BVEC_POOL_IDX

With the introduction of BIO_NO_PAGE_REF we've used up all available bits
in bio::bi_flags.

Convert the defines of the flags to an enum and add a BUILD_BUG_ON() call
to make sure no-one adds a new one and thus overrides the BVEC_POOL_IDX
causing crashes.

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/blk_types.h