bcache: Use standard utility code
Some of bcache's utility code has made it into the rest of the kernel, so drop the bcache versions. Bcache used to have a workaround for allocating from a bio set under generic_make_request() (if you allocated more than once, the bios you already allocated would get stuck on current->bio_list when you submitted, and you'd risk deadlock) - bcache would mask out __GFP_WAIT when allocating bios under generic_make_request() so that allocation could fail and it could retry from workqueue. But bio_alloc_bioset() has a workaround now, so we can drop this hack and the associated error handling. Signed-off-by: Kent Overstreet <koverstreet@google.com>
This commit is contained in:

committed by
Kent Overstreet

parent
47cd2eb0ee
commit
8e51e414a3
@@ -46,9 +46,10 @@ static void write_moving_finish(struct closure *cl)
|
||||
{
|
||||
struct moving_io *io = container_of(cl, struct moving_io, s.cl);
|
||||
struct bio *bio = &io->bio.bio;
|
||||
struct bio_vec *bv = bio_iovec_idx(bio, bio->bi_vcnt);
|
||||
struct bio_vec *bv;
|
||||
int i;
|
||||
|
||||
while (bv-- != bio->bi_io_vec)
|
||||
bio_for_each_segment_all(bv, bio, i)
|
||||
__free_page(bv->bv_page);
|
||||
|
||||
if (io->s.op.insert_collision)
|
||||
@@ -158,7 +159,7 @@ static void read_moving(struct closure *cl)
|
||||
bio->bi_rw = READ;
|
||||
bio->bi_end_io = read_moving_endio;
|
||||
|
||||
if (bch_bio_alloc_pages(bio, GFP_KERNEL))
|
||||
if (bio_alloc_pages(bio, GFP_KERNEL))
|
||||
goto err;
|
||||
|
||||
trace_bcache_gc_copy(&w->key);
|
||||
|
Reference in New Issue
Block a user