aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-04-19 07:32:41 -0400
committerJames Morris <jmorris@namei.org>2011-04-19 07:32:41 -0400
commitd4ab4e6a23f805abb8fc3cc34525eec3788aeca1 (patch)
treeeefd82c155bc27469a85667d759cd90facf4a6e3 /include/linux/blkdev.h
parentc0fa797ae6cd02ff87c0bfe0d509368a3b45640e (diff)
parent96fd2d57b8252e16dfacf8941f7a74a6119197f5 (diff)
Merge branch 'master'; commit 'v2.6.39-rc3' into next
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 16a902f099ac..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/*
@@ -1206,6 +1219,7 @@ struct blk_integrity {
1206 struct kobject kobj; 1219 struct kobject kobj;
1207}; 1220};
1208 1221
1222extern bool blk_integrity_is_initialized(struct gendisk *);
1209extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); 1223extern int blk_integrity_register(struct gendisk *, struct blk_integrity *);
1210extern void blk_integrity_unregister(struct gendisk *); 1224extern void blk_integrity_unregister(struct gendisk *);
1211extern int blk_integrity_compare(struct gendisk *, struct gendisk *); 1225extern int blk_integrity_compare(struct gendisk *, struct gendisk *);
@@ -1262,6 +1276,7 @@ queue_max_integrity_segments(struct request_queue *q)
1262#define queue_max_integrity_segments(a) (0) 1276#define queue_max_integrity_segments(a) (0)
1263#define blk_integrity_merge_rq(a, b, c) (0) 1277#define blk_integrity_merge_rq(a, b, c) (0)
1264#define blk_integrity_merge_bio(a, b, c) (0) 1278#define blk_integrity_merge_bio(a, b, c) (0)
1279#define blk_integrity_is_initialized(a) (0)
1265 1280
1266#endif /* CONFIG_BLK_DEV_INTEGRITY */ 1281#endif /* CONFIG_BLK_DEV_INTEGRITY */
1267 1282
@@ -1312,6 +1327,11 @@ static inline void blk_flush_plug(struct task_struct *task)
1312{ 1327{
1313} 1328}
1314 1329
1330static inline void blk_schedule_flush_plug(struct task_struct *task)
1331{
1332}
1333
1334
1315static inline bool blk_needs_flush_plug(struct task_struct *tsk) 1335static inline bool blk_needs_flush_plug(struct task_struct *tsk)
1316{ 1336{
1317 return false; 1337 return false;