Lines Matching refs:iop

477 	struct data_insert_op	iop;  member
494 s->iop.error = bio->bi_error; in bch_cache_read_endio()
496 ptr_stale(s->iop.c, &b->key, 0)) { in bch_cache_read_endio()
497 atomic_long_inc(&s->iop.c->cache_read_races); in bch_cache_read_endio()
498 s->iop.error = -EINTR; in bch_cache_read_endio()
501 bch_bbio_endio(s->iop.c, bio, bio->bi_error, "reading from cache"); in bch_cache_read_endio()
515 if (bkey_cmp(k, &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0)) <= 0) in cache_lookup_fn()
518 if (KEY_INODE(k) != s->iop.inode || in cache_lookup_fn()
521 unsigned sectors = KEY_INODE(k) == s->iop.inode in cache_lookup_fn()
552 bch_cut_front(&KEY(s->iop.inode, n->bi_iter.bi_sector, 0), bio_key); in cache_lookup_fn()
553 bch_cut_back(&KEY(s->iop.inode, bio_end_sector(n), 0), bio_key); in cache_lookup_fn()
575 struct search *s = container_of(cl, struct search, iop.cl); in cache_lookup()
581 ret = bch_btree_map_keys(&s->op, s->iop.c, in cache_lookup()
582 &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0), in cache_lookup()
600 s->iop.error = bio->bi_error; in request_endio()
616 s->orig_bio->bi_error = s->iop.error; in bio_complete()
639 if (s->iop.bio) in search_free()
640 bio_put(s->iop.bio); in search_free()
664 s->iop.c = d->c; in search_alloc()
665 s->iop.bio = NULL; in search_alloc()
666 s->iop.inode = d->id; in search_alloc()
667 s->iop.write_point = hash_long((unsigned long) current, 16); in search_alloc()
668 s->iop.write_prio = 0; in search_alloc()
669 s->iop.error = 0; in search_alloc()
670 s->iop.flags = 0; in search_alloc()
671 s->iop.flush_journal = (bio->bi_rw & (REQ_FLUSH|REQ_FUA)) != 0; in search_alloc()
672 s->iop.wq = bcache_wq; in search_alloc()
694 if (s->iop.replace_collision) in cached_dev_cache_miss_done()
695 bch_mark_cache_miss_collision(s->iop.c, s->d); in cached_dev_cache_miss_done()
697 if (s->iop.bio) { in cached_dev_cache_miss_done()
701 bio_for_each_segment_all(bv, s->iop.bio, i) in cached_dev_cache_miss_done()
717 s->iop.error = 0; in cached_dev_read_error()
741 if (s->iop.bio) { in cached_dev_read_done()
742 bio_reset(s->iop.bio); in cached_dev_read_done()
743 s->iop.bio->bi_iter.bi_sector = s->cache_miss->bi_iter.bi_sector; in cached_dev_read_done()
744 s->iop.bio->bi_bdev = s->cache_miss->bi_bdev; in cached_dev_read_done()
745 s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9; in cached_dev_read_done()
746 bch_bio_map(s->iop.bio, NULL); in cached_dev_read_done()
748 bio_copy_data(s->cache_miss, s->iop.bio); in cached_dev_read_done()
759 if (s->iop.bio && in cached_dev_read_done()
760 !test_bit(CACHE_SET_STOPPING, &s->iop.c->flags)) { in cached_dev_read_done()
761 BUG_ON(!s->iop.replace); in cached_dev_read_done()
762 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_read_done()
773 bch_mark_cache_accounting(s->iop.c, s->d, in cached_dev_read_done_bh()
774 !s->cache_miss, s->iop.bypass); in cached_dev_read_done_bh()
775 trace_bcache_read(s->orig_bio, !s->cache_miss, s->iop.bypass); in cached_dev_read_done_bh()
777 if (s->iop.error) in cached_dev_read_done_bh()
779 else if (s->iop.bio || verify(dc, &s->bio.bio)) in cached_dev_read_done_bh()
793 if (s->cache_miss || s->iop.bypass) { in cached_dev_cache_miss()
801 s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA) in cached_dev_cache_miss()
807 s->iop.replace_key = KEY(s->iop.inode, in cached_dev_cache_miss()
811 ret = bch_btree_insert_check_key(b, &s->op, &s->iop.replace_key); in cached_dev_cache_miss()
815 s->iop.replace = true; in cached_dev_cache_miss()
840 bch_mark_cache_readahead(s->iop.c, s->d); in cached_dev_cache_miss()
843 s->iop.bio = cache_bio; in cached_dev_cache_miss()
861 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in cached_dev_read()
883 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, &start, &end); in cached_dev_write()
891 s->iop.bypass = false; in cached_dev_write()
892 s->iop.writeback = true; in cached_dev_write()
903 s->iop.bypass = true; in cached_dev_write()
907 s->iop.bypass)) { in cached_dev_write()
908 s->iop.bypass = false; in cached_dev_write()
909 s->iop.writeback = true; in cached_dev_write()
912 if (s->iop.bypass) { in cached_dev_write()
913 s->iop.bio = s->orig_bio; in cached_dev_write()
914 bio_get(s->iop.bio); in cached_dev_write()
919 } else if (s->iop.writeback) { in cached_dev_write()
921 s->iop.bio = bio; in cached_dev_write()
936 s->iop.bio = bio_clone_fast(bio, GFP_NOIO, dc->disk.bio_split); in cached_dev_write()
941 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_write()
950 if (s->iop.flush_journal) in cached_dev_nodata()
951 bch_journal_meta(s->iop.c, cl); in cached_dev_nodata()
987 s->iop.bypass = check_should_bypass(dc, bio); in cached_dev_make_request()
1070 if (s->iop.flush_journal) in flash_dev_nodata()
1071 bch_journal_meta(s->iop.c, cl); in flash_dev_nodata()
1102 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, in flash_dev_make_request()
1106 s->iop.bypass = (bio->bi_rw & REQ_DISCARD) != 0; in flash_dev_make_request()
1107 s->iop.writeback = true; in flash_dev_make_request()
1108 s->iop.bio = bio; in flash_dev_make_request()
1110 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in flash_dev_make_request()
1112 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in flash_dev_make_request()