Allow elevators to sort/merge discard requests

But blkdev_issue_discard() still emits requests which are interpreted as
soft barriers, because naïve callers might otherwise issue subsequent
writes to those same sectors, which might cross on the queue (if they're
reallocated quickly enough).

Callers still _can_ issue non-barrier discard requests, but they have to
take care of queue ordering for themselves.

Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
David Woodhouse 2008-08-09 16:42:20 +01:00 • committed by Jens Axboe
commit e17fc0a1cc
8 changed files with 42 additions and 23 deletions

View file

@ -161,7 +161,7 @@ static int blk_ioctl_discard(struct block_device *bdev, uint64_t start,
bio->bi_size = len << 9;
len = 0;
}
submit_bio(WRITE_DISCARD, bio);
submit_bio(DISCARD_NOBARRIER, bio);
wait_for_completion(&wait);