projects
/
platform
/
upstream
/
lmdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
397d85d
)
Prep for next commit: C_WRITEMAP, C_ORIG_RDONLY.
author
Hallvard Furuseth
<hallvard@openldap.org>
Sun, 23 Aug 2015 19:10:52 +0000
(21:10 +0200)
committer
Howard Chu
<hyc@openldap.org>
Tue, 22 Dec 2015 04:21:13 +0000
(
04:21
+0000)
No change in behavior.
libraries/liblmdb/mdb.c
patch
|
blob
|
history
diff --git
a/libraries/liblmdb/mdb.c
b/libraries/liblmdb/mdb.c
index
71e20a3
..
d2b1d57
100644
(file)
--- a/
libraries/liblmdb/mdb.c
+++ b/
libraries/liblmdb/mdb.c
@@
-1298,6
+1298,10
@@
struct MDB_cursor {
#define C_SUB 0x04 /**< Cursor is a sub-cursor */
#define C_DEL 0x08 /**< last op was a cursor_del */
#define C_UNTRACK 0x40 /**< Un-track cursor when closing */
#define C_SUB 0x04 /**< Cursor is a sub-cursor */
#define C_DEL 0x08 /**< last op was a cursor_del */
#define C_UNTRACK 0x40 /**< Un-track cursor when closing */
+#define C_WRITEMAP MDB_TXN_WRITEMAP /**< Copy of txn flag */
+/** Read-only cursor into the txn's original snapshot in the map.
+ */
+#define C_ORIG_RDONLY MDB_TXN_RDONLY
/** @} */
unsigned int mc_flags; /**< @ref mdb_cursor */
MDB_page *mc_pg[CURSOR_STACK]; /**< stack of pushed pages */
/** @} */
unsigned int mc_flags; /**< @ref mdb_cursor */
MDB_page *mc_pg[CURSOR_STACK]; /**< stack of pushed pages */
@@
-5915,7
+5919,7
@@
mdb_page_get(MDB_cursor *mc, pgno_t pgno, MDB_page **ret, int *lvl)
MDB_page *p = NULL;
int level;
MDB_page *p = NULL;
int level;
- if (! (
txn->mt_flags & (MDB_TXN_RDONLY|MDB_TXN
_WRITEMAP))) {
+ if (! (
mc->mc_flags & (C_ORIG_RDONLY|C
_WRITEMAP))) {
MDB_txn *tx2 = txn;
level = 1;
do {
MDB_txn *tx2 = txn;
level = 1;
do {
@@
-8038,7
+8042,7
@@
mdb_xcursor_init0(MDB_cursor *mc)
mx->mx_cursor.mc_dbflag = &mx->mx_dbflag;
mx->mx_cursor.mc_snum = 0;
mx->mx_cursor.mc_top = 0;
mx->mx_cursor.mc_dbflag = &mx->mx_dbflag;
mx->mx_cursor.mc_snum = 0;
mx->mx_cursor.mc_top = 0;
- mx->mx_cursor.mc_flags = C_SUB;
+ mx->mx_cursor.mc_flags = C_SUB
| (mc->mc_flags & (C_ORIG_RDONLY|C_WRITEMAP))
;
mx->mx_dbx.md_name.mv_size = 0;
mx->mx_dbx.md_name.mv_data = NULL;
mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp;
mx->mx_dbx.md_name.mv_size = 0;
mx->mx_dbx.md_name.mv_data = NULL;
mx->mx_dbx.md_cmp = mc->mc_dbx->md_dcmp;
@@
-8057,12
+8061,12
@@
mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node)
{
MDB_xcursor *mx = mc->mc_xcursor;
{
MDB_xcursor *mx = mc->mc_xcursor;
+ mx->mx_cursor.mc_flags &= C_SUB|C_ORIG_RDONLY|C_WRITEMAP;
if (node->mn_flags & F_SUBDATA) {
memcpy(&mx->mx_db, NODEDATA(node), sizeof(MDB_db));
mx->mx_cursor.mc_pg[0] = 0;
mx->mx_cursor.mc_snum = 0;
mx->mx_cursor.mc_top = 0;
if (node->mn_flags & F_SUBDATA) {
memcpy(&mx->mx_db, NODEDATA(node), sizeof(MDB_db));
mx->mx_cursor.mc_pg[0] = 0;
mx->mx_cursor.mc_snum = 0;
mx->mx_cursor.mc_top = 0;
- mx->mx_cursor.mc_flags = C_SUB;
} else {
MDB_page *fp = NODEDATA(node);
mx->mx_db.md_pad = 0;
} else {
MDB_page *fp = NODEDATA(node);
mx->mx_db.md_pad = 0;
@@
-8075,7
+8079,7
@@
mdb_xcursor_init1(MDB_cursor *mc, MDB_node *node)
COPY_PGNO(mx->mx_db.md_root, fp->mp_pgno);
mx->mx_cursor.mc_snum = 1;
mx->mx_cursor.mc_top = 0;
COPY_PGNO(mx->mx_db.md_root, fp->mp_pgno);
mx->mx_cursor.mc_snum = 1;
mx->mx_cursor.mc_top = 0;
- mx->mx_cursor.mc_flags
= C_INITIALIZED|C_SUB
;
+ mx->mx_cursor.mc_flags
|= C_INITIALIZED
;
mx->mx_cursor.mc_pg[0] = fp;
mx->mx_cursor.mc_ki[0] = 0;
if (mc->mc_db->md_flags & MDB_DUPFIXED) {
mx->mx_cursor.mc_pg[0] = fp;
mx->mx_cursor.mc_ki[0] = 0;
if (mc->mc_db->md_flags & MDB_DUPFIXED) {
@@
-8141,7
+8145,7
@@
mdb_cursor_init(MDB_cursor *mc, MDB_txn *txn, MDB_dbi dbi, MDB_xcursor *mx)
mc->mc_top = 0;
mc->mc_pg[0] = 0;
mc->mc_ki[0] = 0;
mc->mc_top = 0;
mc->mc_pg[0] = 0;
mc->mc_ki[0] = 0;
- mc->mc_flags =
0
;
+ mc->mc_flags =
txn->mt_flags & (C_ORIG_RDONLY|C_WRITEMAP)
;
if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) {
mdb_tassert(txn, mx != NULL);
mc->mc_xcursor = mx;
if (txn->mt_dbs[dbi].md_flags & MDB_DUPSORT) {
mdb_tassert(txn, mx != NULL);
mc->mc_xcursor = mx;