diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/backing-dev.h | 16 | ||||
| -rw-r--r-- | include/linux/bio.h | 1 | ||||
| -rw-r--r-- | include/linux/blk_types.h | 6 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 101 | ||||
| -rw-r--r-- | include/linux/buffer_head.h | 1 | ||||
| -rw-r--r-- | include/linux/device-mapper.h | 5 | ||||
| -rw-r--r-- | include/linux/elevator.h | 10 | ||||
| -rw-r--r-- | include/linux/fs.h | 29 | ||||
| -rw-r--r-- | include/linux/genhd.h | 12 | ||||
| -rw-r--r-- | include/linux/pagemap.h | 12 | ||||
| -rw-r--r-- | include/linux/sched.h | 6 | ||||
| -rw-r--r-- | include/linux/swap.h | 2 |
12 files changed, 100 insertions, 101 deletions
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 4ce34fa937d4..96f4094b706d 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -66,8 +66,6 @@ struct backing_dev_info { | |||
| 66 | unsigned int capabilities; /* Device capabilities */ | 66 | unsigned int capabilities; /* Device capabilities */ |
| 67 | congested_fn *congested_fn; /* Function pointer if device is md/dm */ | 67 | congested_fn *congested_fn; /* Function pointer if device is md/dm */ |
| 68 | void *congested_data; /* Pointer to aux data for congested func */ | 68 | void *congested_data; /* Pointer to aux data for congested func */ |
| 69 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); | ||
| 70 | void *unplug_io_data; | ||
| 71 | 69 | ||
| 72 | char *name; | 70 | char *name; |
| 73 | 71 | ||
| @@ -251,7 +249,6 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio); | |||
| 251 | 249 | ||
| 252 | extern struct backing_dev_info default_backing_dev_info; | 250 | extern struct backing_dev_info default_backing_dev_info; |
| 253 | extern struct backing_dev_info noop_backing_dev_info; | 251 | extern struct backing_dev_info noop_backing_dev_info; |
| 254 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); | ||
| 255 | 252 | ||
| 256 | int writeback_in_progress(struct backing_dev_info *bdi); | 253 | int writeback_in_progress(struct backing_dev_info *bdi); |
| 257 | 254 | ||
| @@ -336,17 +333,4 @@ static inline int bdi_sched_wait(void *word) | |||
| 336 | return 0; | 333 | return 0; |
| 337 | } | 334 | } |
| 338 | 335 | ||
| 339 | static inline void blk_run_backing_dev(struct backing_dev_info *bdi, | ||
| 340 | struct page *page) | ||
| 341 | { | ||
| 342 | if (bdi && bdi->unplug_io_fn) | ||
| 343 | bdi->unplug_io_fn(bdi, page); | ||
| 344 | } | ||
| 345 | |||
| 346 | static inline void blk_run_address_space(struct address_space *mapping) | ||
| 347 | { | ||
| 348 | if (mapping) | ||
| 349 | blk_run_backing_dev(mapping->backing_dev_info, NULL); | ||
| 350 | } | ||
| 351 | |||
| 352 | #endif /* _LINUX_BACKING_DEV_H */ | 336 | #endif /* _LINUX_BACKING_DEV_H */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 35dcdb3589bc..ce33e6868a2f 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -304,7 +304,6 @@ struct biovec_slab { | |||
| 304 | }; | 304 | }; |
| 305 | 305 | ||
| 306 | extern struct bio_set *fs_bio_set; | 306 | extern struct bio_set *fs_bio_set; |
| 307 | extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly; | ||
| 308 | 307 | ||
| 309 | /* | 308 | /* |
| 310 | * a small number of entries is fine, not going to be performance critical. | 309 | * a small number of entries is fine, not going to be performance critical. |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 46ad5197537a..be50d9e70a7d 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
| @@ -128,7 +128,6 @@ enum rq_flag_bits { | |||
| 128 | __REQ_NOIDLE, /* don't anticipate more IO after this one */ | 128 | __REQ_NOIDLE, /* don't anticipate more IO after this one */ |
| 129 | 129 | ||
| 130 | /* bio only flags */ | 130 | /* bio only flags */ |
| 131 | __REQ_UNPLUG, /* unplug the immediately after submission */ | ||
| 132 | __REQ_RAHEAD, /* read ahead, can fail anytime */ | 131 | __REQ_RAHEAD, /* read ahead, can fail anytime */ |
| 133 | __REQ_THROTTLED, /* This bio has already been subjected to | 132 | __REQ_THROTTLED, /* This bio has already been subjected to |
| 134 | * throttling rules. Don't do it again. */ | 133 | * throttling rules. Don't do it again. */ |
| @@ -148,9 +147,11 @@ enum rq_flag_bits { | |||
| 148 | __REQ_ALLOCED, /* request came from our alloc pool */ | 147 | __REQ_ALLOCED, /* request came from our alloc pool */ |
| 149 | __REQ_COPY_USER, /* contains copies of user pages */ | 148 | __REQ_COPY_USER, /* contains copies of user pages */ |
| 150 | __REQ_FLUSH, /* request for cache flush */ | 149 | __REQ_FLUSH, /* request for cache flush */ |
| 150 | __REQ_FLUSH_SEQ, /* request for flush sequence */ | ||
| 151 | __REQ_IO_STAT, /* account I/O stat */ | 151 | __REQ_IO_STAT, /* account I/O stat */ |
| 152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | 152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ |
| 153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | 153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ |
| 154 | __REQ_ON_PLUG, /* on plug list */ | ||
| 154 | __REQ_NR_BITS, /* stops here */ | 155 | __REQ_NR_BITS, /* stops here */ |
| 155 | }; | 156 | }; |
| 156 | 157 | ||
| @@ -170,7 +171,6 @@ enum rq_flag_bits { | |||
| 170 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 171 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
| 171 | #define REQ_CLONE_MASK REQ_COMMON_MASK | 172 | #define REQ_CLONE_MASK REQ_COMMON_MASK |
| 172 | 173 | ||
| 173 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | ||
| 174 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) | 174 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) |
| 175 | #define REQ_THROTTLED (1 << __REQ_THROTTLED) | 175 | #define REQ_THROTTLED (1 << __REQ_THROTTLED) |
| 176 | 176 | ||
| @@ -188,8 +188,10 @@ enum rq_flag_bits { | |||
| 188 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | 188 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) |
| 189 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) | 189 | #define REQ_COPY_USER (1 << __REQ_COPY_USER) |
| 190 | #define REQ_FLUSH (1 << __REQ_FLUSH) | 190 | #define REQ_FLUSH (1 << __REQ_FLUSH) |
| 191 | #define REQ_FLUSH_SEQ (1 << __REQ_FLUSH_SEQ) | ||
| 191 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 192 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
| 192 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | 193 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) |
| 193 | #define REQ_SECURE (1 << __REQ_SECURE) | 194 | #define REQ_SECURE (1 << __REQ_SECURE) |
| 195 | #define REQ_ON_PLUG (1 << __REQ_ON_PLUG) | ||
| 194 | 196 | ||
| 195 | #endif /* __LINUX_BLK_TYPES_H */ | 197 | #endif /* __LINUX_BLK_TYPES_H */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d5063e1b5555..16a902f099ac 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -108,11 +108,17 @@ struct request { | |||
| 108 | 108 | ||
| 109 | /* | 109 | /* |
| 110 | * Three pointers are available for the IO schedulers, if they need | 110 | * Three pointers are available for the IO schedulers, if they need |
| 111 | * more they have to dynamically allocate it. | 111 | * more they have to dynamically allocate it. Flush requests are |
| 112 | * never put on the IO scheduler. So let the flush fields share | ||
| 113 | * space with the three elevator_private pointers. | ||
| 112 | */ | 114 | */ |
| 113 | void *elevator_private; | 115 | union { |
| 114 | void *elevator_private2; | 116 | void *elevator_private[3]; |
| 115 | void *elevator_private3; | 117 | struct { |
| 118 | unsigned int seq; | ||
| 119 | struct list_head list; | ||
| 120 | } flush; | ||
| 121 | }; | ||
| 116 | 122 | ||
| 117 | struct gendisk *rq_disk; | 123 | struct gendisk *rq_disk; |
| 118 | struct hd_struct *part; | 124 | struct hd_struct *part; |
| @@ -190,7 +196,6 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
| 190 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 196 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
| 191 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 197 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
| 192 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); | 198 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); |
| 193 | typedef void (unplug_fn) (struct request_queue *); | ||
| 194 | 199 | ||
| 195 | struct bio_vec; | 200 | struct bio_vec; |
| 196 | struct bvec_merge_data { | 201 | struct bvec_merge_data { |
| @@ -273,7 +278,6 @@ struct request_queue | |||
| 273 | make_request_fn *make_request_fn; | 278 | make_request_fn *make_request_fn; |
| 274 | prep_rq_fn *prep_rq_fn; | 279 | prep_rq_fn *prep_rq_fn; |
| 275 | unprep_rq_fn *unprep_rq_fn; | 280 | unprep_rq_fn *unprep_rq_fn; |
| 276 | unplug_fn *unplug_fn; | ||
| 277 | merge_bvec_fn *merge_bvec_fn; | 281 | merge_bvec_fn *merge_bvec_fn; |
| 278 | softirq_done_fn *softirq_done_fn; | 282 | softirq_done_fn *softirq_done_fn; |
| 279 | rq_timed_out_fn *rq_timed_out_fn; | 283 | rq_timed_out_fn *rq_timed_out_fn; |
| @@ -287,12 +291,9 @@ struct request_queue | |||
| 287 | struct request *boundary_rq; | 291 | struct request *boundary_rq; |
| 288 | 292 | ||
| 289 | /* | 293 | /* |
| 290 | * Auto-unplugging state | 294 | * Delayed queue handling |
| 291 | */ | 295 | */ |
| 292 | struct timer_list unplug_timer; | 296 | struct delayed_work delay_work; |
| 293 | int unplug_thresh; /* After this many requests */ | ||
| 294 | unsigned long unplug_delay; /* After this many jiffies */ | ||
| 295 | struct work_struct unplug_work; | ||
| 296 | 297 | ||
| 297 | struct backing_dev_info backing_dev_info; | 298 | struct backing_dev_info backing_dev_info; |
| 298 | 299 | ||
| @@ -363,11 +364,12 @@ struct request_queue | |||
| 363 | * for flush operations | 364 | * for flush operations |
| 364 | */ | 365 | */ |
| 365 | unsigned int flush_flags; | 366 | unsigned int flush_flags; |
| 366 | unsigned int flush_seq; | 367 | unsigned int flush_pending_idx:1; |
| 367 | int flush_err; | 368 | unsigned int flush_running_idx:1; |
| 369 | unsigned long flush_pending_since; | ||
| 370 | struct list_head flush_queue[2]; | ||
| 371 | struct list_head flush_data_in_flight; | ||
| 368 | struct request flush_rq; | 372 | struct request flush_rq; |
| 369 | struct request *orig_flush_rq; | ||
| 370 | struct list_head pending_flushes; | ||
| 371 | 373 | ||
| 372 | struct mutex sysfs_lock; | 374 | struct mutex sysfs_lock; |
| 373 | 375 | ||
| @@ -387,14 +389,13 @@ struct request_queue | |||
| 387 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ | 389 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ |
| 388 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 390 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
| 389 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 391 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
| 390 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 392 | #define QUEUE_FLAG_ELVSWITCH 7 /* don't use elevator, just do FIFO */ |
| 391 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 393 | #define QUEUE_FLAG_BIDI 8 /* queue supports bidi requests */ |
| 392 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | 394 | #define QUEUE_FLAG_NOMERGES 9 /* disable merge attempts */ |
| 393 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ | 395 | #define QUEUE_FLAG_SAME_COMP 10 /* force complete on same CPU */ |
| 394 | #define QUEUE_FLAG_SAME_COMP 11 /* force complete on same CPU */ | 396 | #define QUEUE_FLAG_FAIL_IO 11 /* fake timeout */ |
| 395 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | 397 | #define QUEUE_FLAG_STACKABLE 12 /* supports request stacking */ |
| 396 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 398 | #define QUEUE_FLAG_NONROT 13 /* non-rotational device (SSD) */ |
| 397 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | ||
| 398 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 399 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
| 399 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 400 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
| 400 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ | 401 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
| @@ -472,7 +473,6 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | |||
| 472 | __clear_bit(flag, &q->queue_flags); | 473 | __clear_bit(flag, &q->queue_flags); |
| 473 | } | 474 | } |
| 474 | 475 | ||
| 475 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | ||
| 476 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 476 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
| 477 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 477 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
| 478 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 478 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
| @@ -667,9 +667,7 @@ extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src, | |||
| 667 | extern void blk_rq_unprep_clone(struct request *rq); | 667 | extern void blk_rq_unprep_clone(struct request *rq); |
| 668 | extern int blk_insert_cloned_request(struct request_queue *q, | 668 | extern int blk_insert_cloned_request(struct request_queue *q, |
| 669 | struct request *rq); | 669 | struct request *rq); |
| 670 | extern void blk_plug_device(struct request_queue *); | 670 | extern void blk_delay_queue(struct request_queue *, unsigned long); |
| 671 | extern void blk_plug_device_unlocked(struct request_queue *); | ||
| 672 | extern int blk_remove_plug(struct request_queue *); | ||
| 673 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 671 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
| 674 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, | 672 | extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
| 675 | unsigned int, void __user *); | 673 | unsigned int, void __user *); |
| @@ -713,7 +711,6 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *, | |||
| 713 | struct request *, int); | 711 | struct request *, int); |
| 714 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 712 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
| 715 | struct request *, int, rq_end_io_fn *); | 713 | struct request *, int, rq_end_io_fn *); |
| 716 | extern void blk_unplug(struct request_queue *q); | ||
| 717 | 714 | ||
| 718 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | 715 | static inline struct request_queue *bdev_get_queue(struct block_device *bdev) |
| 719 | { | 716 | { |
| @@ -850,7 +847,6 @@ extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bd | |||
| 850 | 847 | ||
| 851 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 848 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
| 852 | extern void blk_dump_rq_flags(struct request *, char *); | 849 | extern void blk_dump_rq_flags(struct request *, char *); |
| 853 | extern void generic_unplug_device(struct request_queue *); | ||
| 854 | extern long nr_blockdev_pages(void); | 850 | extern long nr_blockdev_pages(void); |
| 855 | 851 | ||
| 856 | int blk_get_queue(struct request_queue *); | 852 | int blk_get_queue(struct request_queue *); |
| @@ -858,6 +854,31 @@ struct request_queue *blk_alloc_queue(gfp_t); | |||
| 858 | struct request_queue *blk_alloc_queue_node(gfp_t, int); | 854 | struct request_queue *blk_alloc_queue_node(gfp_t, int); |
| 859 | extern void blk_put_queue(struct request_queue *); | 855 | extern void blk_put_queue(struct request_queue *); |
| 860 | 856 | ||
| 857 | struct blk_plug { | ||
| 858 | unsigned long magic; | ||
| 859 | struct list_head list; | ||
| 860 | unsigned int should_sort; | ||
| 861 | }; | ||
| 862 | |||
| 863 | extern void blk_start_plug(struct blk_plug *); | ||
| 864 | extern void blk_finish_plug(struct blk_plug *); | ||
| 865 | extern void __blk_flush_plug(struct task_struct *, struct blk_plug *); | ||
| 866 | |||
| 867 | static inline void blk_flush_plug(struct task_struct *tsk) | ||
| 868 | { | ||
| 869 | struct blk_plug *plug = tsk->plug; | ||
| 870 | |||
| 871 | if (unlikely(plug)) | ||
| 872 | __blk_flush_plug(tsk, plug); | ||
| 873 | } | ||
| 874 | |||
| 875 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) | ||
| 876 | { | ||
| 877 | struct blk_plug *plug = tsk->plug; | ||
| 878 | |||
| 879 | return plug && !list_empty(&plug->list); | ||
| 880 | } | ||
| 881 | |||
| 861 | /* | 882 | /* |
| 862 | * tag stuff | 883 | * tag stuff |
| 863 | */ | 884 | */ |
| @@ -1135,7 +1156,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req) | |||
| 1135 | extern int blk_throtl_init(struct request_queue *q); | 1156 | extern int blk_throtl_init(struct request_queue *q); |
| 1136 | extern void blk_throtl_exit(struct request_queue *q); | 1157 | extern void blk_throtl_exit(struct request_queue *q); |
| 1137 | extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); | 1158 | extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); |
| 1138 | extern void throtl_shutdown_timer_wq(struct request_queue *q); | ||
| 1139 | #else /* CONFIG_BLK_DEV_THROTTLING */ | 1159 | #else /* CONFIG_BLK_DEV_THROTTLING */ |
| 1140 | static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) | 1160 | static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) |
| 1141 | { | 1161 | { |
| @@ -1144,7 +1164,6 @@ static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) | |||
| 1144 | 1164 | ||
| 1145 | static inline int blk_throtl_init(struct request_queue *q) { return 0; } | 1165 | static inline int blk_throtl_init(struct request_queue *q) { return 0; } |
| 1146 | static inline int blk_throtl_exit(struct request_queue *q) { return 0; } | 1166 | static inline int blk_throtl_exit(struct request_queue *q) { return 0; } |
| 1147 | static inline void throtl_shutdown_timer_wq(struct request_queue *q) {} | ||
| 1148 | #endif /* CONFIG_BLK_DEV_THROTTLING */ | 1167 | #endif /* CONFIG_BLK_DEV_THROTTLING */ |
| 1149 | 1168 | ||
| 1150 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 1169 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
| @@ -1278,6 +1297,26 @@ static inline long nr_blockdev_pages(void) | |||
| 1278 | return 0; | 1297 | return 0; |
| 1279 | } | 1298 | } |
| 1280 | 1299 | ||
| 1300 | struct blk_plug { | ||
| 1301 | }; | ||
| 1302 | |||
| 1303 | static inline void blk_start_plug(struct blk_plug *plug) | ||
| 1304 | { | ||
| 1305 | } | ||
| 1306 | |||
| 1307 | static inline void blk_finish_plug(struct blk_plug *plug) | ||
| 1308 | { | ||
| 1309 | } | ||
| 1310 | |||
| 1311 | static inline void blk_flush_plug(struct task_struct *task) | ||
| 1312 | { | ||
| 1313 | } | ||
| 1314 | |||
| 1315 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) | ||
| 1316 | { | ||
| 1317 | return false; | ||
| 1318 | } | ||
| 1319 | |||
| 1281 | #endif /* CONFIG_BLOCK */ | 1320 | #endif /* CONFIG_BLOCK */ |
| 1282 | 1321 | ||
| 1283 | #endif | 1322 | #endif |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 68d1fe7b877c..f5df23561b96 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
| @@ -219,7 +219,6 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size); | |||
| 219 | int block_commit_write(struct page *page, unsigned from, unsigned to); | 219 | int block_commit_write(struct page *page, unsigned from, unsigned to); |
| 220 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, | 220 | int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, |
| 221 | get_block_t get_block); | 221 | get_block_t get_block); |
| 222 | void block_sync_page(struct page *); | ||
| 223 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); | 222 | sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); |
| 224 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); | 223 | int block_truncate_page(struct address_space *, loff_t, get_block_t *); |
| 225 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, | 224 | int nobh_write_begin(struct address_space *, loff_t, unsigned, unsigned, |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 272496d1fae4..e2768834f397 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -286,11 +286,6 @@ void dm_table_add_target_callbacks(struct dm_table *t, struct dm_target_callback | |||
| 286 | int dm_table_complete(struct dm_table *t); | 286 | int dm_table_complete(struct dm_table *t); |
| 287 | 287 | ||
| 288 | /* | 288 | /* |
| 289 | * Unplug all devices in a table. | ||
| 290 | */ | ||
| 291 | void dm_table_unplug_all(struct dm_table *t); | ||
| 292 | |||
| 293 | /* | ||
| 294 | * Table reference counting. | 289 | * Table reference counting. |
| 295 | */ | 290 | */ |
| 296 | struct dm_table *dm_get_live_table(struct mapped_device *md); | 291 | struct dm_table *dm_get_live_table(struct mapped_device *md); |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 4d857973d2c9..d93efcc44570 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -20,7 +20,6 @@ typedef void (elevator_bio_merged_fn) (struct request_queue *, | |||
| 20 | typedef int (elevator_dispatch_fn) (struct request_queue *, int); | 20 | typedef int (elevator_dispatch_fn) (struct request_queue *, int); |
| 21 | 21 | ||
| 22 | typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); | 22 | typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); |
| 23 | typedef int (elevator_queue_empty_fn) (struct request_queue *); | ||
| 24 | typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *); | 23 | typedef struct request *(elevator_request_list_fn) (struct request_queue *, struct request *); |
| 25 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); | 24 | typedef void (elevator_completed_req_fn) (struct request_queue *, struct request *); |
| 26 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); | 25 | typedef int (elevator_may_queue_fn) (struct request_queue *, int); |
| @@ -46,7 +45,6 @@ struct elevator_ops | |||
| 46 | elevator_activate_req_fn *elevator_activate_req_fn; | 45 | elevator_activate_req_fn *elevator_activate_req_fn; |
| 47 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; | 46 | elevator_deactivate_req_fn *elevator_deactivate_req_fn; |
| 48 | 47 | ||
| 49 | elevator_queue_empty_fn *elevator_queue_empty_fn; | ||
| 50 | elevator_completed_req_fn *elevator_completed_req_fn; | 48 | elevator_completed_req_fn *elevator_completed_req_fn; |
| 51 | 49 | ||
| 52 | elevator_request_list_fn *elevator_former_req_fn; | 50 | elevator_request_list_fn *elevator_former_req_fn; |
| @@ -101,17 +99,17 @@ struct elevator_queue | |||
| 101 | */ | 99 | */ |
| 102 | extern void elv_dispatch_sort(struct request_queue *, struct request *); | 100 | extern void elv_dispatch_sort(struct request_queue *, struct request *); |
| 103 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); | 101 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); |
| 104 | extern void elv_add_request(struct request_queue *, struct request *, int, int); | 102 | extern void elv_add_request(struct request_queue *, struct request *, int); |
| 105 | extern void __elv_add_request(struct request_queue *, struct request *, int, int); | 103 | extern void __elv_add_request(struct request_queue *, struct request *, int); |
| 106 | extern void elv_insert(struct request_queue *, struct request *, int); | 104 | extern void elv_insert(struct request_queue *, struct request *, int); |
| 107 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); | 105 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); |
| 106 | extern int elv_try_merge(struct request *, struct bio *); | ||
| 108 | extern void elv_merge_requests(struct request_queue *, struct request *, | 107 | extern void elv_merge_requests(struct request_queue *, struct request *, |
| 109 | struct request *); | 108 | struct request *); |
| 110 | extern void elv_merged_request(struct request_queue *, struct request *, int); | 109 | extern void elv_merged_request(struct request_queue *, struct request *, int); |
| 111 | extern void elv_bio_merged(struct request_queue *q, struct request *, | 110 | extern void elv_bio_merged(struct request_queue *q, struct request *, |
| 112 | struct bio *); | 111 | struct bio *); |
| 113 | extern void elv_requeue_request(struct request_queue *, struct request *); | 112 | extern void elv_requeue_request(struct request_queue *, struct request *); |
| 114 | extern int elv_queue_empty(struct request_queue *); | ||
| 115 | extern struct request *elv_former_request(struct request_queue *, struct request *); | 113 | extern struct request *elv_former_request(struct request_queue *, struct request *); |
| 116 | extern struct request *elv_latter_request(struct request_queue *, struct request *); | 114 | extern struct request *elv_latter_request(struct request_queue *, struct request *); |
| 117 | extern int elv_register_queue(struct request_queue *q); | 115 | extern int elv_register_queue(struct request_queue *q); |
| @@ -167,6 +165,8 @@ extern struct request *elv_rb_find(struct rb_root *, sector_t); | |||
| 167 | #define ELEVATOR_INSERT_BACK 2 | 165 | #define ELEVATOR_INSERT_BACK 2 |
| 168 | #define ELEVATOR_INSERT_SORT 3 | 166 | #define ELEVATOR_INSERT_SORT 3 |
| 169 | #define ELEVATOR_INSERT_REQUEUE 4 | 167 | #define ELEVATOR_INSERT_REQUEUE 4 |
| 168 | #define ELEVATOR_INSERT_FLUSH 5 | ||
| 169 | #define ELEVATOR_INSERT_SORT_MERGE 6 | ||
| 170 | 170 | ||
| 171 | /* | 171 | /* |
| 172 | * return values from elevator_may_queue_fn | 172 | * return values from elevator_may_queue_fn |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4dda076c24a1..ce7e18555197 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -138,16 +138,10 @@ struct inodes_stat_t { | |||
| 138 | * block layer could (in theory) choose to ignore this | 138 | * block layer could (in theory) choose to ignore this |
| 139 | * request if it runs into resource problems. | 139 | * request if it runs into resource problems. |
| 140 | * WRITE A normal async write. Device will be plugged. | 140 | * WRITE A normal async write. Device will be plugged. |
| 141 | * WRITE_SYNC_PLUG Synchronous write. Identical to WRITE, but passes down | 141 | * WRITE_SYNC Synchronous write. Identical to WRITE, but passes down |
| 142 | * the hint that someone will be waiting on this IO | 142 | * the hint that someone will be waiting on this IO |
| 143 | * shortly. The device must still be unplugged explicitly, | 143 | * shortly. The write equivalent of READ_SYNC. |
| 144 | * WRITE_SYNC_PLUG does not do this as we could be | 144 | * WRITE_ODIRECT Special case write for O_DIRECT only. |
| 145 | * submitting more writes before we actually wait on any | ||
| 146 | * of them. | ||
| 147 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device | ||
| 148 | * immediately after submission. The write equivalent | ||
| 149 | * of READ_SYNC. | ||
| 150 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. | ||
| 151 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. | 145 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. |
| 152 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on | 146 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on |
| 153 | * non-volatile media on completion. | 147 | * non-volatile media on completion. |
| @@ -163,18 +157,14 @@ struct inodes_stat_t { | |||
| 163 | #define WRITE RW_MASK | 157 | #define WRITE RW_MASK |
| 164 | #define READA RWA_MASK | 158 | #define READA RWA_MASK |
| 165 | 159 | ||
| 166 | #define READ_SYNC (READ | REQ_SYNC | REQ_UNPLUG) | 160 | #define READ_SYNC (READ | REQ_SYNC) |
| 167 | #define READ_META (READ | REQ_META) | 161 | #define READ_META (READ | REQ_META) |
| 168 | #define WRITE_SYNC_PLUG (WRITE | REQ_SYNC | REQ_NOIDLE) | 162 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) |
| 169 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) | 163 | #define WRITE_ODIRECT (WRITE | REQ_SYNC) |
| 170 | #define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) | ||
| 171 | #define WRITE_META (WRITE | REQ_META) | 164 | #define WRITE_META (WRITE | REQ_META) |
| 172 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 165 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) |
| 173 | REQ_FLUSH) | 166 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) |
| 174 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 167 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
| 175 | REQ_FUA) | ||
| 176 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | ||
| 177 | REQ_FLUSH | REQ_FUA) | ||
| 178 | 168 | ||
| 179 | #define SEL_IN 1 | 169 | #define SEL_IN 1 |
| 180 | #define SEL_OUT 2 | 170 | #define SEL_OUT 2 |
| @@ -586,7 +576,6 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, | |||
| 586 | struct address_space_operations { | 576 | struct address_space_operations { |
| 587 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 577 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
| 588 | int (*readpage)(struct file *, struct page *); | 578 | int (*readpage)(struct file *, struct page *); |
| 589 | void (*sync_page)(struct page *); | ||
| 590 | 579 | ||
| 591 | /* Write back some dirty pages from this mapping. */ | 580 | /* Write back some dirty pages from this mapping. */ |
| 592 | int (*writepages)(struct address_space *, struct writeback_control *); | 581 | int (*writepages)(struct address_space *, struct writeback_control *); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c0d5f6945c1e..d764a426e9fd 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -109,7 +109,7 @@ struct hd_struct { | |||
| 109 | int make_it_fail; | 109 | int make_it_fail; |
| 110 | #endif | 110 | #endif |
| 111 | unsigned long stamp; | 111 | unsigned long stamp; |
| 112 | int in_flight[2]; | 112 | atomic_t in_flight[2]; |
| 113 | #ifdef CONFIG_SMP | 113 | #ifdef CONFIG_SMP |
| 114 | struct disk_stats __percpu *dkstats; | 114 | struct disk_stats __percpu *dkstats; |
| 115 | #else | 115 | #else |
| @@ -370,21 +370,21 @@ static inline void free_part_stats(struct hd_struct *part) | |||
| 370 | 370 | ||
| 371 | static inline void part_inc_in_flight(struct hd_struct *part, int rw) | 371 | static inline void part_inc_in_flight(struct hd_struct *part, int rw) |
| 372 | { | 372 | { |
| 373 | part->in_flight[rw]++; | 373 | atomic_inc(&part->in_flight[rw]); |
| 374 | if (part->partno) | 374 | if (part->partno) |
| 375 | part_to_disk(part)->part0.in_flight[rw]++; | 375 | atomic_inc(&part_to_disk(part)->part0.in_flight[rw]); |
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | static inline void part_dec_in_flight(struct hd_struct *part, int rw) | 378 | static inline void part_dec_in_flight(struct hd_struct *part, int rw) |
| 379 | { | 379 | { |
| 380 | part->in_flight[rw]--; | 380 | atomic_dec(&part->in_flight[rw]); |
| 381 | if (part->partno) | 381 | if (part->partno) |
| 382 | part_to_disk(part)->part0.in_flight[rw]--; | 382 | atomic_dec(&part_to_disk(part)->part0.in_flight[rw]); |
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | static inline int part_in_flight(struct hd_struct *part) | 385 | static inline int part_in_flight(struct hd_struct *part) |
| 386 | { | 386 | { |
| 387 | return part->in_flight[0] + part->in_flight[1]; | 387 | return atomic_read(&part->in_flight[0]) + atomic_read(&part->in_flight[1]); |
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk) | 390 | static inline struct partition_meta_info *alloc_part_info(struct gendisk *disk) |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 29ebba54c238..c11950652646 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -298,7 +298,6 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | |||
| 298 | 298 | ||
| 299 | extern void __lock_page(struct page *page); | 299 | extern void __lock_page(struct page *page); |
| 300 | extern int __lock_page_killable(struct page *page); | 300 | extern int __lock_page_killable(struct page *page); |
| 301 | extern void __lock_page_nosync(struct page *page); | ||
| 302 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, | 301 | extern int __lock_page_or_retry(struct page *page, struct mm_struct *mm, |
| 303 | unsigned int flags); | 302 | unsigned int flags); |
| 304 | extern void unlock_page(struct page *page); | 303 | extern void unlock_page(struct page *page); |
| @@ -342,17 +341,6 @@ static inline int lock_page_killable(struct page *page) | |||
| 342 | } | 341 | } |
| 343 | 342 | ||
| 344 | /* | 343 | /* |
| 345 | * lock_page_nosync should only be used if we can't pin the page's inode. | ||
| 346 | * Doesn't play quite so well with block device plugging. | ||
| 347 | */ | ||
| 348 | static inline void lock_page_nosync(struct page *page) | ||
| 349 | { | ||
| 350 | might_sleep(); | ||
| 351 | if (!trylock_page(page)) | ||
| 352 | __lock_page_nosync(page); | ||
| 353 | } | ||
| 354 | |||
| 355 | /* | ||
| 356 | * lock_page_or_retry - Lock the page, unless this would block and the | 344 | * lock_page_or_retry - Lock the page, unless this would block and the |
| 357 | * caller indicated that it can handle a retry. | 345 | * caller indicated that it can handle a retry. |
| 358 | */ | 346 | */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 98fc7ed4b191..b8369d522bf8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -99,6 +99,7 @@ struct robust_list_head; | |||
| 99 | struct bio_list; | 99 | struct bio_list; |
| 100 | struct fs_struct; | 100 | struct fs_struct; |
| 101 | struct perf_event_context; | 101 | struct perf_event_context; |
| 102 | struct blk_plug; | ||
| 102 | 103 | ||
| 103 | /* | 104 | /* |
| 104 | * List of flags we want to share for kernel threads, | 105 | * List of flags we want to share for kernel threads, |
| @@ -1428,6 +1429,11 @@ struct task_struct { | |||
| 1428 | /* stacked block device info */ | 1429 | /* stacked block device info */ |
| 1429 | struct bio_list *bio_list; | 1430 | struct bio_list *bio_list; |
| 1430 | 1431 | ||
| 1432 | #ifdef CONFIG_BLOCK | ||
| 1433 | /* stack plugging */ | ||
| 1434 | struct blk_plug *plug; | ||
| 1435 | #endif | ||
| 1436 | |||
| 1431 | /* VM state */ | 1437 | /* VM state */ |
| 1432 | struct reclaim_state *reclaim_state; | 1438 | struct reclaim_state *reclaim_state; |
| 1433 | 1439 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index ed6ebe690f4a..a5c6da5d8df8 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -309,8 +309,6 @@ extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | |||
| 309 | struct page **pagep, swp_entry_t *ent); | 309 | struct page **pagep, swp_entry_t *ent); |
| 310 | #endif | 310 | #endif |
| 311 | 311 | ||
| 312 | extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | ||
| 313 | |||
| 314 | #ifdef CONFIG_SWAP | 312 | #ifdef CONFIG_SWAP |
| 315 | /* linux/mm/page_io.c */ | 313 | /* linux/mm/page_io.c */ |
| 316 | extern int swap_readpage(struct page *); | 314 | extern int swap_readpage(struct page *); |
