bcachefs: drop btree_insert->did_work
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 11 Mar 2019 20:25:42 +0000 (16:25 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:17 +0000 (17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update_leaf.c

index df2e24a0688dfc98a67a52b29de3e82e3ffec60a..3e6a616b818220d2cbc30cc2d04abe4af7711732 100644 (file)
@@ -30,7 +30,6 @@ struct btree_insert {
        struct journal_preres   journal_preres;
        u64                     *journal_seq;
        unsigned                flags;
-       bool                    did_work;
 
        unsigned short          nr;
        struct btree_insert_entry  *entries;
index 4ab4dfcf843d4be677c671a958e79388a6f515d8..21822bda67fc132dc018dc8fc55ebaa7932f2697 100644 (file)
@@ -585,7 +585,6 @@ got_journal_res:
                        break;
                }
        }
-       trans->did_work = true;
 
        trans_for_each_entry(trans, i)
                do_btree_insert_one(trans, i);
@@ -739,8 +738,7 @@ err:
         * BTREE_INSERT_NOUNLOCK means don't unlock _after_ successful btree
         * update; if we haven't done anything yet it doesn't apply
         */
-       if (!trans->did_work)
-               flags &= ~BTREE_INSERT_NOUNLOCK;
+       flags &= ~BTREE_INSERT_NOUNLOCK;
 
        switch (ret) {
        case BTREE_INSERT_BTREE_NODE_FULL:
@@ -756,8 +754,12 @@ err:
                 * XXX:
                 * split -> btree node merging (of parent node) might still drop
                 * locks when we're not passing it BTREE_INSERT_NOUNLOCK
+                *
+                * we don't want to pass BTREE_INSERT_NOUNLOCK to split as that
+                * will inhibit merging - but we don't have a reliable way yet
+                * (do we?) of checking if we dropped locks in this path
                 */
-               if (!ret && !trans->did_work)
+               if (!ret)
                        goto retry;
 #endif