Skip to content

Commit e26feff

Browse files
committed
Merge branch 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block: (132 commits) doc/cdrom: Trvial documentation error, file not present block_dev: fix kernel-doc in new functions block: add some comments around the bio read-write flags block: mark bio_split_pool static block: Find bio sector offset given idx and offset block: gendisk integrity wrapper block: Switch blk_integrity_compare from bdev to gendisk block: Fix double put in blk_integrity_unregister block: Introduce integrity data ownership flag block: revert part of d7533ad0e132f92e75c1b2eb7c26387b25a583c1 bio.h: Remove unused conditional code block: remove end_{queued|dequeued}_request() block: change elevator to use __blk_end_request() gdrom: change to use __blk_end_request() memstick: change to use __blk_end_request() virtio_blk: change to use __blk_end_request() blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure block: add lld busy state exporting interface block: Fix blk_start_queueing() to not kick a stopped queue include blktrace_api.h in headers_install ...
2 parents d403a64 + b911e47 commit e26feff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+3838
-2637
lines changed

Documentation/DMA-API.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ With scatterlists, you use the resulting mapping like this:
337337
int i, count = dma_map_sg(dev, sglist, nents, direction);
338338
struct scatterlist *sg;
339339

340-
for (i = 0, sg = sglist; i < count; i++, sg++) {
340+
for_each_sg(sglist, sg, count, i) {
341341
hw_address[i] = sg_dma_address(sg);
342342
hw_len[i] = sg_dma_len(sg);
343343
}

Documentation/DocBook/kernel-api.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ X!Edrivers/pnp/system.c
364364
!Eblock/blk-barrier.c
365365
!Eblock/blk-tag.c
366366
!Iblock/blk-tag.c
367+
!Eblock/blk-integrity.c
368+
!Iblock/blktrace.c
369+
!Iblock/genhd.c
370+
!Eblock/genhd.c
367371
</chapter>
368372

369373
<chapter id="chrdev">

Documentation/block/deadline-iosched.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@ write_expire (in ms)
3030
Similar to read_expire mentioned above, but for writes.
3131

3232

33-
fifo_batch
33+
fifo_batch (number of requests)
3434
----------
3535

36-
When a read request expires its deadline, we must move some requests from
37-
the sorted io scheduler list to the block device dispatch queue. fifo_batch
38-
controls how many requests we move.
36+
Requests are grouped into ``batches'' of a particular data direction (read or
37+
write) which are serviced in increasing sector order. To limit extra seeking,
38+
deadline expiries are only checked between batches. fifo_batch controls the
39+
maximum number of requests per batch.
40+
41+
This parameter tunes the balance between per-request latency and aggregate
42+
throughput. When low latency is the primary concern, smaller is better (where
43+
a value of 1 yields first-come first-served behaviour). Increasing fifo_batch
44+
generally improves throughput, at the cost of latency variation.
3945

4046

4147
writes_starved (number of dispatches)

Documentation/cdrom/ide-cd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ useful for reading photocds.
145145

146146
To play an audio CD, you should first unmount and remove any data
147147
CDROM. Any of the CDROM player programs should then work (workman,
148-
workbone, cdplayer, etc.). Lacking anything else, you could use the
149-
cdtester program in Documentation/cdrom/sbpcd.
148+
workbone, cdplayer, etc.).
150149

151150
On a few drives, you can read digital audio directly using a program
152151
such as cdda2wav. The only types of drive which I've heard support

block/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \
66
blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \
7-
blk-exec.o blk-merge.o ioctl.o genhd.o scsi_ioctl.o \
8-
cmd-filter.o
7+
blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
8+
ioctl.o genhd.o scsi_ioctl.o cmd-filter.o
99

1010
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
1111
obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o

block/as-iosched.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ static void as_antic_stop(struct as_data *ad)
462462
del_timer(&ad->antic_timer);
463463
ad->antic_status = ANTIC_FINISHED;
464464
/* see as_work_handler */
465-
kblockd_schedule_work(&ad->antic_work);
465+
kblockd_schedule_work(ad->q, &ad->antic_work);
466466
}
467467
}
468468

@@ -483,7 +483,7 @@ static void as_antic_timeout(unsigned long data)
483483
aic = ad->io_context->aic;
484484

485485
ad->antic_status = ANTIC_FINISHED;
486-
kblockd_schedule_work(&ad->antic_work);
486+
kblockd_schedule_work(q, &ad->antic_work);
487487

488488
if (aic->ttime_samples == 0) {
489489
/* process anticipated on has exited or timed out*/
@@ -745,6 +745,14 @@ static int as_can_break_anticipation(struct as_data *ad, struct request *rq)
745745
*/
746746
static int as_can_anticipate(struct as_data *ad, struct request *rq)
747747
{
748+
#if 0 /* disable for now, we need to check tag level as well */
749+
/*
750+
* SSD device without seek penalty, disable idling
751+
*/
752+
if (blk_queue_nonrot(ad->q)) axman
753+
return 0;
754+
#endif
755+
748756
if (!ad->io_context)
749757
/*
750758
* Last request submitted was a write
@@ -844,7 +852,7 @@ static void as_completed_request(struct request_queue *q, struct request *rq)
844852
if (ad->changed_batch && ad->nr_dispatched == 1) {
845853
ad->current_batch_expires = jiffies +
846854
ad->batch_expire[ad->batch_data_dir];
847-
kblockd_schedule_work(&ad->antic_work);
855+
kblockd_schedule_work(q, &ad->antic_work);
848856
ad->changed_batch = 0;
849857

850858
if (ad->batch_data_dir == REQ_SYNC)

block/blk-barrier.c

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
293293
bio->bi_end_io = bio_end_empty_barrier;
294294
bio->bi_private = &wait;
295295
bio->bi_bdev = bdev;
296-
submit_bio(1 << BIO_RW_BARRIER, bio);
296+
submit_bio(WRITE_BARRIER, bio);
297297

298298
wait_for_completion(&wait);
299299

@@ -315,3 +315,73 @@ int blkdev_issue_flush(struct block_device *bdev, sector_t *error_sector)
315315
return ret;
316316
}
317317
EXPORT_SYMBOL(blkdev_issue_flush);
318+
319+
static void blkdev_discard_end_io(struct bio *bio, int err)
320+
{
321+
if (err) {
322+
if (err == -EOPNOTSUPP)
323+
set_bit(BIO_EOPNOTSUPP, &bio->bi_flags);
324+
clear_bit(BIO_UPTODATE, &bio->bi_flags);
325+
}
326+
327+
bio_put(bio);
328+
}
329+
330+
/**
331+
* blkdev_issue_discard - queue a discard
332+
* @bdev: blockdev to issue discard for
333+
* @sector: start sector
334+
* @nr_sects: number of sectors to discard
335+
* @gfp_mask: memory allocation flags (for bio_alloc)
336+
*
337+
* Description:
338+
* Issue a discard request for the sectors in question. Does not wait.
339+
*/
340+
int blkdev_issue_discard(struct block_device *bdev,
341+
sector_t sector, sector_t nr_sects, gfp_t gfp_mask)
342+
{
343+
struct request_queue *q;
344+
struct bio *bio;
345+
int ret = 0;
346+
347+
if (bdev->bd_disk == NULL)
348+
return -ENXIO;
349+
350+
q = bdev_get_queue(bdev);
351+
if (!q)
352+
return -ENXIO;
353+
354+
if (!q->prepare_discard_fn)
355+
return -EOPNOTSUPP;
356+
357+
while (nr_sects && !ret) {
358+
bio = bio_alloc(gfp_mask, 0);
359+
if (!bio)
360+
return -ENOMEM;
361+
362+
bio->bi_end_io = blkdev_discard_end_io;
363+
bio->bi_bdev = bdev;
364+
365+
bio->bi_sector = sector;
366+
367+
if (nr_sects > q->max_hw_sectors) {
368+
bio->bi_size = q->max_hw_sectors << 9;
369+
nr_sects -= q->max_hw_sectors;
370+
sector += q->max_hw_sectors;
371+
} else {
372+
bio->bi_size = nr_sects << 9;
373+
nr_sects = 0;
374+
}
375+
bio_get(bio);
376+
submit_bio(DISCARD_BARRIER, bio);
377+
378+
/* Check if it failed immediately */
379+
if (bio_flagged(bio, BIO_EOPNOTSUPP))
380+
ret = -EOPNOTSUPP;
381+
else if (!bio_flagged(bio, BIO_UPTODATE))
382+
ret = -EIO;
383+
bio_put(bio);
384+
}
385+
return ret;
386+
}
387+
EXPORT_SYMBOL(blkdev_issue_discard);

0 commit comments

Comments
 (0)