writeback.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) | writeback.c (3a83f4677539bce8eaa2bca9ee9c20e172d7ab04) |
---|---|
1/* 2 * background writeback - scan btree for dirty data and write it to the backing 3 * device 4 * 5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> 6 * Copyright 2012 Google, Inc. 7 */ 8 --- 92 unchanged lines hidden (view full) --- 101 struct bio bio; 102}; 103 104static void dirty_init(struct keybuf_key *w) 105{ 106 struct dirty_io *io = w->private; 107 struct bio *bio = &io->bio; 108 | 1/* 2 * background writeback - scan btree for dirty data and write it to the backing 3 * device 4 * 5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> 6 * Copyright 2012 Google, Inc. 7 */ 8 --- 92 unchanged lines hidden (view full) --- 101 struct bio bio; 102}; 103 104static void dirty_init(struct keybuf_key *w) 105{ 106 struct dirty_io *io = w->private; 107 struct bio *bio = &io->bio; 108 |
109 bio_init(bio); | 109 bio_init(bio, bio->bi_inline_vecs, 110 DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS)); |
110 if (!io->dc->writeback_percent) 111 bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); 112 113 bio->bi_iter.bi_size = KEY_SIZE(&w->key) << 9; | 111 if (!io->dc->writeback_percent) 112 bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); 113 114 bio->bi_iter.bi_size = KEY_SIZE(&w->key) << 9; |
114 bio->bi_max_vecs = DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS); | |
115 bio->bi_private = w; | 115 bio->bi_private = w; |
116 bio->bi_io_vec = bio->bi_inline_vecs; | |
117 bch_bio_map(bio, NULL); 118} 119 120static void dirty_io_destructor(struct closure *cl) 121{ 122 struct dirty_io *io = container_of(cl, struct dirty_io, cl); 123 kfree(io); 124} --- 406 unchanged lines hidden --- | 116 bch_bio_map(bio, NULL); 117} 118 119static void dirty_io_destructor(struct closure *cl) 120{ 121 struct dirty_io *io = container_of(cl, struct dirty_io, cl); 122 kfree(io); 123} --- 406 unchanged lines hidden --- |