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>
This commit is contained in:
NeilBrown
2012-07-31 09:08:14 +02:00
committed by Jens Axboe
parent 0021b7bc04
commit 9cbb175088
5 changed files with 49 additions and 83 deletions
+6 -2
View File
@@ -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);