Jens Axboe | 320ae51 | 2013-10-24 09:20:05 +0100 | [diff] [blame] | 1 | #ifndef INT_BLK_MQ_TAG_H |
| 2 | #define INT_BLK_MQ_TAG_H |
| 3 | |
| 4 | struct blk_mq_tags; |
| 5 | |
| 6 | extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int reserved_tags, int node); |
| 7 | extern void blk_mq_free_tags(struct blk_mq_tags *tags); |
| 8 | |
| 9 | extern unsigned int blk_mq_get_tag(struct blk_mq_tags *tags, gfp_t gfp, bool reserved); |
| 10 | extern void blk_mq_wait_for_tags(struct blk_mq_tags *tags); |
| 11 | extern void blk_mq_put_tag(struct blk_mq_tags *tags, unsigned int tag); |
| 12 | extern void blk_mq_tag_busy_iter(struct blk_mq_tags *tags, void (*fn)(void *data, unsigned long *), void *data); |
| 13 | extern bool blk_mq_has_free_tags(struct blk_mq_tags *tags); |
| 14 | extern ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page); |
| 15 | |
| 16 | enum { |
| 17 | BLK_MQ_TAG_CACHE_MIN = 1, |
| 18 | BLK_MQ_TAG_CACHE_MAX = 64, |
| 19 | }; |
| 20 | |
| 21 | enum { |
| 22 | BLK_MQ_TAG_FAIL = -1U, |
| 23 | BLK_MQ_TAG_MIN = BLK_MQ_TAG_CACHE_MIN, |
| 24 | BLK_MQ_TAG_MAX = BLK_MQ_TAG_FAIL - 1, |
| 25 | }; |
| 26 | |
| 27 | #endif |