]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-mdb/nextid.c
Merge remote branch 'origin/mdb.master'
[openldap] / servers / slapd / back-mdb / nextid.c
index 1d7b3893cb0d3c431154a5cea08cb866ee943eb4..d4ce5e34a3276a34a996f510b766767e2b79fc35 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2011 The OpenLDAP Foundation.
+ * Copyright 2000-2012 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 #include "back-mdb.h"
 
-int mdb_next_id( BackendDB *be, MDB_txn *tid, ID *out )
+int mdb_next_id( BackendDB *be, MDB_cursor *mc, ID *out )
 {
-       struct mdb_info *mdb = (struct mdb_info *) be->be_private;
        int rc;
        ID id = 0;
        MDB_val key;
-       MDB_cursor *cursor;
 
-       /* Get a read cursor */
-       rc = mdb_cursor_open( tid, mdb->mi_id2entry, &cursor );
-
-       if (rc == 0) {
-               rc = mdb_cursor_get(cursor, &key, NULL, MDB_LAST);
-               mdb_cursor_close(cursor);
-       }
+       rc = mdb_cursor_get(mc, &key, NULL, MDB_LAST);
 
        switch(rc) {
        case MDB_NOTFOUND: