struct bkey_ptrs_c ptrs;
        const struct bch_extent_ptr *ptr;
        unsigned flags =
-               BTREE_TRIGGER_INSERT|
                BTREE_TRIGGER_GC|
                (initial ? BTREE_TRIGGER_NOATOMIC : 0);
        char buf[200];
 
        for_each_pending_btree_node_free(c, as, d)
                if (d->index_update_done)
-                       bch2_mark_key(c, bkey_i_to_s_c(&d->key),
-                                     BTREE_TRIGGER_INSERT|BTREE_TRIGGER_GC);
+                       bch2_mark_key(c, bkey_i_to_s_c(&d->key), BTREE_TRIGGER_GC);
 
        mutex_unlock(&c->btree_interior_update_lock);
 }
 
        bool gc = flags & BTREE_TRIGGER_GC;
        u64 journal_seq = trans->journal_res.seq;
        struct bch_fs *c = trans->c;
-       struct bkey_s_c k = flags & BTREE_TRIGGER_INSERT ? new : old;
+       struct bkey_s_c k = flags & BTREE_TRIGGER_OVERWRITE ? old: new;
        struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
        const union bch_extent_entry *entry;
        struct extent_ptr_decoded p;
        bool stale;
        int ret;
 
-       BUG_ON((flags & (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE)) ==
-              (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE));
-
        r.e.data_type   = data_type;
        r.e.nr_devs     = 0;
        r.e.nr_required = 1;
                                 unsigned flags)
 {
        struct bch_fs *c = trans->c;
-       struct bkey_s_c k = flags & BTREE_TRIGGER_INSERT ? new : old;
+       struct bkey_s_c k = flags & BTREE_TRIGGER_OVERWRITE ? old: new;
        struct bch_fs_usage __percpu *fs_usage;
        unsigned replicas = bkey_s_c_to_reservation(k).v->nr_replicas;
        s64 sectors = (s64) k.k->size;
                               unsigned flags)
 {
        struct bch_fs *c = trans->c;
-       struct bkey_s_c k = flags & BTREE_TRIGGER_INSERT ? new : old;
+       struct bkey_s_c k = flags & BTREE_TRIGGER_OVERWRITE ? old: new;
        struct bkey_s_c_reflink_p p = bkey_s_c_to_reflink_p(k);
        struct reflink_gc *ref;
        size_t l, r, m;
                le32_to_cpu(p.v->back_pad);
        int ret = 0;
 
-       BUG_ON((flags & (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE)) ==
-              (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE));
-
        l = 0;
        r = c->reflink_gc_nr;
        while (l < r) {
                   struct bkey_s_c new,
                   unsigned flags)
 {
-       struct bkey_s_c k = flags & BTREE_TRIGGER_INSERT ? new : old;
-
-       BUG_ON(!(flags & (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE)));
+       struct bkey_s_c k = flags & BTREE_TRIGGER_OVERWRITE ? old: new;
 
        switch (k.k->type) {
        case KEY_TYPE_alloc:
        bool stale;
        int ret;
 
-       BUG_ON((flags & (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE)) ==
-              (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE));
-
        r.e.data_type   = data_type;
        r.e.nr_devs     = 0;
        r.e.nr_required = 1;
        s64 sectors = (s64) k.k->size;
        struct replicas_delta_list *d;
 
-       BUG_ON((flags & (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE)) ==
-              (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE));
-
        if (flags & BTREE_TRIGGER_OVERWRITE)
                sectors = -sectors;
        sectors *= replicas;
 int bch2_trans_mark_key(struct btree_trans *trans, struct bkey_s_c old,
                        struct bkey_s_c new, unsigned flags)
 {
-       struct bkey_s_c k = flags & BTREE_TRIGGER_INSERT ? new : old;
-
-       BUG_ON(!(flags & (BTREE_TRIGGER_INSERT|BTREE_TRIGGER_OVERWRITE)));
+       struct bkey_s_c k = flags & BTREE_TRIGGER_OVERWRITE ? old: new;
 
        switch (k.k->type) {
        case KEY_TYPE_btree_ptr: