Lines Matching full:io

36 /* Moving GC - IO loop */
40 closure_type(io, struct moving_io, cl); in CLOSURE_CALLBACK()
42 kfree(io); in CLOSURE_CALLBACK()
47 closure_type(io, struct moving_io, cl); in CLOSURE_CALLBACK()
48 struct bio *bio = &io->bio.bio; in CLOSURE_CALLBACK()
52 if (io->op.replace_collision) in CLOSURE_CALLBACK()
53 trace_bcache_gc_copy_collision(&io->w->key); in CLOSURE_CALLBACK()
55 bch_keybuf_del(&io->op.c->moving_gc_keys, io->w); in CLOSURE_CALLBACK()
57 up(&io->op.c->moving_in_flight); in CLOSURE_CALLBACK()
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 closure_type(io, struct moving_io, cl); in CLOSURE_CALLBACK()
95 struct data_insert_op *op = &io->op; in CLOSURE_CALLBACK()
98 moving_init(io); in CLOSURE_CALLBACK()
100 io->bio.bio.bi_iter.bi_sector = KEY_START(&io->w->key); in CLOSURE_CALLBACK()
102 op->bio = &io->bio.bio; in CLOSURE_CALLBACK()
104 op->writeback = KEY_DIRTY(&io->w->key); in CLOSURE_CALLBACK()
105 op->csum = KEY_CSUM(&io->w->key); in CLOSURE_CALLBACK()
107 bkey_copy(&op->replace_key, &io->w->key); in CLOSURE_CALLBACK()
118 closure_type(io, struct moving_io, cl); in CLOSURE_CALLBACK()
119 struct bio *bio = &io->bio.bio; in CLOSURE_CALLBACK()
121 bch_submit_bbio(bio, io->op.c, &io->w->key, 0); in CLOSURE_CALLBACK()
123 continue_at(cl, write_moving, io->op.wq); in CLOSURE_CALLBACK()
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()