Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123287
b: refs/heads/master
c: a738467
h: refs/heads/master
i:
  123285: 8b0dab2
  123283: 483ca70
  123279: f9d43cd
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Dec 29, 2008
1 parent 190d79a commit 43b5b18
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 313e42999dbc0f234ca5909a236f78f082cb43b1
refs/heads/master: a7384677b2f4cd40948fd7ce024ba5e1821444ba
4 changes: 2 additions & 2 deletions trunk/block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ int blk_do_ordered(struct request_queue *q, struct request **rqp)
return 1;
} else {
/*
* This can happen when the queue switches to
* ORDERED_NONE while this request is on it.
* Queue ordering not supported. Terminate
* with prejudice.
*/
elv_dequeue_request(q, rq);
if (__blk_end_request(rq, -EOPNOTSUPP,
Expand Down
44 changes: 11 additions & 33 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ void init_request_from_bio(struct request *req, struct bio *bio)
static int __make_request(struct request_queue *q, struct bio *bio)
{
struct request *req;
int el_ret, nr_sectors, barrier, discard, err;
int el_ret, nr_sectors;
const unsigned short prio = bio_prio(bio);
const int sync = bio_sync(bio);
int rw_flags;
Expand All @@ -1153,22 +1153,9 @@ static int __make_request(struct request_queue *q, struct bio *bio)
*/
blk_queue_bounce(q, &bio);

barrier = bio_barrier(bio);
if (unlikely(barrier) && bio_has_data(bio) &&
(q->next_ordered == QUEUE_ORDERED_NONE)) {
err = -EOPNOTSUPP;
goto end_io;
}

discard = bio_discard(bio);
if (unlikely(discard) && !q->prepare_discard_fn) {
err = -EOPNOTSUPP;
goto end_io;
}

spin_lock_irq(q->queue_lock);

if (unlikely(barrier) || elv_queue_empty(q))
if (unlikely(bio_barrier(bio)) || elv_queue_empty(q))
goto get_rq;

el_ret = elv_merge(q, &req, bio);
Expand Down Expand Up @@ -1262,10 +1249,6 @@ static int __make_request(struct request_queue *q, struct bio *bio)
__generic_unplug_device(q);
spin_unlock_irq(q->queue_lock);
return 0;

end_io:
bio_endio(bio, err);
return 0;
}

/*
Expand Down Expand Up @@ -1418,15 +1401,13 @@ static inline void __generic_make_request(struct bio *bio)
char b[BDEVNAME_SIZE];

q = bdev_get_queue(bio->bi_bdev);
if (!q) {
if (unlikely(!q)) {
printk(KERN_ERR
"generic_make_request: Trying to access "
"nonexistent block-device %s (%Lu)\n",
bdevname(bio->bi_bdev, b),
(long long) bio->bi_sector);
end_io:
bio_endio(bio, err);
break;
goto end_io;
}

if (unlikely(nr_sectors > q->max_hw_sectors)) {
Expand Down Expand Up @@ -1463,14 +1444,19 @@ static inline void __generic_make_request(struct bio *bio)

if (bio_check_eod(bio, nr_sectors))
goto end_io;
if ((bio_empty_barrier(bio) && !q->prepare_flush_fn) ||
(bio_discard(bio) && !q->prepare_discard_fn)) {

if (bio_discard(bio) && !q->prepare_discard_fn) {
err = -EOPNOTSUPP;
goto end_io;
}

ret = q->make_request_fn(q, bio);
} while (ret);

return;

end_io:
bio_endio(bio, err);
}

/*
Expand Down Expand Up @@ -1720,14 +1706,6 @@ static int __end_that_request_first(struct request *req, int error,
while ((bio = req->bio) != NULL) {
int nbytes;

/*
* For an empty barrier request, the low level driver must
* store a potential error location in ->sector. We pass
* that back up in ->bi_sector.
*/
if (blk_empty_barrier(req))
bio->bi_sector = req->sector;

if (nr_bytes >= bio->bi_size) {
req->bio = bio->bi_next;
nbytes = bio->bi_size;
Expand Down

0 comments on commit 43b5b18

Please sign in to comment.