aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/elevator.c45
-rw-r--r--block/ll_rw_blk.c7
-rw-r--r--drivers/scsi/libata-scsi.c27
-rw-r--r--fs/bio.c1
-rw-r--r--include/linux/blkdev.h6
-rw-r--r--include/scsi/scsi_host.h1
6 files changed, 50 insertions, 37 deletions
diff --git a/block/elevator.c b/block/elevator.c
index c9f424d5399c..96a61e029ce5 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -139,35 +139,16 @@ static int elevator_attach(request_queue_t *q, struct elevator_type *e,
139 139
140static char chosen_elevator[16]; 140static char chosen_elevator[16];
141 141
142static void elevator_setup_default(void) 142static int __init elevator_setup(char *str)
143{ 143{
144 struct elevator_type *e;
145
146 /*
147 * If default has not been set, use the compiled-in selection.
148 */
149 if (!chosen_elevator[0])
150 strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED);
151
152 /* 144 /*
153 * Be backwards-compatible with previous kernels, so users 145 * Be backwards-compatible with previous kernels, so users
154 * won't get the wrong elevator. 146 * won't get the wrong elevator.
155 */ 147 */
156 if (!strcmp(chosen_elevator, "as")) 148 if (!strcmp(str, "as"))
157 strcpy(chosen_elevator, "anticipatory"); 149 strcpy(chosen_elevator, "anticipatory");
158
159 /*
160 * If the given scheduler is not available, fall back to the default
161 */
162 if ((e = elevator_find(chosen_elevator)))
163 elevator_put(e);
164 else 150 else
165 strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); 151 strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1);
166}
167
168static int __init elevator_setup(char *str)
169{
170 strncpy(chosen_elevator, str, sizeof(chosen_elevator) - 1);
171 return 0; 152 return 0;
172} 153}
173 154
@@ -184,14 +165,16 @@ int elevator_init(request_queue_t *q, char *name)
184 q->end_sector = 0; 165 q->end_sector = 0;
185 q->boundary_rq = NULL; 166 q->boundary_rq = NULL;
186 167
187 elevator_setup_default(); 168 if (name && !(e = elevator_get(name)))
169 return -EINVAL;
188 170
189 if (!name) 171 if (!e && *chosen_elevator && !(e = elevator_get(chosen_elevator)))
190 name = chosen_elevator; 172 printk("I/O scheduler %s not found\n", chosen_elevator);
191 173
192 e = elevator_get(name); 174 if (!e && !(e = elevator_get(CONFIG_DEFAULT_IOSCHED))) {
193 if (!e) 175 printk("Default I/O scheduler not found, using no-op\n");
194 return -EINVAL; 176 e = elevator_get("noop");
177 }
195 178
196 eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL); 179 eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL);
197 if (!eq) { 180 if (!eq) {
@@ -669,8 +652,10 @@ int elv_register(struct elevator_type *e)
669 spin_unlock_irq(&elv_list_lock); 652 spin_unlock_irq(&elv_list_lock);
670 653
671 printk(KERN_INFO "io scheduler %s registered", e->elevator_name); 654 printk(KERN_INFO "io scheduler %s registered", e->elevator_name);
672 if (!strcmp(e->elevator_name, chosen_elevator)) 655 if (!strcmp(e->elevator_name, chosen_elevator) ||
673 printk(" (default)"); 656 (!*chosen_elevator &&
657 !strcmp(e->elevator_name, CONFIG_DEFAULT_IOSCHED)))
658 printk(" (default)");
674 printk("\n"); 659 printk("\n");
675 return 0; 660 return 0;
676} 661}
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 8e27d0ab0d7c..d38b4afa37ef 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -304,6 +304,7 @@ static inline void rq_init(request_queue_t *q, struct request *rq)
304 * blk_queue_ordered - does this queue support ordered writes 304 * blk_queue_ordered - does this queue support ordered writes
305 * @q: the request queue 305 * @q: the request queue
306 * @ordered: one of QUEUE_ORDERED_* 306 * @ordered: one of QUEUE_ORDERED_*
307 * @prepare_flush_fn: rq setup helper for cache flush ordered writes
307 * 308 *
308 * Description: 309 * Description:
309 * For journalled file systems, doing ordered writes on a commit 310 * For journalled file systems, doing ordered writes on a commit
@@ -332,6 +333,7 @@ int blk_queue_ordered(request_queue_t *q, unsigned ordered,
332 return -EINVAL; 333 return -EINVAL;
333 } 334 }
334 335
336 q->ordered = ordered;
335 q->next_ordered = ordered; 337 q->next_ordered = ordered;
336 q->prepare_flush_fn = prepare_flush_fn; 338 q->prepare_flush_fn = prepare_flush_fn;
337 339
@@ -662,7 +664,7 @@ EXPORT_SYMBOL(blk_queue_bounce_limit);
662 * Enables a low level driver to set an upper limit on the size of 664 * Enables a low level driver to set an upper limit on the size of
663 * received requests. 665 * received requests.
664 **/ 666 **/
665void blk_queue_max_sectors(request_queue_t *q, unsigned short max_sectors) 667void blk_queue_max_sectors(request_queue_t *q, unsigned int max_sectors)
666{ 668{
667 if ((max_sectors << 9) < PAGE_CACHE_SIZE) { 669 if ((max_sectors << 9) < PAGE_CACHE_SIZE) {
668 max_sectors = 1 << (PAGE_CACHE_SHIFT - 9); 670 max_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
@@ -2632,6 +2634,7 @@ EXPORT_SYMBOL(blk_put_request);
2632/** 2634/**
2633 * blk_end_sync_rq - executes a completion event on a request 2635 * blk_end_sync_rq - executes a completion event on a request
2634 * @rq: request to complete 2636 * @rq: request to complete
2637 * @error: end io status of the request
2635 */ 2638 */
2636void blk_end_sync_rq(struct request *rq, int error) 2639void blk_end_sync_rq(struct request *rq, int error)
2637{ 2640{
@@ -3153,7 +3156,7 @@ static int __end_that_request_first(struct request *req, int uptodate,
3153 if (blk_fs_request(req) && req->rq_disk) { 3156 if (blk_fs_request(req) && req->rq_disk) {
3154 const int rw = rq_data_dir(req); 3157 const int rw = rq_data_dir(req);
3155 3158
3156 __disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9); 3159 disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9);
3157 } 3160 }
3158 3161
3159 total_bytes = bio_nbytes = 0; 3162 total_bytes = bio_nbytes = 0;
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index cfbceb504718..07b1e7cc61df 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -1700,6 +1700,31 @@ static unsigned int ata_msense_rw_recovery(u8 **ptr_io, const u8 *last)
1700 return sizeof(def_rw_recovery_mpage); 1700 return sizeof(def_rw_recovery_mpage);
1701} 1701}
1702 1702
1703/*
1704 * We can turn this into a real blacklist if it's needed, for now just
1705 * blacklist any Maxtor BANC1G10 revision firmware
1706 */
1707static int ata_dev_supports_fua(u16 *id)
1708{
1709 unsigned char model[41], fw[9];
1710
1711 if (!ata_id_has_fua(id))
1712 return 0;
1713
1714 model[40] = '\0';
1715 fw[8] = '\0';
1716
1717 ata_dev_id_string(id, model, ATA_ID_PROD_OFS, sizeof(model) - 1);
1718 ata_dev_id_string(id, fw, ATA_ID_FW_REV_OFS, sizeof(fw) - 1);
1719
1720 if (strncmp(model, "Maxtor", 6))
1721 return 1;
1722 if (strncmp(fw, "BANC1G10", 8))
1723 return 1;
1724
1725 return 0; /* blacklisted */
1726}
1727
1703/** 1728/**
1704 * ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands 1729 * ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands
1705 * @args: device IDENTIFY data / SCSI command of interest. 1730 * @args: device IDENTIFY data / SCSI command of interest.
@@ -1797,7 +1822,7 @@ unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf,
1797 return 0; 1822 return 0;
1798 1823
1799 dpofua = 0; 1824 dpofua = 0;
1800 if (ata_id_has_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 && 1825 if (ata_dev_supports_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 &&
1801 (!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count)) 1826 (!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count))
1802 dpofua = 1 << 4; 1827 dpofua = 1 << 4;
1803 1828
diff --git a/fs/bio.c b/fs/bio.c
index bbc442b8c867..1f3bb501c262 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -411,6 +411,7 @@ static int __bio_add_page(request_queue_t *q, struct bio *bio, struct page
411 411
412/** 412/**
413 * bio_add_pc_page - attempt to add page to bio 413 * bio_add_pc_page - attempt to add page to bio
414 * @q: the target queue
414 * @bio: destination bio 415 * @bio: destination bio
415 * @page: page to add 416 * @page: page to add
416 * @len: vec entry length 417 * @len: vec entry length
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 02a585faa62c..860e7a485a5f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -392,8 +392,8 @@ struct request_queue
392 unsigned int nr_congestion_off; 392 unsigned int nr_congestion_off;
393 unsigned int nr_batching; 393 unsigned int nr_batching;
394 394
395 unsigned short max_sectors; 395 unsigned int max_sectors;
396 unsigned short max_hw_sectors; 396 unsigned int max_hw_sectors;
397 unsigned short max_phys_segments; 397 unsigned short max_phys_segments;
398 unsigned short max_hw_segments; 398 unsigned short max_hw_segments;
399 unsigned short hardsect_size; 399 unsigned short hardsect_size;
@@ -697,7 +697,7 @@ extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *);
697extern void blk_cleanup_queue(request_queue_t *); 697extern void blk_cleanup_queue(request_queue_t *);
698extern void blk_queue_make_request(request_queue_t *, make_request_fn *); 698extern void blk_queue_make_request(request_queue_t *, make_request_fn *);
699extern void blk_queue_bounce_limit(request_queue_t *, u64); 699extern void blk_queue_bounce_limit(request_queue_t *, u64);
700extern void blk_queue_max_sectors(request_queue_t *, unsigned short); 700extern void blk_queue_max_sectors(request_queue_t *, unsigned int);
701extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short); 701extern void blk_queue_max_phys_segments(request_queue_t *, unsigned short);
702extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short); 702extern void blk_queue_max_hw_segments(request_queue_t *, unsigned short);
703extern void blk_queue_max_segment_size(request_queue_t *, unsigned int); 703extern void blk_queue_max_segment_size(request_queue_t *, unsigned int);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 467274a764d1..827992949c4b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -554,7 +554,6 @@ struct Scsi_Host {
554 /* 554 /*
555 * ordered write support 555 * ordered write support
556 */ 556 */
557 unsigned ordered_flush:1;
558 unsigned ordered_tag:1; 557 unsigned ordered_tag:1;
559 558
560 /* 559 /*