Lines Matching refs:iop

471 	struct data_insert_op	iop;  member
488 s->iop.error = error; in bch_cache_read_endio()
490 ptr_stale(s->iop.c, &b->key, 0)) { in bch_cache_read_endio()
491 atomic_long_inc(&s->iop.c->cache_read_races); in bch_cache_read_endio()
492 s->iop.error = -EINTR; in bch_cache_read_endio()
495 bch_bbio_endio(s->iop.c, bio, error, "reading from cache"); in bch_cache_read_endio()
509 if (bkey_cmp(k, &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0)) <= 0) in cache_lookup_fn()
512 if (KEY_INODE(k) != s->iop.inode || in cache_lookup_fn()
515 unsigned sectors = KEY_INODE(k) == s->iop.inode in cache_lookup_fn()
546 bch_cut_front(&KEY(s->iop.inode, n->bi_iter.bi_sector, 0), bio_key); in cache_lookup_fn()
547 bch_cut_back(&KEY(s->iop.inode, bio_end_sector(n), 0), bio_key); in cache_lookup_fn()
569 struct search *s = container_of(cl, struct search, iop.cl); in cache_lookup()
575 ret = bch_btree_map_keys(&s->op, s->iop.c, in cache_lookup()
576 &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0), in cache_lookup()
592 s->iop.error = error; in request_endio()
608 bio_endio(s->orig_bio, s->iop.error); in bio_complete()
630 if (s->iop.bio) in search_free()
631 bio_put(s->iop.bio); in search_free()
655 s->iop.c = d->c; in search_alloc()
656 s->iop.bio = NULL; in search_alloc()
657 s->iop.inode = d->id; in search_alloc()
658 s->iop.write_point = hash_long((unsigned long) current, 16); in search_alloc()
659 s->iop.write_prio = 0; in search_alloc()
660 s->iop.error = 0; in search_alloc()
661 s->iop.flags = 0; in search_alloc()
662 s->iop.flush_journal = (bio->bi_rw & (REQ_FLUSH|REQ_FUA)) != 0; in search_alloc()
663 s->iop.wq = bcache_wq; in search_alloc()
685 if (s->iop.replace_collision) in cached_dev_cache_miss_done()
686 bch_mark_cache_miss_collision(s->iop.c, s->d); in cached_dev_cache_miss_done()
688 if (s->iop.bio) { in cached_dev_cache_miss_done()
692 bio_for_each_segment_all(bv, s->iop.bio, i) in cached_dev_cache_miss_done()
708 s->iop.error = 0; in cached_dev_read_error()
732 if (s->iop.bio) { in cached_dev_read_done()
733 bio_reset(s->iop.bio); in cached_dev_read_done()
734 s->iop.bio->bi_iter.bi_sector = s->cache_miss->bi_iter.bi_sector; in cached_dev_read_done()
735 s->iop.bio->bi_bdev = s->cache_miss->bi_bdev; in cached_dev_read_done()
736 s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9; in cached_dev_read_done()
737 bch_bio_map(s->iop.bio, NULL); in cached_dev_read_done()
739 bio_copy_data(s->cache_miss, s->iop.bio); in cached_dev_read_done()
750 if (s->iop.bio && in cached_dev_read_done()
751 !test_bit(CACHE_SET_STOPPING, &s->iop.c->flags)) { in cached_dev_read_done()
752 BUG_ON(!s->iop.replace); in cached_dev_read_done()
753 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_read_done()
764 bch_mark_cache_accounting(s->iop.c, s->d, in cached_dev_read_done_bh()
765 !s->cache_miss, s->iop.bypass); in cached_dev_read_done_bh()
766 trace_bcache_read(s->orig_bio, !s->cache_miss, s->iop.bypass); in cached_dev_read_done_bh()
768 if (s->iop.error) in cached_dev_read_done_bh()
770 else if (s->iop.bio || verify(dc, &s->bio.bio)) in cached_dev_read_done_bh()
784 if (s->cache_miss || s->iop.bypass) { in cached_dev_cache_miss()
792 s->iop.c->gc_stats.in_use < CUTOFF_CACHE_READA) in cached_dev_cache_miss()
798 s->iop.replace_key = KEY(s->iop.inode, in cached_dev_cache_miss()
802 ret = bch_btree_insert_check_key(b, &s->op, &s->iop.replace_key); in cached_dev_cache_miss()
806 s->iop.replace = true; in cached_dev_cache_miss()
831 bch_mark_cache_readahead(s->iop.c, s->d); in cached_dev_cache_miss()
834 s->iop.bio = cache_bio; in cached_dev_cache_miss()
852 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in cached_dev_read()
874 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, &start, &end); in cached_dev_write()
882 s->iop.bypass = false; in cached_dev_write()
883 s->iop.writeback = true; in cached_dev_write()
894 s->iop.bypass = true; in cached_dev_write()
898 s->iop.bypass)) { in cached_dev_write()
899 s->iop.bypass = false; in cached_dev_write()
900 s->iop.writeback = true; in cached_dev_write()
903 if (s->iop.bypass) { in cached_dev_write()
904 s->iop.bio = s->orig_bio; in cached_dev_write()
905 bio_get(s->iop.bio); in cached_dev_write()
910 } else if (s->iop.writeback) { in cached_dev_write()
912 s->iop.bio = bio; in cached_dev_write()
927 s->iop.bio = bio_clone_fast(bio, GFP_NOIO, dc->disk.bio_split); in cached_dev_write()
932 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_write()
941 if (s->iop.flush_journal) in cached_dev_nodata()
942 bch_journal_meta(s->iop.c, cl); in cached_dev_nodata()
977 s->iop.bypass = check_should_bypass(dc, bio); in cached_dev_make_request()
1058 if (s->iop.flush_journal) in flash_dev_nodata()
1059 bch_journal_meta(s->iop.c, cl); in flash_dev_nodata()
1088 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, in flash_dev_make_request()
1092 s->iop.bypass = (bio->bi_rw & REQ_DISCARD) != 0; in flash_dev_make_request()
1093 s->iop.writeback = true; in flash_dev_make_request()
1094 s->iop.bio = bio; in flash_dev_make_request()
1096 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in flash_dev_make_request()
1098 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in flash_dev_make_request()