]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Avoid extraneous txn_renew
authorHoward Chu <hyc@openldap.org>
Mon, 29 Aug 2011 11:24:21 +0000 (04:24 -0700)
committerHoward Chu <hyc@openldap.org>
Mon, 29 Aug 2011 11:24:21 +0000 (04:24 -0700)
servers/slapd/back-mdb/id2entry.c
servers/slapd/back-mdb/libmdb

index 04e528846d3463aef24084d199d11643f55c8483..57f1fc1add9be3b0573b01b0a3d393c5c0e7a796 100644 (file)
@@ -315,7 +315,7 @@ mdb_reader_flush( MDB_env *env )
 int
 mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **moip )
 {
-       int rc;
+       int rc, renew = 0;
        void *data;
        void *ctx;
        mdb_op_info *moi = NULL;
@@ -407,11 +407,14 @@ mdb_opinfo_get( Operation *op, struct mdb_info *mdb, int rdonly, mdb_op_info **m
                        }
                } else {
                        moi->moi_txn = data;
+                       renew = 1;
                }
                moi->moi_flag |= MOI_READER;
        }
        if ( moi->moi_ref < 1 ) {
                moi->moi_ref = 0;
+       }
+       if ( renew ) {
                mdb_txn_renew( moi->moi_txn );
        }
        moi->moi_ref++;
index ee5bdc1105ffd3bbc3344ccea825f4d96be75c17..d182ccef046d83adb615e92c2d0b16478809f378 160000 (submodule)
@@ -1 +1 @@
-Subproject commit ee5bdc1105ffd3bbc3344ccea825f4d96be75c17
+Subproject commit d182ccef046d83adb615e92c2d0b16478809f378