Lines Matching refs:insert
228 struct bkey *insert, in bch_btree_ptr_insert_fixup() argument
234 if (!KEY_OFFSET(insert)) in bch_btree_ptr_insert_fixup()
324 struct bkey *insert, in bch_extent_insert_fixup() argument
333 BUG_ON(!KEY_OFFSET(insert)); in bch_extent_insert_fixup()
334 BUG_ON(!KEY_SIZE(insert)); in bch_extent_insert_fixup()
342 if (bkey_cmp(&START_KEY(k), insert) >= 0) { in bch_extent_insert_fixup()
349 if (bkey_cmp(k, &START_KEY(insert)) <= 0) in bch_extent_insert_fixup()
378 if (KEY_START(k) > KEY_START(insert) + sectors_found) in bch_extent_insert_fixup()
393 sectors_found = KEY_OFFSET(k) - KEY_START(insert); in bch_extent_insert_fixup()
396 if (bkey_cmp(insert, k) < 0 && in bch_extent_insert_fixup()
397 bkey_cmp(&START_KEY(insert), &START_KEY(k)) > 0) { in bch_extent_insert_fixup()
407 bch_subtract_dirty(k, c, KEY_START(insert), in bch_extent_insert_fixup()
408 KEY_SIZE(insert)); in bch_extent_insert_fixup()
424 insert); in bch_extent_insert_fixup()
433 bch_cut_front(insert, top); in bch_extent_insert_fixup()
434 bch_cut_back(&START_KEY(insert), k); in bch_extent_insert_fixup()
439 if (bkey_cmp(insert, k) < 0) { in bch_extent_insert_fixup()
440 bch_cut_front(insert, k); in bch_extent_insert_fixup()
442 if (bkey_cmp(&START_KEY(insert), &START_KEY(k)) > 0) in bch_extent_insert_fixup()
443 old_offset = KEY_START(insert); in bch_extent_insert_fixup()
446 bkey_cmp(&START_KEY(insert), &START_KEY(k)) <= 0) { in bch_extent_insert_fixup()
453 __bch_cut_back(&START_KEY(insert), k); in bch_extent_insert_fixup()
465 } else if (sectors_found < KEY_SIZE(insert)) { in bch_extent_insert_fixup()
466 SET_KEY_OFFSET(insert, KEY_OFFSET(insert) - in bch_extent_insert_fixup()
467 (KEY_SIZE(insert) - sectors_found)); in bch_extent_insert_fixup()
468 SET_KEY_SIZE(insert, sectors_found); in bch_extent_insert_fixup()
472 if (KEY_DIRTY(insert)) in bch_extent_insert_fixup()
473 bcache_dev_sectors_dirty_add(c, KEY_INODE(insert), in bch_extent_insert_fixup()
474 KEY_START(insert), in bch_extent_insert_fixup()
475 KEY_SIZE(insert)); in bch_extent_insert_fixup()