+static void op_add_chainlock(const char *filename,
+ struct op op[], unsigned int op_num, char *words[])
+{
+ if (words[2] == NULL || words[3])
+ fail(filename, op_num+1, "Expected just a key");
+
+ /* A chainlock key isn't a key in the normal sense; it doesn't
+ * have to be in the db at all. Also, we don't want to hash this op. */
+ op[op_num].data = make_tdb_data(op, filename, op_num+1, words[2]);
+ op[op_num].key = tdb_null;
+ op[op_num].group_len = 0;
+}
+
+static void op_add_chainlock_ret(const char *filename,
+ struct op op[], unsigned int op_num,
+ char *words[])
+{
+ if (!words[2] || !words[3] || !words[4] || words[5]
+ || !streq(words[3], "="))
+ fail(filename, op_num+1, "Expected <key> = <ret>");
+ op[op_num].ret = atoi(words[4]);
+ op[op_num].data = make_tdb_data(op, filename, op_num+1, words[2]);
+ op[op_num].key = tdb_null;
+ op[op_num].group_len = 0;
+ total_keys++;
+}
+
+static int op_find_start(struct op op[], unsigned int op_num, enum op_type type)