Lines Matching refs:iop

484 	struct data_insert_op	iop;  member
501 s->iop.status = bio->bi_status; in bch_cache_read_endio()
503 ptr_stale(s->iop.c, &b->key, 0)) { in bch_cache_read_endio()
504 atomic_long_inc(&s->iop.c->cache_read_races); in bch_cache_read_endio()
505 s->iop.status = BLK_STS_IOERR; in bch_cache_read_endio()
508 bch_bbio_endio(s->iop.c, bio, bio->bi_status, "reading from cache"); in bch_cache_read_endio()
522 if (bkey_cmp(k, &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0)) <= 0) in cache_lookup_fn()
525 if (KEY_INODE(k) != s->iop.inode || in cache_lookup_fn()
528 unsigned int sectors = KEY_INODE(k) == s->iop.inode in cache_lookup_fn()
559 bch_cut_front(&KEY(s->iop.inode, n->bi_iter.bi_sector, 0), bio_key); in cache_lookup_fn()
560 bch_cut_back(&KEY(s->iop.inode, bio_end_sector(n), 0), bio_key); in cache_lookup_fn()
582 struct search *s = container_of(cl, struct search, iop.cl); in cache_lookup()
589 ret = bch_btree_map_keys(&s->op, s->iop.c, in cache_lookup()
590 &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0), in cache_lookup()
614 if (!s->iop.status) in cache_lookup()
615 s->iop.status = BLK_STS_IOERR; in cache_lookup()
630 s->iop.status = bio->bi_status; in request_endio()
654 if (unlikely(s->iop.writeback && in backing_request_endio()
660 s->iop.status = bio->bi_status; in backing_request_endio()
678 s->orig_bio->bi_status = s->iop.status; in bio_complete()
710 if (s->iop.bio) in search_free()
711 bio_put(s->iop.bio); in search_free()
738 s->iop.c = d->c; in search_alloc()
739 s->iop.bio = NULL; in search_alloc()
740 s->iop.inode = d->id; in search_alloc()
741 s->iop.write_point = hash_long((unsigned long) current, 16); in search_alloc()
742 s->iop.write_prio = 0; in search_alloc()
743 s->iop.status = 0; in search_alloc()
744 s->iop.flags = 0; in search_alloc()
745 s->iop.flush_journal = op_is_flush(bio->bi_opf); in search_alloc()
746 s->iop.wq = bcache_wq; in search_alloc()
768 if (s->iop.replace_collision) in cached_dev_cache_miss_done()
769 bch_mark_cache_miss_collision(s->iop.c, s->d); in cached_dev_cache_miss_done()
771 if (s->iop.bio) in cached_dev_cache_miss_done()
772 bio_free_pages(s->iop.bio); in cached_dev_cache_miss_done()
793 s->iop.status = 0; in cached_dev_read_error()
799 closure_bio_submit(s->iop.c, bio, cl); in cached_dev_read_error()
818 if (s->iop.bio) { in cached_dev_read_done()
819 bio_reset(s->iop.bio); in cached_dev_read_done()
820 s->iop.bio->bi_iter.bi_sector = in cached_dev_read_done()
822 bio_copy_dev(s->iop.bio, s->cache_miss); in cached_dev_read_done()
823 s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9; in cached_dev_read_done()
824 bch_bio_map(s->iop.bio, NULL); in cached_dev_read_done()
826 bio_copy_data(s->cache_miss, s->iop.bio); in cached_dev_read_done()
837 if (s->iop.bio && in cached_dev_read_done()
838 !test_bit(CACHE_SET_STOPPING, &s->iop.c->flags)) { in cached_dev_read_done()
839 BUG_ON(!s->iop.replace); in cached_dev_read_done()
840 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_read_done()
851 bch_mark_cache_accounting(s->iop.c, s->d, in cached_dev_read_done_bh()
852 !s->cache_missed, s->iop.bypass); in cached_dev_read_done_bh()
853 trace_bcache_read(s->orig_bio, !s->cache_miss, s->iop.bypass); in cached_dev_read_done_bh()
855 if (s->iop.status) in cached_dev_read_done_bh()
857 else if (s->iop.bio || verify(dc)) in cached_dev_read_done_bh()
873 if (s->cache_miss || s->iop.bypass) { in cached_dev_cache_miss()
881 s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA) in cached_dev_cache_miss()
887 s->iop.replace_key = KEY(s->iop.inode, in cached_dev_cache_miss()
891 ret = bch_btree_insert_check_key(b, &s->op, &s->iop.replace_key); in cached_dev_cache_miss()
895 s->iop.replace = true; in cached_dev_cache_miss()
920 bch_mark_cache_readahead(s->iop.c, s->d); in cached_dev_cache_miss()
923 s->iop.bio = cache_bio; in cached_dev_cache_miss()
926 closure_bio_submit(s->iop.c, cache_bio, &s->cl); in cached_dev_cache_miss()
935 closure_bio_submit(s->iop.c, miss, &s->cl); in cached_dev_cache_miss()
943 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in cached_dev_read()
965 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, &start, &end); in cached_dev_write()
973 s->iop.bypass = false; in cached_dev_write()
974 s->iop.writeback = true; in cached_dev_write()
985 s->iop.bypass = true; in cached_dev_write()
989 s->iop.bypass)) { in cached_dev_write()
990 s->iop.bypass = false; in cached_dev_write()
991 s->iop.writeback = true; in cached_dev_write()
994 if (s->iop.bypass) { in cached_dev_write()
995 s->iop.bio = s->orig_bio; in cached_dev_write()
996 bio_get(s->iop.bio); in cached_dev_write()
1004 closure_bio_submit(s->iop.c, bio, cl); in cached_dev_write()
1006 } else if (s->iop.writeback) { in cached_dev_write()
1008 s->iop.bio = bio; in cached_dev_write()
1020 s->iop.status = BLK_STS_RESOURCE; in cached_dev_write()
1028 closure_bio_submit(s->iop.c, flush, cl); in cached_dev_write()
1031 s->iop.bio = bio_clone_fast(bio, GFP_NOIO, &dc->disk.bio_split); in cached_dev_write()
1034 closure_bio_submit(s->iop.c, bio, cl); in cached_dev_write()
1038 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_write()
1047 if (s->iop.flush_journal) in cached_dev_nodata()
1048 bch_journal_meta(s->iop.c, cl); in cached_dev_nodata()
1052 closure_bio_submit(s->iop.c, bio, cl); in cached_dev_nodata()
1202 s->iop.bypass = check_should_bypass(dc, bio); in cached_dev_make_request()
1282 if (s->iop.flush_journal) in flash_dev_nodata()
1283 bch_journal_meta(s->iop.c, cl); in flash_dev_nodata()
1319 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, in flash_dev_make_request()
1323 s->iop.bypass = (bio_op(bio) == REQ_OP_DISCARD) != 0; in flash_dev_make_request()
1324 s->iop.writeback = true; in flash_dev_make_request()
1325 s->iop.bio = bio; in flash_dev_make_request()
1327 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in flash_dev_make_request()
1329 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in flash_dev_make_request()