diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/aio.h | 5 | ||||
-rw-r--r-- | include/linux/bio.h | 26 | ||||
-rw-r--r-- | include/linux/blkdev.h | 52 | ||||
-rw-r--r-- | include/linux/buffer_head.h | 1 | ||||
-rw-r--r-- | include/linux/elevator.h | 8 | ||||
-rw-r--r-- | include/linux/genhd.h | 1 | ||||
-rw-r--r-- | include/linux/mm_types.h | 5 | ||||
-rw-r--r-- | include/linux/types.h | 11 |
8 files changed, 69 insertions, 40 deletions
diff --git a/include/linux/aio.h b/include/linux/aio.h index f6b8cf99b596..b16a957030f8 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/workqueue.h> | 5 | #include <linux/workqueue.h> |
6 | #include <linux/aio_abi.h> | 6 | #include <linux/aio_abi.h> |
7 | #include <linux/uio.h> | 7 | #include <linux/uio.h> |
8 | #include <linux/rcupdate.h> | ||
8 | 9 | ||
9 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
10 | 11 | ||
@@ -183,7 +184,7 @@ struct kioctx { | |||
183 | 184 | ||
184 | /* This needs improving */ | 185 | /* This needs improving */ |
185 | unsigned long user_id; | 186 | unsigned long user_id; |
186 | struct kioctx *next; | 187 | struct hlist_node list; |
187 | 188 | ||
188 | wait_queue_head_t wait; | 189 | wait_queue_head_t wait; |
189 | 190 | ||
@@ -199,6 +200,8 @@ struct kioctx { | |||
199 | struct aio_ring_info ring_info; | 200 | struct aio_ring_info ring_info; |
200 | 201 | ||
201 | struct delayed_work wq; | 202 | struct delayed_work wq; |
203 | |||
204 | struct rcu_head rcu_head; | ||
202 | }; | 205 | }; |
203 | 206 | ||
204 | /* prototypes */ | 207 | /* prototypes */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 6a642098e5c3..18462c5b8fff 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -90,10 +90,11 @@ struct bio { | |||
90 | 90 | ||
91 | unsigned int bi_comp_cpu; /* completion CPU */ | 91 | unsigned int bi_comp_cpu; /* completion CPU */ |
92 | 92 | ||
93 | atomic_t bi_cnt; /* pin count */ | ||
94 | |||
93 | struct bio_vec *bi_io_vec; /* the actual vec list */ | 95 | struct bio_vec *bi_io_vec; /* the actual vec list */ |
94 | 96 | ||
95 | bio_end_io_t *bi_end_io; | 97 | bio_end_io_t *bi_end_io; |
96 | atomic_t bi_cnt; /* pin count */ | ||
97 | 98 | ||
98 | void *bi_private; | 99 | void *bi_private; |
99 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 100 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
@@ -101,6 +102,13 @@ struct bio { | |||
101 | #endif | 102 | #endif |
102 | 103 | ||
103 | bio_destructor_t *bi_destructor; /* destructor */ | 104 | bio_destructor_t *bi_destructor; /* destructor */ |
105 | |||
106 | /* | ||
107 | * We can inline a number of vecs at the end of the bio, to avoid | ||
108 | * double allocations for a small number of bio_vecs. This member | ||
109 | * MUST obviously be kept at the very end of the bio. | ||
110 | */ | ||
111 | struct bio_vec bi_inline_vecs[0]; | ||
104 | }; | 112 | }; |
105 | 113 | ||
106 | /* | 114 | /* |
@@ -117,6 +125,7 @@ struct bio { | |||
117 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ | 125 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ |
118 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ | 126 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ |
119 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ | 127 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ |
128 | #define BIO_QUIET 11 /* Make BIO Quiet */ | ||
120 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 129 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
121 | 130 | ||
122 | /* | 131 | /* |
@@ -211,6 +220,11 @@ static inline void *bio_data(struct bio *bio) | |||
211 | return NULL; | 220 | return NULL; |
212 | } | 221 | } |
213 | 222 | ||
223 | static inline int bio_has_allocated_vec(struct bio *bio) | ||
224 | { | ||
225 | return bio->bi_io_vec && bio->bi_io_vec != bio->bi_inline_vecs; | ||
226 | } | ||
227 | |||
214 | /* | 228 | /* |
215 | * will die | 229 | * will die |
216 | */ | 230 | */ |
@@ -332,7 +346,7 @@ struct bio_pair { | |||
332 | extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); | 346 | extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); |
333 | extern void bio_pair_release(struct bio_pair *dbio); | 347 | extern void bio_pair_release(struct bio_pair *dbio); |
334 | 348 | ||
335 | extern struct bio_set *bioset_create(int, int); | 349 | extern struct bio_set *bioset_create(unsigned int, unsigned int); |
336 | extern void bioset_free(struct bio_set *); | 350 | extern void bioset_free(struct bio_set *); |
337 | 351 | ||
338 | extern struct bio *bio_alloc(gfp_t, int); | 352 | extern struct bio *bio_alloc(gfp_t, int); |
@@ -377,6 +391,7 @@ extern struct bio *bio_copy_user_iov(struct request_queue *, | |||
377 | extern int bio_uncopy_user(struct bio *); | 391 | extern int bio_uncopy_user(struct bio *); |
378 | void zero_fill_bio(struct bio *bio); | 392 | void zero_fill_bio(struct bio *bio); |
379 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); | 393 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); |
394 | extern void bvec_free_bs(struct bio_set *, struct bio_vec *, unsigned int); | ||
380 | extern unsigned int bvec_nr_vecs(unsigned short idx); | 395 | extern unsigned int bvec_nr_vecs(unsigned short idx); |
381 | 396 | ||
382 | /* | 397 | /* |
@@ -395,13 +410,17 @@ static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu) | |||
395 | */ | 410 | */ |
396 | #define BIO_POOL_SIZE 2 | 411 | #define BIO_POOL_SIZE 2 |
397 | #define BIOVEC_NR_POOLS 6 | 412 | #define BIOVEC_NR_POOLS 6 |
413 | #define BIOVEC_MAX_IDX (BIOVEC_NR_POOLS - 1) | ||
398 | 414 | ||
399 | struct bio_set { | 415 | struct bio_set { |
416 | struct kmem_cache *bio_slab; | ||
417 | unsigned int front_pad; | ||
418 | |||
400 | mempool_t *bio_pool; | 419 | mempool_t *bio_pool; |
401 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 420 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
402 | mempool_t *bio_integrity_pool; | 421 | mempool_t *bio_integrity_pool; |
403 | #endif | 422 | #endif |
404 | mempool_t *bvec_pools[BIOVEC_NR_POOLS]; | 423 | mempool_t *bvec_pool; |
405 | }; | 424 | }; |
406 | 425 | ||
407 | struct biovec_slab { | 426 | struct biovec_slab { |
@@ -411,6 +430,7 @@ struct biovec_slab { | |||
411 | }; | 430 | }; |
412 | 431 | ||
413 | extern struct bio_set *fs_bio_set; | 432 | extern struct bio_set *fs_bio_set; |
433 | extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly; | ||
414 | 434 | ||
415 | /* | 435 | /* |
416 | * a small number of entries is fine, not going to be performance critical. | 436 | * a small number of entries is fine, not going to be performance critical. |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 031a315c0509..7035cec583b6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -26,7 +26,6 @@ struct scsi_ioctl_command; | |||
26 | 26 | ||
27 | struct request_queue; | 27 | struct request_queue; |
28 | struct elevator_queue; | 28 | struct elevator_queue; |
29 | typedef struct elevator_queue elevator_t; | ||
30 | struct request_pm_state; | 29 | struct request_pm_state; |
31 | struct blk_trace; | 30 | struct blk_trace; |
32 | struct request; | 31 | struct request; |
@@ -313,7 +312,7 @@ struct request_queue | |||
313 | */ | 312 | */ |
314 | struct list_head queue_head; | 313 | struct list_head queue_head; |
315 | struct request *last_merge; | 314 | struct request *last_merge; |
316 | elevator_t *elevator; | 315 | struct elevator_queue *elevator; |
317 | 316 | ||
318 | /* | 317 | /* |
319 | * the queue request freelist, one for reads and one for writes | 318 | * the queue request freelist, one for reads and one for writes |
@@ -449,6 +448,7 @@ struct request_queue | |||
449 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | 448 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ |
450 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | 449 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ |
451 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 450 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
451 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | ||
452 | 452 | ||
453 | static inline int queue_is_locked(struct request_queue *q) | 453 | static inline int queue_is_locked(struct request_queue *q) |
454 | { | 454 | { |
@@ -522,22 +522,32 @@ enum { | |||
522 | * TAG_FLUSH : ordering by tag w/ pre and post flushes | 522 | * TAG_FLUSH : ordering by tag w/ pre and post flushes |
523 | * TAG_FUA : ordering by tag w/ pre flush and FUA write | 523 | * TAG_FUA : ordering by tag w/ pre flush and FUA write |
524 | */ | 524 | */ |
525 | QUEUE_ORDERED_NONE = 0x00, | 525 | QUEUE_ORDERED_BY_DRAIN = 0x01, |
526 | QUEUE_ORDERED_DRAIN = 0x01, | 526 | QUEUE_ORDERED_BY_TAG = 0x02, |
527 | QUEUE_ORDERED_TAG = 0x02, | 527 | QUEUE_ORDERED_DO_PREFLUSH = 0x10, |
528 | 528 | QUEUE_ORDERED_DO_BAR = 0x20, | |
529 | QUEUE_ORDERED_PREFLUSH = 0x10, | 529 | QUEUE_ORDERED_DO_POSTFLUSH = 0x40, |
530 | QUEUE_ORDERED_POSTFLUSH = 0x20, | 530 | QUEUE_ORDERED_DO_FUA = 0x80, |
531 | QUEUE_ORDERED_FUA = 0x40, | 531 | |
532 | 532 | QUEUE_ORDERED_NONE = 0x00, | |
533 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | | 533 | |
534 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH, | 534 | QUEUE_ORDERED_DRAIN = QUEUE_ORDERED_BY_DRAIN | |
535 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | | 535 | QUEUE_ORDERED_DO_BAR, |
536 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA, | 536 | QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN | |
537 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | 537 | QUEUE_ORDERED_DO_PREFLUSH | |
538 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH, | 538 | QUEUE_ORDERED_DO_POSTFLUSH, |
539 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | 539 | QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN | |
540 | QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA, | 540 | QUEUE_ORDERED_DO_PREFLUSH | |
541 | QUEUE_ORDERED_DO_FUA, | ||
542 | |||
543 | QUEUE_ORDERED_TAG = QUEUE_ORDERED_BY_TAG | | ||
544 | QUEUE_ORDERED_DO_BAR, | ||
545 | QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG | | ||
546 | QUEUE_ORDERED_DO_PREFLUSH | | ||
547 | QUEUE_ORDERED_DO_POSTFLUSH, | ||
548 | QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG | | ||
549 | QUEUE_ORDERED_DO_PREFLUSH | | ||
550 | QUEUE_ORDERED_DO_FUA, | ||
541 | 551 | ||
542 | /* | 552 | /* |
543 | * Ordered operation sequence | 553 | * Ordered operation sequence |
@@ -585,7 +595,6 @@ enum { | |||
585 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 595 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
586 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) | 596 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) |
587 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 597 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
588 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | ||
589 | /* rq->queuelist of dequeued request must be list_empty() */ | 598 | /* rq->queuelist of dequeued request must be list_empty() */ |
590 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) | 599 | #define blk_queued_rq(rq) (!list_empty(&(rq)->queuelist)) |
591 | 600 | ||
@@ -855,10 +864,10 @@ extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | |||
855 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | 864 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); |
856 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 865 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
857 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); | 866 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
858 | extern int blk_do_ordered(struct request_queue *, struct request **); | 867 | extern bool blk_do_ordered(struct request_queue *, struct request **); |
859 | extern unsigned blk_ordered_cur_seq(struct request_queue *); | 868 | extern unsigned blk_ordered_cur_seq(struct request_queue *); |
860 | extern unsigned blk_ordered_req_seq(struct request *); | 869 | extern unsigned blk_ordered_req_seq(struct request *); |
861 | extern void blk_ordered_complete_seq(struct request_queue *, unsigned, int); | 870 | extern bool blk_ordered_complete_seq(struct request_queue *, unsigned, int); |
862 | 871 | ||
863 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); | 872 | extern int blk_rq_map_sg(struct request_queue *, struct request *, struct scatterlist *); |
864 | extern void blk_dump_rq_flags(struct request *, char *); | 873 | extern void blk_dump_rq_flags(struct request *, char *); |
@@ -977,7 +986,6 @@ static inline void put_dev_sector(Sector p) | |||
977 | 986 | ||
978 | struct work_struct; | 987 | struct work_struct; |
979 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); | 988 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); |
980 | void kblockd_flush_work(struct work_struct *work); | ||
981 | 989 | ||
982 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 990 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
983 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 991 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 3ce64b90118c..8605f8a74df9 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -35,6 +35,7 @@ enum bh_state_bits { | |||
35 | BH_Ordered, /* ordered write */ | 35 | BH_Ordered, /* ordered write */ |
36 | BH_Eopnotsupp, /* operation not supported (barrier) */ | 36 | BH_Eopnotsupp, /* operation not supported (barrier) */ |
37 | BH_Unwritten, /* Buffer is allocated on disk but not written */ | 37 | BH_Unwritten, /* Buffer is allocated on disk but not written */ |
38 | BH_Quiet, /* Buffer Error Prinks to be quiet */ | ||
38 | 39 | ||
39 | BH_PrivateStart,/* not a state bit, but the first bit available | 40 | BH_PrivateStart,/* not a state bit, but the first bit available |
40 | * for private allocation by other entities | 41 | * for private allocation by other entities |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 92f6f634e3e6..7a204256b155 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -28,7 +28,7 @@ typedef void (elevator_activate_req_fn) (struct request_queue *, struct request | |||
28 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); | 28 | typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); |
29 | 29 | ||
30 | typedef void *(elevator_init_fn) (struct request_queue *); | 30 | typedef void *(elevator_init_fn) (struct request_queue *); |
31 | typedef void (elevator_exit_fn) (elevator_t *); | 31 | typedef void (elevator_exit_fn) (struct elevator_queue *); |
32 | 32 | ||
33 | struct elevator_ops | 33 | struct elevator_ops |
34 | { | 34 | { |
@@ -62,8 +62,8 @@ struct elevator_ops | |||
62 | 62 | ||
63 | struct elv_fs_entry { | 63 | struct elv_fs_entry { |
64 | struct attribute attr; | 64 | struct attribute attr; |
65 | ssize_t (*show)(elevator_t *, char *); | 65 | ssize_t (*show)(struct elevator_queue *, char *); |
66 | ssize_t (*store)(elevator_t *, const char *, size_t); | 66 | ssize_t (*store)(struct elevator_queue *, const char *, size_t); |
67 | }; | 67 | }; |
68 | 68 | ||
69 | /* | 69 | /* |
@@ -130,7 +130,7 @@ extern ssize_t elv_iosched_show(struct request_queue *, char *); | |||
130 | extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); | 130 | extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); |
131 | 131 | ||
132 | extern int elevator_init(struct request_queue *, char *); | 132 | extern int elevator_init(struct request_queue *, char *); |
133 | extern void elevator_exit(elevator_t *); | 133 | extern void elevator_exit(struct elevator_queue *); |
134 | extern int elv_rq_merge_ok(struct request *, struct bio *); | 134 | extern int elv_rq_merge_ok(struct request *, struct bio *); |
135 | 135 | ||
136 | /* | 136 | /* |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 3df7742ce246..16948eaecae3 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -126,6 +126,7 @@ struct blk_scsi_cmd_filter { | |||
126 | struct disk_part_tbl { | 126 | struct disk_part_tbl { |
127 | struct rcu_head rcu_head; | 127 | struct rcu_head rcu_head; |
128 | int len; | 128 | int len; |
129 | struct hd_struct *last_lookup; | ||
129 | struct hd_struct *part[]; | 130 | struct hd_struct *part[]; |
130 | }; | 131 | }; |
131 | 132 | ||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index fe825471d5aa..9cfc9b627fdd 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -232,8 +232,9 @@ struct mm_struct { | |||
232 | struct core_state *core_state; /* coredumping support */ | 232 | struct core_state *core_state; /* coredumping support */ |
233 | 233 | ||
234 | /* aio bits */ | 234 | /* aio bits */ |
235 | rwlock_t ioctx_list_lock; /* aio lock */ | 235 | spinlock_t ioctx_lock; |
236 | struct kioctx *ioctx_list; | 236 | struct hlist_head ioctx_list; |
237 | |||
237 | #ifdef CONFIG_MM_OWNER | 238 | #ifdef CONFIG_MM_OWNER |
238 | /* | 239 | /* |
239 | * "owner" points to a task that is regarded as the canonical | 240 | * "owner" points to a task that is regarded as the canonical |
diff --git a/include/linux/types.h b/include/linux/types.h index 1d98330b1f2c..121f349cb7ec 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -135,19 +135,14 @@ typedef __s64 int64_t; | |||
135 | * | 135 | * |
136 | * Linux always considers sectors to be 512 bytes long independently | 136 | * Linux always considers sectors to be 512 bytes long independently |
137 | * of the devices real block size. | 137 | * of the devices real block size. |
138 | * | ||
139 | * blkcnt_t is the type of the inode's block count. | ||
138 | */ | 140 | */ |
139 | #ifdef CONFIG_LBD | 141 | #ifdef CONFIG_LBD |
140 | typedef u64 sector_t; | 142 | typedef u64 sector_t; |
141 | #else | ||
142 | typedef unsigned long sector_t; | ||
143 | #endif | ||
144 | |||
145 | /* | ||
146 | * The type of the inode's block count. | ||
147 | */ | ||
148 | #ifdef CONFIG_LSF | ||
149 | typedef u64 blkcnt_t; | 143 | typedef u64 blkcnt_t; |
150 | #else | 144 | #else |
145 | typedef unsigned long sector_t; | ||
151 | typedef unsigned long blkcnt_t; | 146 | typedef unsigned long blkcnt_t; |
152 | #endif | 147 | #endif |
153 | 148 | ||