aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/movinggc.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-06-06 21:15:57 -0400
committerKent Overstreet <kmo@daterainc.com>2013-07-01 17:43:53 -0400
commit8e51e414a3c6d92ef2cc41720c67342a8e2c0bf7 (patch)
tree3155648dff173925a882ee182cd188e246ce9498 /drivers/md/bcache/movinggc.c
parent47cd2eb0ee05d9b1f8acd4808a1c829d63e93ac1 (diff)
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>
Diffstat (limited to 'drivers/md/bcache/movinggc.c')
-rw-r--r--drivers/md/bcache/movinggc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c
index a241e9fd4f7f..1a3b4f4786c3 100644
--- a/drivers/md/bcache/movinggc.c
+++ b/drivers/md/bcache/movinggc.c
@@ -46,9 +46,10 @@ static void write_moving_finish(struct closure *cl)
46{ 46{
47 struct moving_io *io = container_of(cl, struct moving_io, s.cl); 47 struct moving_io *io = container_of(cl, struct moving_io, s.cl);
48 struct bio *bio = &io->bio.bio; 48 struct bio *bio = &io->bio.bio;
49 struct bio_vec *bv = bio_iovec_idx(bio, bio->bi_vcnt); 49 struct bio_vec *bv;
50 int i;
50 51
51 while (bv-- != bio->bi_io_vec) 52 bio_for_each_segment_all(bv, bio, i)
52 __free_page(bv->bv_page); 53 __free_page(bv->bv_page);
53 54
54 if (io->s.op.insert_collision) 55 if (io->s.op.insert_collision)
@@ -158,7 +159,7 @@ static void read_moving(struct closure *cl)
158 bio->bi_rw = READ; 159 bio->bi_rw = READ;
159 bio->bi_end_io = read_moving_endio; 160 bio->bi_end_io = read_moving_endio;
160 161
161 if (bch_bio_alloc_pages(bio, GFP_KERNEL)) 162 if (bio_alloc_pages(bio, GFP_KERNEL))
162 goto err; 163 goto err;
163 164
164 trace_bcache_gc_copy(&w->key); 165 trace_bcache_gc_copy(&w->key);