Lines Matching refs:iop

482 	struct data_insert_op	iop;
499 s->iop.status = bio->bi_status;
501 ptr_stale(s->iop.c, &b->key, 0)) {
502 atomic_long_inc(&s->iop.c->cache_read_races);
503 s->iop.status = BLK_STS_IOERR;
506 bch_bbio_endio(s->iop.c, bio, bio->bi_status, "reading from cache");
520 if (bkey_cmp(k, &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0)) <= 0)
523 if (KEY_INODE(k) != s->iop.inode ||
526 unsigned int sectors = KEY_INODE(k) == s->iop.inode
557 bch_cut_front(&KEY(s->iop.inode, n->bi_iter.bi_sector, 0), bio_key);
558 bch_cut_back(&KEY(s->iop.inode, bio_end_sector(n), 0), bio_key);
580 struct search *s = container_of(cl, struct search, iop.cl);
587 ret = bch_btree_map_keys(&s->op, s->iop.c,
588 &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0),
601 * And after that happened, s->iop.status is still its initial value
612 if (!s->iop.status)
613 s->iop.status = BLK_STS_IOERR;
628 s->iop.status = bio->bi_status;
649 * s->iop.status by this failure, the status will be decided
652 if (unlikely(s->iop.writeback &&
658 s->iop.status = bio->bi_status;
676 s->orig_bio->bi_status = s->iop.status;
705 atomic_dec(&s->iop.c->search_inflight);
707 if (s->iop.bio)
708 bio_put(s->iop.bio);
712 mempool_free(s, &s->iop.c->search);
737 s->iop.c = d->c;
738 s->iop.bio = NULL;
739 s->iop.inode = d->id;
740 s->iop.write_point = hash_long((unsigned long) current, 16);
741 s->iop.write_prio = 0;
742 s->iop.status = 0;
743 s->iop.flags = 0;
744 s->iop.flush_journal = op_is_flush(bio->bi_opf);
745 s->iop.wq = bcache_wq;
767 if (s->iop.replace_collision)
768 bch_mark_cache_miss_collision(s->iop.c, s->d);
770 if (s->iop.bio)
771 bio_free_pages(s->iop.bio);
792 s->iop.status = 0;
798 closure_bio_submit(s->iop.c, bio, cl);
809 if (s->iop.replace_collision)
810 bch_mark_cache_miss_collision(s->iop.c, s->d);
812 if (s->iop.bio)
813 bio_free_pages(s->iop.bio);
832 if (s->iop.bio) {
833 bio_reset(s->iop.bio, s->cache_miss->bi_bdev, REQ_OP_READ);
834 s->iop.bio->bi_iter.bi_sector =
836 s->iop.bio->bi_iter.bi_size = s->insert_bio_sectors << 9;
837 bio_clone_blkg_association(s->iop.bio, s->cache_miss);
838 bch_bio_map(s->iop.bio, NULL);
840 bio_copy_data(s->cache_miss, s->iop.bio);
852 if (s->iop.bio &&
853 !test_bit(CACHE_SET_STOPPING, &s->iop.c->flags)) {
854 BUG_ON(!s->iop.replace);
855 closure_call(&s->iop.cl, bch_data_insert, NULL, cl);
866 bch_mark_cache_accounting(s->iop.c, s->d,
867 !s->cache_missed, s->iop.bypass);
868 trace_bcache_read(s->orig_bio, !s->cache_missed, s->iop.bypass);
870 if (s->iop.status)
872 else if (s->iop.bio || verify(dc))
888 if (s->cache_miss || s->iop.bypass) {
899 s->iop.replace_key = KEY(s->iop.inode,
903 ret = bch_btree_insert_check_key(b, &s->op, &s->iop.replace_key);
907 s->iop.replace = true;
932 s->iop.bio = cache_bio;
935 closure_bio_submit(s->iop.c, cache_bio, &s->cl);
944 closure_bio_submit(s->iop.c, miss, &s->cl);
952 closure_call(&s->iop.cl, cache_lookup, NULL, cl);
974 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, &start, &end);
982 s->iop.bypass = false;
983 s->iop.writeback = true;
994 s->iop.bypass = true;
998 s->iop.bypass)) {
999 s->iop.bypass = false;
1000 s->iop.writeback = true;
1003 if (s->iop.bypass) {
1004 s->iop.bio = s->orig_bio;
1005 bio_get(s->iop.bio);
1013 closure_bio_submit(s->iop.c, bio, cl);
1015 } else if (s->iop.writeback) {
1017 s->iop.bio = bio;
1030 s->iop.status = BLK_STS_RESOURCE;
1036 closure_bio_submit(s->iop.c, flush, cl);
1039 s->iop.bio = bio_alloc_clone(bio->bi_bdev, bio, GFP_NOIO,
1043 closure_bio_submit(s->iop.c, bio, cl);
1047 closure_call(&s->iop.cl, bch_data_insert, NULL, cl);
1056 if (s->iop.flush_journal)
1057 bch_journal_meta(s->iop.c, cl);
1061 closure_bio_submit(s->iop.c, bio, cl);
1219 s->iop.bypass = check_should_bypass(dc, bio);
1272 if (s->iop.flush_journal)
1273 bch_journal_meta(s->iop.c, cl);
1305 bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys,
1309 s->iop.bypass = (bio_op(bio) == REQ_OP_DISCARD) != 0;
1310 s->iop.writeback = true;
1311 s->iop.bio = bio;
1313 closure_call(&s->iop.cl, bch_data_insert, NULL, cl);
1315 closure_call(&s->iop.cl, cache_lookup, NULL, cl);