diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 20:06:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 20:06:58 -0400 |
commit | b4fdcb02f1e39c27058a885905bd0277370ba441 (patch) | |
tree | fd4cfd1994f21f44afe5e7904681fb5ac09f81b8 /include/linux | |
parent | 044595d4e448305fbaec472eb7d22636d24e7d8c (diff) | |
parent | 6dd9ad7df2019b1e33a372a501907db293ebcd0d (diff) |
Merge branch 'for-3.2/core' of git://git.kernel.dk/linux-block
* 'for-3.2/core' of git://git.kernel.dk/linux-block: (29 commits)
block: don't call blk_drain_queue() if elevator is not up
blk-throttle: use queue_is_locked() instead of lockdep_is_held()
blk-throttle: Take blkcg->lock while traversing blkcg->policy_list
blk-throttle: Free up policy node associated with deleted rule
block: warn if tag is greater than real_max_depth.
block: make gendisk hold a reference to its queue
blk-flush: move the queue kick into
blk-flush: fix invalid BUG_ON in blk_insert_flush
block: Remove the control of complete cpu from bio.
block: fix a typo in the blk-cgroup.h file
block: initialize the bounce pool if high memory may be added later
block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown
block: drop @tsk from attempt_plug_merge() and explain sync rules
block: make get_request[_wait]() fail if queue is dead
block: reorganize throtl_get_tg() and blk_throtl_bio()
block: reorganize queue draining
block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl() and blk_get_tg()
block: pass around REQ_* flags instead of broken down booleans during request alloc/free
block: move blk_throtl prototypes to block/blk.h
block: fix genhd refcounting in blkio_policy_parse_and_set()
...
Fix up trivial conflicts due to "mddev_t" -> "struct mddev" conversion
and making the request functions be of type "void" instead of "int" in
- drivers/md/{faulty.c,linear.c,md.c,md.h,multipath.c,raid0.c,raid1.c,raid10.c,raid5.c}
- drivers/staging/zram/zram_drv.c
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bio.h | 8 | ||||
-rw-r--r-- | include/linux/blk_types.h | 11 | ||||
-rw-r--r-- | include/linux/blkdev.h | 40 | ||||
-rw-r--r-- | include/linux/elevator.h | 6 | ||||
-rw-r--r-- | include/linux/loop.h | 1 |
5 files changed, 27 insertions, 39 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index ce33e6868a2f..a3c071c9e189 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -269,14 +269,6 @@ extern void bvec_free_bs(struct bio_set *, struct bio_vec *, unsigned int); | |||
269 | extern unsigned int bvec_nr_vecs(unsigned short idx); | 269 | extern unsigned int bvec_nr_vecs(unsigned short idx); |
270 | 270 | ||
271 | /* | 271 | /* |
272 | * Allow queuer to specify a completion CPU for this bio | ||
273 | */ | ||
274 | static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu) | ||
275 | { | ||
276 | bio->bi_comp_cpu = cpu; | ||
277 | } | ||
278 | |||
279 | /* | ||
280 | * bio_set is used to allow other portions of the IO system to | 272 | * bio_set is used to allow other portions of the IO system to |
281 | * allocate their own private memory pools for bio and iovec structures. | 273 | * allocate their own private memory pools for bio and iovec structures. |
282 | * These memory pools in turn all allocate from the bio_slab | 274 | * These memory pools in turn all allocate from the bio_slab |
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 71fc53bb8f1c..4053cbd4490e 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -59,8 +59,6 @@ struct bio { | |||
59 | 59 | ||
60 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ | 60 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ |
61 | 61 | ||
62 | unsigned int bi_comp_cpu; /* completion CPU */ | ||
63 | |||
64 | atomic_t bi_cnt; /* pin count */ | 62 | atomic_t bi_cnt; /* pin count */ |
65 | 63 | ||
66 | struct bio_vec *bi_io_vec; /* the actual vec list */ | 64 | struct bio_vec *bi_io_vec; /* the actual vec list */ |
@@ -93,11 +91,10 @@ struct bio { | |||
93 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ | 91 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ |
94 | #define BIO_USER_MAPPED 6 /* contains user pages */ | 92 | #define BIO_USER_MAPPED 6 /* contains user pages */ |
95 | #define BIO_EOPNOTSUPP 7 /* not supported */ | 93 | #define BIO_EOPNOTSUPP 7 /* not supported */ |
96 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ | 94 | #define BIO_NULL_MAPPED 8 /* contains invalid user pages */ |
97 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ | 95 | #define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */ |
98 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ | 96 | #define BIO_QUIET 10 /* Make BIO Quiet */ |
99 | #define BIO_QUIET 11 /* Make BIO Quiet */ | 97 | #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ |
100 | #define BIO_MAPPED_INTEGRITY 12/* integrity metadata has been remapped */ | ||
101 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 98 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
102 | 99 | ||
103 | /* | 100 | /* |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7fbaa9103344..5267cd2f20dc 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -195,7 +195,7 @@ struct request_pm_state | |||
195 | #include <linux/elevator.h> | 195 | #include <linux/elevator.h> |
196 | 196 | ||
197 | typedef void (request_fn_proc) (struct request_queue *q); | 197 | typedef void (request_fn_proc) (struct request_queue *q); |
198 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 198 | typedef void (make_request_fn) (struct request_queue *q, struct bio *bio); |
199 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 199 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
200 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); | 200 | typedef void (unprep_rq_fn) (struct request_queue *, struct request *); |
201 | 201 | ||
@@ -680,6 +680,8 @@ extern int scsi_cmd_ioctl(struct request_queue *, struct gendisk *, fmode_t, | |||
680 | extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, | 680 | extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, |
681 | struct scsi_ioctl_command __user *); | 681 | struct scsi_ioctl_command __user *); |
682 | 682 | ||
683 | extern void blk_queue_bio(struct request_queue *q, struct bio *bio); | ||
684 | |||
683 | /* | 685 | /* |
684 | * A queue has just exitted congestion. Note this in the global counter of | 686 | * A queue has just exitted congestion. Note this in the global counter of |
685 | * congested queues, and wake up anyone who was waiting for requests to be | 687 | * congested queues, and wake up anyone who was waiting for requests to be |
@@ -863,16 +865,22 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int); | |||
863 | extern void blk_put_queue(struct request_queue *); | 865 | extern void blk_put_queue(struct request_queue *); |
864 | 866 | ||
865 | /* | 867 | /* |
866 | * Note: Code in between changing the blk_plug list/cb_list or element of such | 868 | * blk_plug permits building a queue of related requests by holding the I/O |
867 | * lists is preemptable, but such code can't do sleep (or be very careful), | 869 | * fragments for a short period. This allows merging of sequential requests |
868 | * otherwise data is corrupted. For details, please check schedule() where | 870 | * into single larger request. As the requests are moved from a per-task list to |
869 | * blk_schedule_flush_plug() is called. | 871 | * the device's request_queue in a batch, this results in improved scalability |
872 | * as the lock contention for request_queue lock is reduced. | ||
873 | * | ||
874 | * It is ok not to disable preemption when adding the request to the plug list | ||
875 | * or when attempting a merge, because blk_schedule_flush_list() will only flush | ||
876 | * the plug list when the task sleeps by itself. For details, please see | ||
877 | * schedule() where blk_schedule_flush_plug() is called. | ||
870 | */ | 878 | */ |
871 | struct blk_plug { | 879 | struct blk_plug { |
872 | unsigned long magic; | 880 | unsigned long magic; /* detect uninitialized use-cases */ |
873 | struct list_head list; | 881 | struct list_head list; /* requests */ |
874 | struct list_head cb_list; | 882 | struct list_head cb_list; /* md requires an unplug callback */ |
875 | unsigned int should_sort; | 883 | unsigned int should_sort; /* list to be sorted before flushing? */ |
876 | }; | 884 | }; |
877 | #define BLK_MAX_REQUEST_COUNT 16 | 885 | #define BLK_MAX_REQUEST_COUNT 16 |
878 | 886 | ||
@@ -1189,20 +1197,6 @@ static inline uint64_t rq_io_start_time_ns(struct request *req) | |||
1189 | } | 1197 | } |
1190 | #endif | 1198 | #endif |
1191 | 1199 | ||
1192 | #ifdef CONFIG_BLK_DEV_THROTTLING | ||
1193 | extern int blk_throtl_init(struct request_queue *q); | ||
1194 | extern void blk_throtl_exit(struct request_queue *q); | ||
1195 | extern int blk_throtl_bio(struct request_queue *q, struct bio **bio); | ||
1196 | #else /* CONFIG_BLK_DEV_THROTTLING */ | ||
1197 | static inline int blk_throtl_bio(struct request_queue *q, struct bio **bio) | ||
1198 | { | ||
1199 | return 0; | ||
1200 | } | ||
1201 | |||
1202 | static inline int blk_throtl_init(struct request_queue *q) { return 0; } | ||
1203 | static inline int blk_throtl_exit(struct request_queue *q) { return 0; } | ||
1204 | #endif /* CONFIG_BLK_DEV_THROTTLING */ | ||
1205 | |||
1206 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 1200 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
1207 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 1201 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
1208 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ | 1202 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index d800d5142184..1d0f7a2ff73b 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -38,6 +38,12 @@ struct elevator_ops | |||
38 | elevator_merged_fn *elevator_merged_fn; | 38 | elevator_merged_fn *elevator_merged_fn; |
39 | elevator_merge_req_fn *elevator_merge_req_fn; | 39 | elevator_merge_req_fn *elevator_merge_req_fn; |
40 | elevator_allow_merge_fn *elevator_allow_merge_fn; | 40 | elevator_allow_merge_fn *elevator_allow_merge_fn; |
41 | |||
42 | /* | ||
43 | * Used for both plugged list and elevator merging and in the | ||
44 | * former case called without queue_lock. Read comment on top of | ||
45 | * attempt_plug_merge() for details. | ||
46 | */ | ||
41 | elevator_bio_merged_fn *elevator_bio_merged_fn; | 47 | elevator_bio_merged_fn *elevator_bio_merged_fn; |
42 | 48 | ||
43 | elevator_dispatch_fn *elevator_dispatch_fn; | 49 | elevator_dispatch_fn *elevator_dispatch_fn; |
diff --git a/include/linux/loop.h b/include/linux/loop.h index 683d69890119..a06880689115 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -73,7 +73,6 @@ struct loop_device { | |||
73 | */ | 73 | */ |
74 | enum { | 74 | enum { |
75 | LO_FLAGS_READ_ONLY = 1, | 75 | LO_FLAGS_READ_ONLY = 1, |
76 | LO_FLAGS_USE_AOPS = 2, | ||
77 | LO_FLAGS_AUTOCLEAR = 4, | 76 | LO_FLAGS_AUTOCLEAR = 4, |
78 | }; | 77 | }; |
79 | 78 | ||