aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-04-21 05:39:21 -0400
committerIngo Molnar <mingo@elte.hu>2011-04-21 05:39:28 -0400
commit42ac9e87fdd89b77fa2ca0a5226023c1c2d83226 (patch)
treedfdb1b720347a40f24a89a3e9c2727ae26ad5f01 /include/linux/blkdev.h
parent057f3fadb347e9c51b07e1b277bbdda79f976768 (diff)
parentf0e615c3cb72b42191b558c130409335812621d8 (diff)
Merge commit 'v2.6.39-rc4' into sched/core
Merge reason: Pick up upstream fixes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 32176cc8e715..cbbfd98ad4a3 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -697,7 +697,7 @@ extern void blk_start_queue(struct request_queue *q);
697extern void blk_stop_queue(struct request_queue *q); 697extern void blk_stop_queue(struct request_queue *q);
698extern void blk_sync_queue(struct request_queue *q); 698extern void blk_sync_queue(struct request_queue *q);
699extern void __blk_stop_queue(struct request_queue *q); 699extern void __blk_stop_queue(struct request_queue *q);
700extern void __blk_run_queue(struct request_queue *q, bool force_kblockd); 700extern void __blk_run_queue(struct request_queue *q);
701extern void blk_run_queue(struct request_queue *); 701extern void blk_run_queue(struct request_queue *);
702extern int blk_rq_map_user(struct request_queue *, struct request *, 702extern int blk_rq_map_user(struct request_queue *, struct request *,
703 struct rq_map_data *, void __user *, unsigned long, 703 struct rq_map_data *, void __user *, unsigned long,
@@ -857,26 +857,39 @@ extern void blk_put_queue(struct request_queue *);
857struct blk_plug { 857struct blk_plug {
858 unsigned long magic; 858 unsigned long magic;
859 struct list_head list; 859 struct list_head list;
860 struct list_head cb_list;
860 unsigned int should_sort; 861 unsigned int should_sort;
861}; 862};
863struct blk_plug_cb {
864 struct list_head list;
865 void (*callback)(struct blk_plug_cb *);
866};
862 867
863extern void blk_start_plug(struct blk_plug *); 868extern void blk_start_plug(struct blk_plug *);
864extern void blk_finish_plug(struct blk_plug *); 869extern void blk_finish_plug(struct blk_plug *);
865extern void __blk_flush_plug(struct task_struct *, struct blk_plug *); 870extern void blk_flush_plug_list(struct blk_plug *, bool);
866 871
867static inline void blk_flush_plug(struct task_struct *tsk) 872static inline void blk_flush_plug(struct task_struct *tsk)
868{ 873{
869 struct blk_plug *plug = tsk->plug; 874 struct blk_plug *plug = tsk->plug;
870 875
871 if (unlikely(plug)) 876 if (plug)
872 __blk_flush_plug(tsk, plug); 877 blk_flush_plug_list(plug, false);
878}
879
880static inline void blk_schedule_flush_plug(struct task_struct *tsk)
881{
882 struct blk_plug *plug = tsk->plug;
883
884 if (plug)
885 blk_flush_plug_list(plug, true);
873} 886}
874 887
875static inline bool blk_needs_flush_plug(struct task_struct *tsk) 888static inline bool blk_needs_flush_plug(struct task_struct *tsk)
876{ 889{
877 struct blk_plug *plug = tsk->plug; 890 struct blk_plug *plug = tsk->plug;
878 891
879 return plug && !list_empty(&plug->list); 892 return plug && (!list_empty(&plug->list) || !list_empty(&plug->cb_list));
880} 893}
881 894
882/* 895/*
@@ -1314,6 +1327,11 @@ static inline void blk_flush_plug(struct task_struct *task)
1314{ 1327{
1315} 1328}
1316 1329
1330static inline void blk_schedule_flush_plug(struct task_struct *task)
1331{
1332}
1333
1334
1317static inline bool blk_needs_flush_plug(struct task_struct *tsk) 1335static inline bool blk_needs_flush_plug(struct task_struct *tsk)
1318{ 1336{
1319 return false; 1337 return false;