diff options
author | NeilBrown <neilb@suse.de> | 2011-04-18 09:52:22 +0200 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-04-18 09:52:22 +0200 |
commit | 048c9374a749a27f16493cea033fa4a8ff492356 (patch) | |
tree | 64f520a1a2d2e1a9c30b45e306ce6f901f8f8d49 /include/linux/blkdev.h | |
parent | a1b49cb7e2a7961ec3aa8b64860bf480d4ec9077 (diff) |
block: Enhance new plugging support to support general callbacks
md/raid requires an unplug callback, but as it does not uses
requests the current code cannot provide one.
So allow arbitrary callbacks to be attached to the blk_plug.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ec0357d8c4a..f3f7879391a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -860,8 +860,13 @@ extern void blk_put_queue(struct request_queue *); struct blk_plug { unsigned long magic; struct list_head list; + struct list_head cb_list; unsigned int should_sort; }; +struct blk_plug_cb { + struct list_head list; + void (*callback)(struct blk_plug_cb *); +}; extern void blk_start_plug(struct blk_plug *); extern void blk_finish_plug(struct blk_plug *); @@ -887,7 +892,7 @@ static inline bool blk_needs_flush_plug(struct task_struct *tsk) { struct blk_plug *plug = tsk->plug; - return plug && !list_empty(&plug->list); + return plug && (!list_empty(&plug->list) || !list_empty(&plug->cb_list)); } /* |