Message ID | 20220217195533.4251-4-mwilck@suse.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Mike Snitzer |
Headers | show |
Series | libmultipath: utter less dev_loss_tmo warnings | expand |
diff --git a/libmultipath/util.h b/libmultipath/util.h index 79d9f32..5a44018 100644 --- a/libmultipath/util.h +++ b/libmultipath/util.h @@ -82,6 +82,16 @@ struct bitfield { bitfield_t bits[]; }; +#define STATIC_BITFIELD(name, length) \ + static struct { \ + unsigned int len; \ + bitfield_t bits[((length) - 1) / bits_per_slot + 1]; \ + } __static__ ## name = { \ + .len = (length), \ + .bits = { 0, }, \ + }; \ + struct bitfield *name = (struct bitfield *)& __static__ ## name + struct bitfield *alloc_bitfield(unsigned int maxbit); void _log_bitfield_overflow(const char *f, unsigned int bit, unsigned int len);