diff options
author | NeilBrown <neilb@suse.de> | 2012-07-31 09:08:14 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-07-31 09:08:14 +0200 |
commit | 9cbb17508808f8a6bdd83354b61e126ac4fa6fed (patch) | |
tree | bc797d1b5cd829751a333115e6e6d52799fb6df2 /include/linux/blkdev.h | |
parent | 0021b7bc045e4b0b85d8c53614342aaf84ca96a5 (diff) | |
download | kernel_goldelico_gta04-9cbb17508808f8a6bdd83354b61e126ac4fa6fed.zip kernel_goldelico_gta04-9cbb17508808f8a6bdd83354b61e126ac4fa6fed.tar.gz kernel_goldelico_gta04-9cbb17508808f8a6bdd83354b61e126ac4fa6fed.tar.bz2 |
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/blkdev.h')
-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 3816ce8..607ca22 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -922,11 +922,15 @@ struct blk_plug { }; #define BLK_MAX_REQUEST_COUNT 16 +struct blk_plug_cb; +typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *); struct blk_plug_cb { struct list_head list; - void (*callback)(struct blk_plug_cb *); + blk_plug_cb_fn callback; + void *data; }; - +extern struct blk_plug_cb *blk_check_plugged(blk_plug_cb_fn unplug, + void *data, int size); extern void blk_start_plug(struct blk_plug *); extern void blk_finish_plug(struct blk_plug *); extern void blk_flush_plug_list(struct blk_plug *, bool); |