diff options
author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-10 02:58:35 -0500 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-03-10 02:58:35 -0500 |
commit | 4c63f5646e405b5010cc9499419060bf2e838f5b (patch) | |
tree | df91ba315032c8ec4aafeb3ab96fdfa7c6c656e1 /include | |
parent | cafb0bfca1a73efd6d8a4a6a6a716e6134b96c24 (diff) | |
parent | 69d60eb96ae8a73cf9b79cf28051caf973006011 (diff) |
Merge branch 'for-2.6.39/stack-plug' into for-2.6.39/core
Conflicts:
block/blk-core.c
block/blk-flush.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
fs/nilfs2/btnode.c
fs/nilfs2/mdt.c
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/backing-dev.h | 16 | ||||
-rw-r--r-- | include/linux/blk_types.h | 4 | ||||
-rw-r--r-- | include/linux/blkdev.h | 73 | ||||
-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 | 8 | ||||
-rw-r--r-- | include/linux/fs.h | 29 | ||||
-rw-r--r-- | include/linux/pagemap.h | 12 | ||||
-rw-r--r-- | include/linux/sched.h | 6 | ||||
-rw-r--r-- | include/linux/swap.h | 2 |
10 files changed, 72 insertions, 84 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/blk_types.h b/include/linux/blk_types.h index dddedfc0af81..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. */ |
@@ -152,6 +151,7 @@ enum rq_flag_bits { | |||
152 | __REQ_IO_STAT, /* account I/O stat */ | 151 | __REQ_IO_STAT, /* account I/O stat */ |
153 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | 152 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ |
154 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ | 153 | __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */ |
154 | __REQ_ON_PLUG, /* on plug list */ | ||
155 | __REQ_NR_BITS, /* stops here */ | 155 | __REQ_NR_BITS, /* stops here */ |
156 | }; | 156 | }; |
157 | 157 | ||
@@ -171,7 +171,6 @@ enum rq_flag_bits { | |||
171 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) | 171 | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
172 | #define REQ_CLONE_MASK REQ_COMMON_MASK | 172 | #define REQ_CLONE_MASK REQ_COMMON_MASK |
173 | 173 | ||
174 | #define REQ_UNPLUG (1 << __REQ_UNPLUG) | ||
175 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) | 174 | #define REQ_RAHEAD (1 << __REQ_RAHEAD) |
176 | #define REQ_THROTTLED (1 << __REQ_THROTTLED) | 175 | #define REQ_THROTTLED (1 << __REQ_THROTTLED) |
177 | 176 | ||
@@ -193,5 +192,6 @@ enum rq_flag_bits { | |||
193 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 192 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
194 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | 193 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) |
195 | #define REQ_SECURE (1 << __REQ_SECURE) | 194 | #define REQ_SECURE (1 << __REQ_SECURE) |
195 | #define REQ_ON_PLUG (1 << __REQ_ON_PLUG) | ||
196 | 196 | ||
197 | #endif /* __LINUX_BLK_TYPES_H */ | 197 | #endif /* __LINUX_BLK_TYPES_H */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 13b75ca62181..91fa428fa2c1 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -196,7 +196,6 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
196 | 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); |
197 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 197 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
198 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); | 198 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); |
199 | typedef void (unplug_fn) (struct request_queue *); | ||
200 | 199 | ||
201 | struct bio_vec; | 200 | struct bio_vec; |
202 | struct bvec_merge_data { | 201 | struct bvec_merge_data { |
@@ -279,7 +278,6 @@ struct request_queue | |||
279 | make_request_fn *make_request_fn; | 278 | make_request_fn *make_request_fn; |
280 | prep_rq_fn *prep_rq_fn; | 279 | prep_rq_fn *prep_rq_fn; |
281 | unprep_rq_fn *unprep_rq_fn; | 280 | unprep_rq_fn *unprep_rq_fn; |
282 | unplug_fn *unplug_fn; | ||
283 | merge_bvec_fn *merge_bvec_fn; | 281 | merge_bvec_fn *merge_bvec_fn; |
284 | softirq_done_fn *softirq_done_fn; | 282 | softirq_done_fn *softirq_done_fn; |
285 | rq_timed_out_fn *rq_timed_out_fn; | 283 | rq_timed_out_fn *rq_timed_out_fn; |
@@ -293,12 +291,9 @@ struct request_queue | |||
293 | struct request *boundary_rq; | 291 | struct request *boundary_rq; |
294 | 292 | ||
295 | /* | 293 | /* |
296 | * Auto-unplugging state | 294 | * Delayed queue handling |
297 | */ | 295 | */ |
298 | struct timer_list unplug_timer; | 296 | struct delayed_work delay_work; |
299 | int unplug_thresh; /* After this many requests */ | ||
300 | unsigned long unplug_delay; /* After this many jiffies */ | ||
301 | struct work_struct unplug_work; | ||
302 | 297 | ||
303 | struct backing_dev_info backing_dev_info; | 298 | struct backing_dev_info backing_dev_info; |
304 | 299 | ||
@@ -394,14 +389,13 @@ struct request_queue | |||
394 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ | 389 | #define QUEUE_FLAG_ASYNCFULL 4 /* write queue has been filled */ |
395 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ | 390 | #define QUEUE_FLAG_DEAD 5 /* queue being torn down */ |
396 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ | 391 | #define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ |
397 | #define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ | 392 | #define QUEUE_FLAG_ELVSWITCH 7 /* don't use elevator, just do FIFO */ |
398 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 393 | #define QUEUE_FLAG_BIDI 8 /* queue supports bidi requests */ |
399 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | 394 | #define QUEUE_FLAG_NOMERGES 9 /* disable merge attempts */ |
400 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ | 395 | #define QUEUE_FLAG_SAME_COMP 10 /* force complete on same CPU */ |
401 | #define QUEUE_FLAG_SAME_COMP 11 /* force complete on same CPU */ | 396 | #define QUEUE_FLAG_FAIL_IO 11 /* fake timeout */ |
402 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | 397 | #define QUEUE_FLAG_STACKABLE 12 /* supports request stacking */ |
403 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 398 | #define QUEUE_FLAG_NONROT 13 /* non-rotational device (SSD) */ |
404 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | ||
405 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 399 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
406 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 400 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
407 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ | 401 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
@@ -479,7 +473,6 @@ static inline void queue_flag_clear(unsigned int flag, struct request_queue *q) | |||
479 | __clear_bit(flag, &q->queue_flags); | 473 | __clear_bit(flag, &q->queue_flags); |
480 | } | 474 | } |
481 | 475 | ||
482 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | ||
483 | #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) |
484 | #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) |
485 | #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) |
@@ -674,9 +667,7 @@ extern int blk_rq_prep_clone(struct request *rq, struct request *rq_src, | |||
674 | extern void blk_rq_unprep_clone(struct request *rq); | 667 | extern void blk_rq_unprep_clone(struct request *rq); |
675 | extern int blk_insert_cloned_request(struct request_queue *q, | 668 | extern int blk_insert_cloned_request(struct request_queue *q, |
676 | struct request *rq); | 669 | struct request *rq); |
677 | extern void blk_plug_device(struct request_queue *); | 670 | extern void blk_delay_queue(struct request_queue *, unsigned long); |
678 | extern void blk_plug_device_unlocked(struct request_queue *); | ||
679 | extern int blk_remove_plug(struct request_queue *); | ||
680 | extern void blk_recount_segments(struct request_queue *, struct bio *); | 671 | extern void blk_recount_segments(struct request_queue *, struct bio *); |
681 | 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, |
682 | unsigned int, void __user *); | 673 | unsigned int, void __user *); |
@@ -720,7 +711,6 @@ extern int blk_execute_rq(struct request_queue *, struct gendisk *, | |||
720 | struct request *, int); | 711 | struct request *, int); |
721 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 712 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
722 | struct request *, int, rq_end_io_fn *); | 713 | struct request *, int, rq_end_io_fn *); |
723 | extern void blk_unplug(struct request_queue *q); | ||
724 | 714 | ||
725 | 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) |
726 | { | 716 | { |
@@ -857,7 +847,6 @@ extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bd | |||
857 | 847 | ||
858 | 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 *); |
859 | extern void blk_dump_rq_flags(struct request *, char *); | 849 | extern void blk_dump_rq_flags(struct request *, char *); |
860 | extern void generic_unplug_device(struct request_queue *); | ||
861 | extern long nr_blockdev_pages(void); | 850 | extern long nr_blockdev_pages(void); |
862 | 851 | ||
863 | int blk_get_queue(struct request_queue *); | 852 | int blk_get_queue(struct request_queue *); |
@@ -865,6 +854,31 @@ struct request_queue *blk_alloc_queue(gfp_t); | |||
865 | struct request_queue *blk_alloc_queue_node(gfp_t, int); | 854 | struct request_queue *blk_alloc_queue_node(gfp_t, int); |
866 | extern void blk_put_queue(struct request_queue *); | 855 | extern void blk_put_queue(struct request_queue *); |
867 | 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 | |||
868 | /* | 882 | /* |
869 | * tag stuff | 883 | * tag stuff |
870 | */ | 884 | */ |
@@ -1283,6 +1297,23 @@ static inline long nr_blockdev_pages(void) | |||
1283 | return 0; | 1297 | return 0; |
1284 | } | 1298 | } |
1285 | 1299 | ||
1300 | static inline void blk_start_plug(struct list_head *list) | ||
1301 | { | ||
1302 | } | ||
1303 | |||
1304 | static inline void blk_finish_plug(struct list_head *list) | ||
1305 | { | ||
1306 | } | ||
1307 | |||
1308 | static inline void blk_flush_plug(struct task_struct *tsk) | ||
1309 | { | ||
1310 | } | ||
1311 | |||
1312 | static inline bool blk_needs_flush_plug(struct task_struct *tsk) | ||
1313 | { | ||
1314 | return false; | ||
1315 | } | ||
1316 | |||
1286 | #endif /* CONFIG_BLOCK */ | 1317 | #endif /* CONFIG_BLOCK */ |
1287 | 1318 | ||
1288 | #endif | 1319 | #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 39b68edb388d..ec6f72b84477 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); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e38b50a4b9d2..b95199daa5eb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -135,16 +135,10 @@ struct inodes_stat_t { | |||
135 | * block layer could (in theory) choose to ignore this | 135 | * block layer could (in theory) choose to ignore this |
136 | * request if it runs into resource problems. | 136 | * request if it runs into resource problems. |
137 | * WRITE A normal async write. Device will be plugged. | 137 | * WRITE A normal async write. Device will be plugged. |
138 | * WRITE_SYNC_PLUG Synchronous write. Identical to WRITE, but passes down | 138 | * WRITE_SYNC Synchronous write. Identical to WRITE, but passes down |
139 | * the hint that someone will be waiting on this IO | 139 | * the hint that someone will be waiting on this IO |
140 | * shortly. The device must still be unplugged explicitly, | 140 | * shortly. The write equivalent of READ_SYNC. |
141 | * WRITE_SYNC_PLUG does not do this as we could be | 141 | * WRITE_ODIRECT Special case write for O_DIRECT only. |
142 | * submitting more writes before we actually wait on any | ||
143 | * of them. | ||
144 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device | ||
145 | * immediately after submission. The write equivalent | ||
146 | * of READ_SYNC. | ||
147 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. | ||
148 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. | 142 | * WRITE_FLUSH Like WRITE_SYNC but with preceding cache flush. |
149 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on | 143 | * WRITE_FUA Like WRITE_SYNC but data is guaranteed to be on |
150 | * non-volatile media on completion. | 144 | * non-volatile media on completion. |
@@ -160,18 +154,14 @@ struct inodes_stat_t { | |||
160 | #define WRITE RW_MASK | 154 | #define WRITE RW_MASK |
161 | #define READA RWA_MASK | 155 | #define READA RWA_MASK |
162 | 156 | ||
163 | #define READ_SYNC (READ | REQ_SYNC | REQ_UNPLUG) | 157 | #define READ_SYNC (READ | REQ_SYNC) |
164 | #define READ_META (READ | REQ_META) | 158 | #define READ_META (READ | REQ_META) |
165 | #define WRITE_SYNC_PLUG (WRITE | REQ_SYNC | REQ_NOIDLE) | 159 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) |
166 | #define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG) | 160 | #define WRITE_ODIRECT (WRITE | REQ_SYNC) |
167 | #define WRITE_ODIRECT_PLUG (WRITE | REQ_SYNC) | ||
168 | #define WRITE_META (WRITE | REQ_META) | 161 | #define WRITE_META (WRITE | REQ_META) |
169 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 162 | #define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) |
170 | REQ_FLUSH) | 163 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) |
171 | #define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | 164 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) |
172 | REQ_FUA) | ||
173 | #define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_UNPLUG | \ | ||
174 | REQ_FLUSH | REQ_FUA) | ||
175 | 165 | ||
176 | #define SEL_IN 1 | 166 | #define SEL_IN 1 |
177 | #define SEL_OUT 2 | 167 | #define SEL_OUT 2 |
@@ -583,7 +573,6 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, | |||
583 | struct address_space_operations { | 573 | struct address_space_operations { |
584 | int (*writepage)(struct page *page, struct writeback_control *wbc); | 574 | int (*writepage)(struct page *page, struct writeback_control *wbc); |
585 | int (*readpage)(struct file *, struct page *); | 575 | int (*readpage)(struct file *, struct page *); |
586 | void (*sync_page)(struct page *); | ||
587 | 576 | ||
588 | /* Write back some dirty pages from this mapping. */ | 577 | /* Write back some dirty pages from this mapping. */ |
589 | int (*writepages)(struct address_space *, struct writeback_control *); | 578 | int (*writepages)(struct address_space *, struct writeback_control *); |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 9c66e994540f..e112b8db2f3c 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 777d8a5ed06b..96ac22643742 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, |
@@ -1429,6 +1430,11 @@ struct task_struct { | |||
1429 | /* stacked block device info */ | 1430 | /* stacked block device info */ |
1430 | struct bio_list *bio_list; | 1431 | struct bio_list *bio_list; |
1431 | 1432 | ||
1433 | #ifdef CONFIG_BLOCK | ||
1434 | /* stack plugging */ | ||
1435 | struct blk_plug *plug; | ||
1436 | #endif | ||
1437 | |||
1432 | /* VM state */ | 1438 | /* VM state */ |
1433 | struct reclaim_state *reclaim_state; | 1439 | struct reclaim_state *reclaim_state; |
1434 | 1440 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 4d559325d919..9ee321833b21 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -299,8 +299,6 @@ extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, | |||
299 | struct page **pagep, swp_entry_t *ent); | 299 | struct page **pagep, swp_entry_t *ent); |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | ||
303 | |||
304 | #ifdef CONFIG_SWAP | 302 | #ifdef CONFIG_SWAP |
305 | /* linux/mm/page_io.c */ | 303 | /* linux/mm/page_io.c */ |
306 | extern int swap_readpage(struct page *); | 304 | extern int swap_readpage(struct page *); |