[Pkg-samba-maint] r3480 - in branches/tdb/experimental/debian: . patches
jelmer at alioth.debian.org
jelmer at alioth.debian.org
Fri May 14 14:39:53 UTC 2010
Author: jelmer
Date: 2010-05-14 14:39:50 +0000 (Fri, 14 May 2010)
New Revision: 3480
Added:
branches/tdb/experimental/debian/patches/
branches/tdb/experimental/debian/patches/20_clear_spinlocks.diff
branches/tdb/experimental/debian/patches/30_tdb_logging_func.diff
branches/tdb/experimental/debian/patches/series
Modified:
branches/tdb/experimental/debian/changelog
branches/tdb/experimental/debian/libtdb1.symbols
Log:
Remove `tdb_transaction_recover` symbol which was also removed upstream.
This symbol was never intended to be public and would have been hard to
use anyway.
Modified: branches/tdb/experimental/debian/changelog
===================================================================
--- branches/tdb/experimental/debian/changelog 2010-05-13 16:45:52 UTC (rev 3479)
+++ branches/tdb/experimental/debian/changelog 2010-05-14 14:39:50 UTC (rev 3480)
@@ -2,6 +2,9 @@
* New upstream snapshot.
* Build with standard system python. Closes: #577435
+ * Remove `tdb_transaction_recover` symbol which was also removed upstream.
+ This symbol was never intended to be public and would have been hard to
+ use anyway.
-- Jelmer Vernooij <jelmer at debian.org> Thu, 13 May 2010 18:42:16 +0200
Modified: branches/tdb/experimental/debian/libtdb1.symbols
===================================================================
--- branches/tdb/experimental/debian/libtdb1.symbols 2010-05-13 16:45:52 UTC (rev 3479)
+++ branches/tdb/experimental/debian/libtdb1.symbols 2010-05-14 14:39:50 UTC (rev 3480)
@@ -52,9 +52,8 @@
tdb_transaction_cancel at Base 1.1.0
tdb_transaction_commit at Base 1.1.0
tdb_transaction_prepare_commit at Base 1.1.5
- tdb_transaction_recover at Base 1.1.0
tdb_transaction_start at Base 1.1.0
- tdb_transaction_start_nonblock at Base 1.2.2~git20100507-1
+ tdb_transaction_start_nonblock at Base 1.2.2~git20100507
tdb_traverse at Base 1.0.6
tdb_traverse_read at Base 1.1.0
tdb_unlockall at Base 1.0.6
Added: branches/tdb/experimental/debian/patches/20_clear_spinlocks.diff
===================================================================
--- branches/tdb/experimental/debian/patches/20_clear_spinlocks.diff (rev 0)
+++ branches/tdb/experimental/debian/patches/20_clear_spinlocks.diff 2010-05-14 14:39:50 UTC (rev 3480)
@@ -0,0 +1,78 @@
+diff -ur tdb-1.1.1~svn26294/common/open.c tdb-1.1.1~svn26294-fixed/common/open.c
+--- tdb-1.1.1~svn26294/common/open.c 2007-08-11 23:19:24.000000000 +0200
++++ tdb-1.1.1~svn26294-fixed/common/open.c 2008-03-25 22:35:24.000000000 +0100
+@@ -141,6 +141,20 @@
+ {
+ }
+
++/* Clean up spinlock pointer */
++static int tdb_clear_spinlocks(struct tdb_context *tdb)
++{
++ off_t off = (off_t)((char *)&tdb->header.rwlocks
++ - (char *)&tdb->header);
++
++ tdb->header.rwlocks = 0;
++ if (lseek(tdb->fd, off, SEEK_SET) != off
++ || write(tdb->fd, (void *)&tdb->header.rwlocks,
++ sizeof(tdb->header.rwlocks))
++ != sizeof(tdb->header.rwlocks))
++ return -1;
++ return 0;
++}
+
+ struct tdb_context *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
+ int open_flags, mode_t mode,
+@@ -222,9 +236,12 @@
+ goto fail; /* errno set by tdb_brlock */
+ }
+
++ if ((tdb_flags & TDB_CLEAR_IF_FIRST)) {
++ locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0);
++ }
++
+ /* we need to zero database if we are the only one with it open */
+- if ((tdb_flags & TDB_CLEAR_IF_FIRST) &&
+- (locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0))) {
++ if ((tdb_flags & TDB_CLEAR_IF_FIRST) && locked) {
+ open_flags |= O_CREAT;
+ if (ftruncate(tdb->fd, 0) == -1) {
+ TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_open_ex: "
+@@ -261,11 +278,6 @@
+ if (fstat(tdb->fd, &st) == -1)
+ goto fail;
+
+- if (tdb->header.rwlocks != 0) {
+- TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: spinlocks no longer supported\n"));
+- goto fail;
+- }
+-
+ /* Is it already in the open list? If so, fail. */
+ if (tdb_already_open(st.st_dev, st.st_ino)) {
+ TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: "
+@@ -285,14 +297,26 @@
+ tdb->inode = st.st_ino;
+ tdb->max_dead_records = 0;
+ tdb_mmap(tdb);
++ if (!locked && tdb->header.rwlocks != 0) {
++ locked = (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_WRLCK, F_SETLK, 0, 1) == 0);
++ }
++
+ if (locked) {
++ /* Clear up spinlocks if there were any remaining */
++ if (tdb->header.rwlocks != 0 && !tdb->read_only)
++ tdb_clear_spinlocks(tdb);
++
+ if (tdb->methods->tdb_brlock(tdb, ACTIVE_LOCK, F_UNLCK, F_SETLK, 0, 1) == -1) {
+ TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: "
+ "failed to take ACTIVE_LOCK on %s: %s\n",
+ name, strerror(errno)));
+ goto fail;
+ }
++ }
+
++ if (tdb->header.rwlocks != 0) {
++ TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: spinlocks no longer supported\n"));
++ goto fail;
+ }
+
+ /* We always need to do this if the CLEAR_IF_FIRST flag is set, even if
Added: branches/tdb/experimental/debian/patches/30_tdb_logging_func.diff
===================================================================
--- branches/tdb/experimental/debian/patches/30_tdb_logging_func.diff (rev 0)
+++ branches/tdb/experimental/debian/patches/30_tdb_logging_func.diff 2010-05-14 14:39:50 UTC (rev 3480)
@@ -0,0 +1,51 @@
+Provide public symbol tdb_logging_function removed upstream without major
+version change. (bug #511011)
+
+diff -ur tdb-1.2.2/common/open.c tdb-1.2.2-fixed/common/open.c
+--- tdb-1.2.2/common/open.c 2010-05-06 01:33:26.000000000 +0200
++++ tdb-1.2.2-fixed/common/open.c 2010-05-14 16:21:45.461268209 +0200
+@@ -438,6 +438,11 @@
+ tdb->log = *log_ctx;
+ }
+
++void tdb_logging_function(struct tdb_context *tdb, tdb_log_func fn)
++{
++ tdb->log.log_fn = fn;
++}
++
+ void *tdb_get_logging_private(struct tdb_context *tdb)
+ {
+ return tdb->log.log_private;
+diff -ur tdb-1.2.2/include/tdb.h tdb-1.2.2-fixed/include/tdb.h
+--- tdb-1.2.2/include/tdb.h 2010-05-06 01:33:26.000000000 +0200
++++ tdb-1.2.2-fixed/include/tdb.h 2010-05-14 16:22:05.654686898 +0200
+@@ -100,6 +100,7 @@
+
+ _PUBLIC_ int tdb_reopen(struct tdb_context *tdb);
+ _PUBLIC_ int tdb_reopen_all(int parent_longlived);
++_PUBLIC_ __attribute__((deprecated)) void tdb_logging_function(struct tdb_context *tdb, tdb_log_func);
+ _PUBLIC_ void tdb_set_logging_function(struct tdb_context *tdb, const struct tdb_logging_context *log_ctx);
+ _PUBLIC_ enum TDB_ERROR tdb_error(struct tdb_context *tdb);
+ _PUBLIC_ const char *tdb_errorstr(struct tdb_context *tdb);
+diff -ur tdb-1.2.2/tdb.exports tdb-1.2.2-fixed/tdb.exports
+--- tdb-1.2.2/tdb.exports 2010-05-06 01:33:27.000000000 +0200
++++ tdb-1.2.2-fixed/tdb.exports 2010-05-14 16:21:45.465269063 +0200
+@@ -23,6 +23,7 @@
+ tdb_freelist_size;
+ tdb_get_flags;
+ tdb_get_logging_private;
++ tdb_logging_function;
+ tdb_get_seqnum;
+ tdb_hash_size;
+ tdb_increment_seqnum_nonblock;
+diff -ur tdb-1.2.2/tdb.signatures tdb-1.2.2-fixed/tdb.signatures
+--- tdb-1.2.2/tdb.signatures 2010-05-06 01:33:27.000000000 +0200
++++ tdb-1.2.2-fixed/tdb.signatures 2010-05-14 16:27:15.437270732 +0200
+@@ -56,6 +56,7 @@
+ void tdb_remove_flags (struct tdb_context *, unsigned int);
+ void tdb_setalarm_sigptr (struct tdb_context *, volatile sig_atomic_t *);
+ void tdb_set_logging_function (struct tdb_context *, const struct tdb_logging_context *);
++void tdb_logging_function(struct tdb_context *tdb, tdb_log_func);
+ void tdb_set_max_dead (struct tdb_context *, int);
+ int tdb_check (struct tdb_context *, int (*) (TDB_DATA, TDB_DATA, void *), void *);
+ TDB_DATA tdb_null;
Added: branches/tdb/experimental/debian/patches/series
===================================================================
--- branches/tdb/experimental/debian/patches/series (rev 0)
+++ branches/tdb/experimental/debian/patches/series 2010-05-14 14:39:50 UTC (rev 3480)
@@ -0,0 +1 @@
+30_tdb_logging_func.diff
More information about the Pkg-samba-maint
mailing list