Loading block/blk-core.c +29 −4 Original line number Diff line number Diff line Loading @@ -2222,8 +2222,20 @@ blk_qc_t generic_make_request(struct bio *bio) * yet. */ struct bio_list bio_list_on_stack[2]; bool flags = 0; struct request_queue *q = bio->bi_disk->queue; blk_qc_t ret = BLK_QC_T_NONE; if (bio->bi_opf & REQ_NOWAIT) flags = BLK_MQ_REQ_NOWAIT; if (blk_queue_enter(q, flags) < 0) { if (!blk_queue_dying(q) && (bio->bi_opf & REQ_NOWAIT)) bio_wouldblock_error(bio); else bio_io_error(bio); return ret; } if (!generic_make_request_checks(bio)) goto out; Loading Loading @@ -2260,9 +2272,22 @@ blk_qc_t generic_make_request(struct bio *bio) bio_list_init(&bio_list_on_stack[0]); current->bio_list = bio_list_on_stack; do { struct request_queue *q = bio->bi_disk->queue; bool enter_succeeded = true; if (likely(blk_queue_enter(q, bio->bi_opf & REQ_NOWAIT) == 0)) { if (unlikely(q != bio->bi_disk->queue)) { if (q) blk_queue_exit(q); q = bio->bi_disk->queue; flags = 0; if (bio->bi_opf & REQ_NOWAIT) flags = BLK_MQ_REQ_NOWAIT; if (blk_queue_enter(q, flags) < 0) { enter_succeeded = false; q = NULL; } } if (enter_succeeded) { struct bio_list lower, same; /* Create a fresh bio_list for all subordinate requests */ Loading @@ -2270,8 +2295,6 @@ blk_qc_t generic_make_request(struct bio *bio) bio_list_init(&bio_list_on_stack[0]); ret = q->make_request_fn(q, bio); blk_queue_exit(q); /* sort new bios into those for a lower level * and those for the same level */ Loading @@ -2298,6 +2321,8 @@ blk_qc_t generic_make_request(struct bio *bio) current->bio_list = NULL; /* deactivate */ out: if (q) blk_queue_exit(q); return ret; } EXPORT_SYMBOL(generic_make_request); Loading Loading
block/blk-core.c +29 −4 Original line number Diff line number Diff line Loading @@ -2222,8 +2222,20 @@ blk_qc_t generic_make_request(struct bio *bio) * yet. */ struct bio_list bio_list_on_stack[2]; bool flags = 0; struct request_queue *q = bio->bi_disk->queue; blk_qc_t ret = BLK_QC_T_NONE; if (bio->bi_opf & REQ_NOWAIT) flags = BLK_MQ_REQ_NOWAIT; if (blk_queue_enter(q, flags) < 0) { if (!blk_queue_dying(q) && (bio->bi_opf & REQ_NOWAIT)) bio_wouldblock_error(bio); else bio_io_error(bio); return ret; } if (!generic_make_request_checks(bio)) goto out; Loading Loading @@ -2260,9 +2272,22 @@ blk_qc_t generic_make_request(struct bio *bio) bio_list_init(&bio_list_on_stack[0]); current->bio_list = bio_list_on_stack; do { struct request_queue *q = bio->bi_disk->queue; bool enter_succeeded = true; if (likely(blk_queue_enter(q, bio->bi_opf & REQ_NOWAIT) == 0)) { if (unlikely(q != bio->bi_disk->queue)) { if (q) blk_queue_exit(q); q = bio->bi_disk->queue; flags = 0; if (bio->bi_opf & REQ_NOWAIT) flags = BLK_MQ_REQ_NOWAIT; if (blk_queue_enter(q, flags) < 0) { enter_succeeded = false; q = NULL; } } if (enter_succeeded) { struct bio_list lower, same; /* Create a fresh bio_list for all subordinate requests */ Loading @@ -2270,8 +2295,6 @@ blk_qc_t generic_make_request(struct bio *bio) bio_list_init(&bio_list_on_stack[0]); ret = q->make_request_fn(q, bio); blk_queue_exit(q); /* sort new bios into those for a lower level * and those for the same level */ Loading @@ -2298,6 +2321,8 @@ blk_qc_t generic_make_request(struct bio *bio) current->bio_list = NULL; /* deactivate */ out: if (q) blk_queue_exit(q); return ret; } EXPORT_SYMBOL(generic_make_request); Loading