diff options
| author | NeilBrown <neilb@suse.de> | 2012-07-31 03:08:14 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2012-07-31 03:08:14 -0400 |
| commit | 9cbb17508808f8a6bdd83354b61e126ac4fa6fed (patch) | |
| tree | bc797d1b5cd829751a333115e6e6d52799fb6df2 /include/linux | |
| parent | 0021b7bc045e4b0b85d8c53614342aaf84ca96a5 (diff) | |
blk: centralize non-request unplug handling.
Both md and umem has similar code for getting notified on an
blk_finish_plug event.
Centralize this code in block/ and allow each driver to
provide its distinctive difference.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/blkdev.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 3816ce8a08fc..607ca228f47e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -922,11 +922,15 @@ struct blk_plug { | |||
| 922 | }; | 922 | }; |
| 923 | #define BLK_MAX_REQUEST_COUNT 16 | 923 | #define BLK_MAX_REQUEST_COUNT 16 |
| 924 | 924 | ||
| 925 | struct blk_plug_cb; | ||
| 926 | typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *); | ||
| 925 | struct blk_plug_cb { | 927 | struct blk_plug_cb { |
| 926 | struct list_head list; | 928 | struct list_head list; |
| 927 | void (*callback)(struct blk_plug_cb *); | 929 | blk_plug_cb_fn callback; |
| 930 | void *data; | ||
| 928 | }; | 931 | }; |
| 929 | 932 | extern struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug, | |
| 933 | void *data, int size); | ||
| 930 | extern void blk_start_plug(struct blk_plug *); | 934 | extern void blk_start_plug(struct blk_plug *); |
| 931 | extern void blk_finish_plug(struct blk_plug *); | 935 | extern void blk_finish_plug(struct blk_plug *); |
| 932 | extern void blk_flush_plug_list(struct blk_plug *, bool); | 936 | extern void blk_flush_plug_list(struct blk_plug *, bool); |
