tdb2: remove zero-length write optimization.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:18 +0000 (23:19 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:18 +0000 (23:19 +1030)
If benchmarking indicates a problem later, we can restore it.

ccan/tdb2/io.c

index a9016c4f38ea17a3148d9585302eae792dadc05c..866ff085bb5e87b6e3463e016aa7202e800c4708 100644 (file)
@@ -236,11 +236,6 @@ static enum TDB_ERROR tdb_write(struct tdb_context *tdb, tdb_off_t off,
                                  "Write to read-only database");
        }
 
                                  "Write to read-only database");
        }
 
-       /* FIXME: Bogus optimization? */
-       if (len == 0) {
-               return TDB_SUCCESS;
-       }
-
        ecode = tdb->methods->oob(tdb, off + len, 0);
        if (ecode != TDB_SUCCESS) {
                return ecode;
        ecode = tdb->methods->oob(tdb, off + len, 0);
        if (ecode != TDB_SUCCESS) {
                return ecode;