Lines Matching refs:io

40 	struct moving_io *io = container_of(cl, struct moving_io, cl);  in moving_io_destructor()  local
42 kfree(io); in moving_io_destructor()
47 struct moving_io *io = container_of(cl, struct moving_io, cl); in write_moving_finish() local
48 struct bio *bio = &io->bio.bio; in write_moving_finish()
52 if (io->op.replace_collision) in write_moving_finish()
53 trace_bcache_gc_copy_collision(&io->w->key); in write_moving_finish()
55 bch_keybuf_del(&io->op.c->moving_gc_keys, io->w); in write_moving_finish()
57 up(&io->op.c->moving_in_flight); in write_moving_finish()
65 struct moving_io *io = container_of(bio->bi_private, in read_moving_endio() local
69 io->op.status = bio->bi_status; in read_moving_endio()
71 ptr_stale(io->op.c, &b->key, 0)) { in read_moving_endio()
72 io->op.status = BLK_STS_IOERR; in read_moving_endio()
75 bch_bbio_endio(io->op.c, bio, bio->bi_status, "reading data to move"); in read_moving_endio()
78 static void moving_init(struct moving_io *io) in moving_init() argument
80 struct bio *bio = &io->bio.bio; in moving_init()
83 DIV_ROUND_UP(KEY_SIZE(&io->w->key), PAGE_SECTORS), 0); in moving_init()
87 bio->bi_iter.bi_size = KEY_SIZE(&io->w->key) << 9; in moving_init()
88 bio->bi_private = &io->cl; in moving_init()
94 struct moving_io *io = container_of(cl, struct moving_io, cl); in write_moving() local
95 struct data_insert_op *op = &io->op; in write_moving()
98 moving_init(io); in write_moving()
100 io->bio.bio.bi_iter.bi_sector = KEY_START(&io->w->key); in write_moving()
102 op->bio = &io->bio.bio; in write_moving()
104 op->writeback = KEY_DIRTY(&io->w->key); in write_moving()
105 op->csum = KEY_CSUM(&io->w->key); in write_moving()
107 bkey_copy(&op->replace_key, &io->w->key); in write_moving()
118 struct moving_io *io = container_of(cl, struct moving_io, cl); in read_moving_submit() local
119 struct bio *bio = &io->bio.bio; in read_moving_submit()
121 bch_submit_bbio(bio, io->op.c, &io->w->key, 0); in read_moving_submit()
123 continue_at(cl, write_moving, io->op.wq); in read_moving_submit()
129 struct moving_io *io; in read_moving() local
148 io = kzalloc(struct_size(io, bio.bio.bi_inline_vecs, in read_moving()
151 if (!io) in read_moving()
154 w->private = io; in read_moving()
155 io->w = w; in read_moving()
156 io->op.inode = KEY_INODE(&w->key); in read_moving()
157 io->op.c = c; in read_moving()
158 io->op.wq = c->moving_gc_wq; in read_moving()
160 moving_init(io); in read_moving()
161 bio = &io->bio.bio; in read_moving()
172 closure_call(&io->cl, read_moving_submit, NULL, &cl); in read_moving()