OpenBSD CVS

CVS log for src/usr.sbin/ldapd/btree.c


[BACK] Up to [local] / src / usr.sbin / ldapd

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.38 / (download) - annotate - [select for diffs], Fri May 26 21:23:14 2017 UTC (7 years ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, HEAD
Changes since 1.37: +5 -3 lines
Diff to previous 1.37 (colored)

Don't overflow uint16 when the filesystem block size is >32K.
Reported and initial diagnosis from Allan Streib, help/ok millert deraadt

Revision 1.37 / (download) - annotate - [select for diffs], Fri Dec 2 05:52:01 2016 UTC (7 years, 6 months ago) by jmatthew
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.36: +3 -1 lines
Diff to previous 1.36 (colored)

Fix leaks by freeing 'path' and 'lru_queue' in btree_close().
From Jon Mayo, via Tim Kuijsten

ok mikeb@

Revision 1.36 / (download) - annotate - [select for diffs], Sun Mar 20 00:01:22 2016 UTC (8 years, 2 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])
idioms.

Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0)
where it is obvious further investigation will not yield and
even better way.

Obviousness evaluation and ok guenther@

Revision 1.35 / (download) - annotate - [select for diffs], Thu Dec 24 17:47:57 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.34: +6 -6 lines
Diff to previous 1.34 (colored)

bzero -> memset. No binary change.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Dec 22 08:35:17 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

commiting -> committing

Revision 1.33 / (download) - annotate - [select for diffs], Wed Jun 3 02:24:36 2015 UTC (9 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.32: +5 -2 lines
Diff to previous 1.32 (colored)

Do not assume that asprintf() clears the pointer on failure, which
is non-portable.  Also add missing asprintf() return value checks.
OK deraadt@ guenther@ doug@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jan 16 16:04:38 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.31: +1 -2 lines
Diff to previous 1.31 (colored)

change to <limits.h> universe.  The only changes in the binary are due
to the heavy use of assert.
ok millert

Revision 1.31 / (download) - annotate - [select for diffs], Sat Nov 2 13:31:51 2013 UTC (10 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.30: +7 -7 lines
Diff to previous 1.30 (colored)

bunch of format string cleanups, removing %i, signed vs unsigned, and even
a few long long's
ok jmatthew

Revision 1.30 / (download) - annotate - [select for diffs], Wed Sep 1 12:13:21 2010 UTC (13 years, 9 months ago) by martinh
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.29: +6 -6 lines
Diff to previous 1.29 (colored)

Do not use FP arithmetic. Variation on a diff from Mike Belopuhov some time ago.

Revision 1.29 / (download) - annotate - [select for diffs], Mon Jul 26 09:27:14 2010 UTC (13 years, 10 months ago) by martinh
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.28: +6 -5 lines
Diff to previous 1.28 (colored)

Fix a sigbus due to unaligned memory access, found when compacting on
sparc64.

reads ok to gilles@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Jul 18 15:15:40 2010 UTC (13 years, 10 months ago) by martinh
Branch: MAIN
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

Fix an unaligned memory access.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jul 6 20:10:57 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.26: +4 -1 lines
Diff to previous 1.26 (colored)

Send empty statistics rather than segfault if "ldapctl stats" is run when a
database is being reopened due to compaction.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jul 6 13:28:35 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.25: +3 -1 lines
Diff to previous 1.25 (colored)

When moving a node between pages during rebalance, find the source page
prefix before finding any child page prefix. This fixes an inconsistency
during rebalance.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jul 6 13:05:35 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.24: +2 -3 lines
Diff to previous 1.24 (colored)

Adapt code to adhere to the comment (now that doesn't happen very often!).

When deciding how to rebalancing after delete (move or merge), the number
of keys is not important, as long as the source page doesn't get empty
after a move.

There is still a rare case where merging two quarter-full pages will not
fit in a whole page (due to prefix expansion) that needs to be fixed.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jul 5 21:06:45 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.23: +21 -13 lines
Diff to previous 1.23 (colored)

Unbreak writing updates to the btree while having a cursor open on the
affected pages.

When a cursor has increased the reference count on a cached page, it is
copied before updated. The new pointer was however not passed back to the
caller, effectively commiting the old page numbers.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jul 5 17:11:41 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

Plug a memory leak when aborting transactions.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jul 2 01:43:00 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.21: +17 -6 lines
Diff to previous 1.21 (colored)

Add a BT_CURSOR_EXACT operation to btree_cursor_get. It behaves like
BT_CURSOR, but fails if the key is not found.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jul 2 01:08:35 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.20: +3 -1 lines
Diff to previous 1.20 (colored)

Plug a memory leak where each update leaked one page.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 1 06:11:59 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

reset number of revisions after compaction

Revision 1.19 / (download) - annotate - [select for diffs], Thu Jul 1 05:13:11 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

Copy statistics to the compacted database so it isn't lost.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jul 1 03:43:24 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.17: +6 -3 lines
Diff to previous 1.17 (colored)

Fix a null pointer dereference when writing an entry requiring a single
overflow page. Found by clang static analyzer. Also add some assertions to
silence clang.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 1 02:19:11 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.16: +4 -16 lines
Diff to previous 1.16 (colored)

Remove dead assignments. Found by clang static analyzer.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Jun 30 21:44:33 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.15: +4 -2 lines
Diff to previous 1.15 (colored)

Don't prune page cache directly when adding to it. Fixes a crash with a
zero cache-size.

found by william@

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jun 29 04:27:15 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.14: +7 -6 lines
Diff to previous 1.14 (colored)

Fix signedness warnings.
Noticed by deraadt

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jun 27 01:23:08 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.13: +384 -262 lines
Diff to previous 1.13 (colored)

Add support for different page sizes in the btree. Add a new header page
type and move the page size, magic and version from the meta page here.

Bump the btree version number. This requires a dump/restore of any existing
databases.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Jun 23 13:10:14 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.12: +60 -35 lines
Diff to previous 1.12 (colored)

Set errno to appropriate values when returning failure in btree. Make btree
functions only return success or failure (-1 or NULL). Update callers to
check errno.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jun 17 18:36:36 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.11: +4 -4 lines
Diff to previous 1.11 (colored)

Fix byte alignment on sparc64.

From Alexander Schrijver.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 15 15:54:39 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.10: +11 -1 lines
Diff to previous 1.10 (colored)

Verify that a transaction passed to btree_tnx_{put,del} is not readonly.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jun 13 06:55:33 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.9: +6 -3 lines
Diff to previous 1.9 (colored)

Don't expose typedefs of pgno_t and indx_t in the public header file, move
them to btree.c. Also don't use exact-width integer types in public btree api.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jun 13 06:49:51 2010 UTC (13 years, 11 months ago) by martinh
Branch: MAIN
Changes since 1.8: +13 -5 lines
Diff to previous 1.8 (colored)

Fix btree reference counting when opening the database with a file
descriptor directly using btree_open_fd(). Also wrap referencing in a
function.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jun 11 08:40:32 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.7: +7 -2 lines
Diff to previous 1.7 (colored)

Keep returning BT_DEAD if last meta page has the "tombstone" bit set.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jun 11 07:41:16 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.6: +53 -4 lines
Diff to previous 1.6 (colored)

Allow functions that accept both a btree and a txn argument to be passed a
NULL btree pointer. In that case the btree is taken from the transaction.

If both a btree and txn pointer is passed, make sure the transaction is
actually opened on the specified btree.

Revision 1.6 / (download) - annotate - [select for diffs], Fri Jun 11 05:29:22 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.5: +56 -30 lines
Diff to previous 1.5 (colored)

Append a "tombstone" meta page after a database has been compacted. This
allows other processes to pick up the change and re-open the file.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Jun 10 19:36:39 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.4: +10 -10 lines
Diff to previous 1.4 (colored)

Read-only transactions have no dirty_queue, so check for a read-only
transaction before freeing it.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 3 17:32:25 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.3: +4 -3 lines
Diff to previous 1.3 (colored)

Fix compilation on gcc2. Check a return value from malloc while at it.

"that compiles!" deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 2 09:12:13 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.2: +2 -4 lines
Diff to previous 1.2 (colored)

remove c++ comments
ok gilles@

Revision 1.2 / (download) - annotate - [select for diffs], Mon May 31 18:29:04 2010 UTC (14 years ago) by martinh
Branch: MAIN
Changes since 1.1: +7 -7 lines
Diff to previous 1.1 (colored)

Remove trailing whitespace and spaces before tabs.

ok gilles@

Revision 1.1 / (download) - annotate - [select for diffs], Mon May 31 17:36:31 2010 UTC (14 years ago) by martinh
Branch: MAIN

Initial import of ldapd, a small LDAP daemon. Work in progress.

ok deraadt@ jacekm@ gilles@ back@ henning@ blambert@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.