Changeset 2794
- Timestamp:
- 18/10/2010 21:34:25 (19 months ago)
- Location:
- box/trunk
- Files:
-
- 2 deleted
- 8 edited
- 68 copied
-
bin/bbackupd/BackupClientInodeToIDMap.cpp (modified) (13 diffs)
-
bin/bbackupd/BackupClientInodeToIDMap.h (modified) (2 diffs)
-
bootstrap (modified) (1 diff)
-
bundled/replace (deleted)
-
bundled/tdb (deleted)
-
configure.ac (modified) (1 diff)
-
infrastructure/makebuildenv.pl.in (modified) (5 diffs)
-
infrastructure/makeparcels.pl.in (modified) (2 diffs)
-
modules.txt (modified) (1 diff)
-
parcels.txt (modified) (2 diffs)
-
qdbm (copied) (copied from box/trunk/qdbm)
-
qdbm/COPYING (copied) (copied from box/trunk/qdbm/COPYING)
-
qdbm/ChangeLog (copied) (copied from box/trunk/qdbm/ChangeLog)
-
qdbm/LTmakefile.in (copied) (copied from box/trunk/qdbm/LTmakefile.in)
-
qdbm/Makefile.in (copied) (copied from box/trunk/qdbm/Makefile.in)
-
qdbm/NEWS (copied) (copied from box/trunk/qdbm/NEWS)
-
qdbm/README (copied) (copied from box/trunk/qdbm/README)
-
qdbm/RISCmakefile (copied) (copied from box/trunk/qdbm/RISCmakefile)
-
qdbm/THANKS (copied) (copied from box/trunk/qdbm/THANKS)
-
qdbm/VCmakefile (copied) (copied from box/trunk/qdbm/VCmakefile)
-
qdbm/cabin.c (copied) (copied from box/trunk/qdbm/cabin.c)
-
qdbm/cabin.h (copied) (copied from box/trunk/qdbm/cabin.h)
-
qdbm/cbcodec.c (copied) (copied from box/trunk/qdbm/cbcodec.c)
-
qdbm/cbtest.c (copied) (copied from box/trunk/qdbm/cbtest.c)
-
qdbm/configure (copied) (copied from box/trunk/qdbm/configure)
-
qdbm/configure.in (copied) (copied from box/trunk/qdbm/configure.in)
-
qdbm/crmgr.c (copied) (copied from box/trunk/qdbm/crmgr.c)
-
qdbm/crtest.c (copied) (copied from box/trunk/qdbm/crtest.c)
-
qdbm/crtsv.c (copied) (copied from box/trunk/qdbm/crtsv.c)
-
qdbm/curia.c (copied) (copied from box/trunk/qdbm/curia.c)
-
qdbm/curia.h (copied) (copied from box/trunk/qdbm/curia.h)
-
qdbm/depot.c (copied) (copied from box/trunk/qdbm/depot.c)
-
qdbm/depot.h (copied) (copied from box/trunk/qdbm/depot.h)
-
qdbm/dpmgr.c (copied) (copied from box/trunk/qdbm/dpmgr.c)
-
qdbm/dptest.c (copied) (copied from box/trunk/qdbm/dptest.c)
-
qdbm/dptsv.c (copied) (copied from box/trunk/qdbm/dptsv.c)
-
qdbm/hovel.c (copied) (copied from box/trunk/qdbm/hovel.c)
-
qdbm/hovel.h (copied) (copied from box/trunk/qdbm/hovel.h)
-
qdbm/hvmgr.c (copied) (copied from box/trunk/qdbm/hvmgr.c)
-
qdbm/hvtest.c (copied) (copied from box/trunk/qdbm/hvtest.c)
-
qdbm/misc (copied) (copied from box/trunk/qdbm/misc)
-
qdbm/misc/COPYING.txt (copied) (copied from box/trunk/qdbm/misc/COPYING.txt)
-
qdbm/misc/README-win32.txt (copied) (copied from box/trunk/qdbm/misc/README-win32.txt)
-
qdbm/misc/VCmakefile-old (copied) (copied from box/trunk/qdbm/misc/VCmakefile-old)
-
qdbm/misc/benchmark.pdf (copied) (copied from box/trunk/qdbm/misc/benchmark.pdf)
-
qdbm/misc/icon16.png (copied) (copied from box/trunk/qdbm/misc/icon16.png)
-
qdbm/misc/icon20.png (copied) (copied from box/trunk/qdbm/misc/icon20.png)
-
qdbm/misc/index.html (copied) (copied from box/trunk/qdbm/misc/index.html)
-
qdbm/misc/index.ja.html (copied) (copied from box/trunk/qdbm/misc/index.ja.html)
-
qdbm/misc/logo.png (copied) (copied from box/trunk/qdbm/misc/logo.png)
-
qdbm/misc/makevcdef (copied) (copied from box/trunk/qdbm/misc/makevcdef)
-
qdbm/misc/mymemo-ja.html (copied) (copied from box/trunk/qdbm/misc/mymemo-ja.html)
-
qdbm/misc/tutorial-ja.html (copied) (copied from box/trunk/qdbm/misc/tutorial-ja.html)
-
qdbm/misc/win32check.bat (copied) (copied from box/trunk/qdbm/misc/win32check.bat)
-
qdbm/myconf.c (copied) (copied from box/trunk/qdbm/myconf.c)
-
qdbm/myconf.h (copied) (copied from box/trunk/qdbm/myconf.h)
-
qdbm/odeum.c (copied) (copied from box/trunk/qdbm/odeum.c)
-
qdbm/odeum.h (copied) (copied from box/trunk/qdbm/odeum.h)
-
qdbm/odidx.c (copied) (copied from box/trunk/qdbm/odidx.c)
-
qdbm/odmgr.c (copied) (copied from box/trunk/qdbm/odmgr.c)
-
qdbm/odtest.c (copied) (copied from box/trunk/qdbm/odtest.c)
-
qdbm/qdbm.def (copied) (copied from box/trunk/qdbm/qdbm.def)
-
qdbm/qdbm.pc.in (copied) (copied from box/trunk/qdbm/qdbm.pc.in)
-
qdbm/qdbm.spec.in (copied) (copied from box/trunk/qdbm/qdbm.spec.in)
-
qdbm/qmttest.c (copied) (copied from box/trunk/qdbm/qmttest.c)
-
qdbm/relic.c (copied) (copied from box/trunk/qdbm/relic.c)
-
qdbm/relic.h (copied) (copied from box/trunk/qdbm/relic.h)
-
qdbm/rlmgr.c (copied) (copied from box/trunk/qdbm/rlmgr.c)
-
qdbm/rltest.c (copied) (copied from box/trunk/qdbm/rltest.c)
-
qdbm/spex-ja.html (copied) (copied from box/trunk/qdbm/spex-ja.html)
-
qdbm/spex.html (copied) (copied from box/trunk/qdbm/spex.html)
-
qdbm/villa.c (copied) (copied from box/trunk/qdbm/villa.c)
-
qdbm/villa.h (copied) (copied from box/trunk/qdbm/villa.h)
-
qdbm/vista.c (copied) (copied from box/trunk/qdbm/vista.c)
-
qdbm/vista.h (copied) (copied from box/trunk/qdbm/vista.h)
-
qdbm/vlmgr.c (copied) (copied from box/trunk/qdbm/vlmgr.c)
-
qdbm/vltest.c (copied) (copied from box/trunk/qdbm/vltest.c)
-
qdbm/vltsv.c (copied) (copied from box/trunk/qdbm/vltsv.c)
Legend:
- Unmodified
- Added
- Removed
-
box/trunk/bin/bbackupd/BackupClientInodeToIDMap.cpp
r2717 r2794 11 11 12 12 #include <stdlib.h> 13 14 #define _PUBLIC_ 15 #include "tdb.h" 13 #include <depot.h> 16 14 17 15 #define BACKIPCLIENTINODETOIDMAP_IMPLEMENTATION … … 29 27 } IDBRecord; 30 28 31 #define BOX_DBM_MESSAGE(stuff) stuff << " ( tdb): " << tdb_error(mpContext)29 #define BOX_DBM_MESSAGE(stuff) stuff << " (qdbm): " << dperrmsg(dpecode) 32 30 33 31 #define BOX_LOG_DBM_ERROR(stuff) \ … … 39 37 BOX_DBM_MESSAGE(message << ": " << filename)); 40 38 41 #define ASSERT_DBM (success, message, exception, subtype) \42 if(!( success)) \39 #define ASSERT_DBM_OK(operation, message, filename, exception, subtype) \ 40 if(!(operation)) \ 43 41 { \ 44 THROW_DBM_ERROR(message, mFilename, exception, subtype); \42 THROW_DBM_ERROR(message, filename, exception, subtype); \ 45 43 } 46 44 47 45 #define ASSERT_DBM_OPEN() \ 48 if(mp Context == 0) \46 if(mpDepot == 0) \ 49 47 { \ 50 48 THROW_EXCEPTION_MESSAGE(BackupStoreException, InodeMapNotOpen, \ … … 53 51 54 52 #define ASSERT_DBM_CLOSED() \ 55 if(mp Context != 0) \53 if(mpDepot != 0) \ 56 54 { \ 57 55 THROW_EXCEPTION_MESSAGE(CommonException, Internal, \ … … 70 68 : mReadOnly(true), 71 69 mEmpty(false), 72 mp Context(NULL)70 mpDepot(0) 73 71 { 74 72 } … … 84 82 BackupClientInodeToIDMap::~BackupClientInodeToIDMap() 85 83 { 86 if(mp Context != NULL)84 if(mpDepot != 0) 87 85 { 88 86 Close(); … … 111 109 112 110 // Open the database file 113 int mode = ReadOnly ? O_RDONLY : O_RDWR;111 int mode = ReadOnly ? DP_OREADER : DP_OWRITER; 114 112 if(CreateNew) 115 113 { 116 mode |= O_CREAT;117 } 118 119 mp Context = tdb_open(Filename, 0, 0, mode, 0700);120 121 ASSERT_DBM (mpContext != NULL, "Failed to open inode database",114 mode |= DP_OCREAT; 115 } 116 117 mpDepot = dpopen(Filename, mode, 0); 118 119 ASSERT_DBM_OK(mpDepot, "Failed to open inode database", mFilename, 122 120 BackupStoreException, BerkelyDBFailure); 123 121 … … 140 138 { 141 139 ASSERT_DBM_CLOSED(); 142 ASSERT(mp Context == NULL);140 ASSERT(mpDepot == 0); 143 141 mEmpty = true; 144 142 mReadOnly = true; … … 156 154 { 157 155 ASSERT_DBM_OPEN(); 158 ASSERT_DBM(tdb_close(mpContext) == 0, "Failed to close inode database", 159 BackupStoreException, BerkelyDBFailure); 160 mpContext = NULL; 161 } 162 163 static TDB_DATA GetDatum(void* dptr, size_t dsize) 164 { 165 TDB_DATA datum; 166 datum.dptr = (unsigned char *)dptr; 167 datum.dsize = dsize; 168 return datum; 169 } 170 171 #define GET_STRUCT_DATUM(structure) \ 172 GetDatum(&structure, sizeof(structure)) 156 ASSERT_DBM_OK(dpclose(mpDepot), "Failed to close inode database", 157 mFilename, BackupStoreException, BerkelyDBFailure); 158 mpDepot = 0; 159 } 173 160 174 161 // -------------------------------------------------------------------------- … … 190 177 } 191 178 192 if(mp Context == 0)179 if(mpDepot == 0) 193 180 { 194 181 THROW_EXCEPTION(BackupStoreException, InodeMapNotOpen); … … 202 189 rec.mInDirectory = InDirectory; 203 190 204 ASSERT_DBM (tdb_store(mpContext, GET_STRUCT_DATUM(InodeRef),205 GET_STRUCT_DATUM(rec), 0) == 0,206 "Failed to add record to inode database", 191 ASSERT_DBM_OK(dpput(mpDepot, (const char *)&InodeRef, sizeof(InodeRef), 192 (const char *)&rec, sizeof(rec), DP_DOVER), 193 "Failed to add record to inode database", mFilename, 207 194 BackupStoreException, BerkelyDBFailure); 208 195 } … … 228 215 } 229 216 230 if(mp Context == 0)217 if(mpDepot == 0) 231 218 { 232 219 THROW_EXCEPTION(BackupStoreException, InodeMapNotOpen); … … 235 222 ASSERT_DBM_OPEN(); 236 223 237 TDB_DATA datum = tdb_fetch(mpContext, GET_STRUCT_DATUM(InodeRef)); 238 if(datum.dptr == NULL) 224 IDBRecord rec; 225 226 if(dpgetwb(mpDepot, (const char *)&InodeRef, sizeof(InodeRef), 227 0, sizeof(IDBRecord), (char *)&rec) == -1) 239 228 { 240 229 // key not in file 241 230 return false; 242 231 } 243 244 IDBRecord rec;245 if(datum.dsize != sizeof(rec))246 {247 THROW_EXCEPTION_MESSAGE(CommonException, Internal,248 "Failed to get inode database entry: "249 "record has wrong size: expected " <<250 sizeof(rec) << " but was " << datum.dsize <<251 " in " << mFilename);252 }253 232 254 rec = *(IDBRecord *)datum.dptr;255 free(datum.dptr);256 257 233 // Return data 258 234 rObjectIDOut = rec.mObjectID; -
box/trunk/bin/bbackupd/BackupClientInodeToIDMap.h
r2717 r2794 18 18 // avoid having to include the DB files when not necessary 19 19 #ifndef BACKIPCLIENTINODETOIDMAP_IMPLEMENTATION 20 struct TDB_CONTEXT; 21 struct TDB_DATUM; 20 class DEPOT; 22 21 #endif 23 22 … … 51 50 bool mEmpty; 52 51 std::string mFilename; 53 TDB_CONTEXT *mpContext;52 DEPOT *mpDepot; 54 53 }; 55 54 -
box/trunk/bootstrap
r2717 r2794 1 1 #!/bin/sh 2 3 set -e4 2 5 3 aclocal -I infrastructure/m4 6 4 autoheader 7 5 autoconf 8 ( cd bundled/tdb; ./autogen.sh; ) -
box/trunk/configure.ac
r2759 r2794 389 389 390 390 cat parcels.txt | sed -e 's/#.*//' | while read cmd subdir configure_args; do 391 if test "$cmd" = " configure"; then391 if test "$cmd" = "subdir"; then 392 392 echo 393 393 export CC CXX CXXFLAGS LDFLAGS LIBS -
box/trunk/infrastructure/makebuildenv.pl.in
r2717 r2794 253 253 # check directory exists 254 254 die "Module $mod can't be found\n" unless -d $mod; 255 256 # skip bundled libraries with their own Makefile process257 next if ($mod =~ m|^bundled/|);258 255 259 256 # and put in lists … … 514 511 } 515 512 513 516 514 # make include path 517 my $include_paths = ""; 518 519 foreach my $mod (@all_deps_for_module) 520 { 521 if ($mod =~ m|^bundled/| and -d "$mod/include") 522 { 523 $include_paths .= "-I../../$mod/include "; 524 } 525 else 526 { 527 $include_paths .= "-I../../$mod "; 528 } 529 } 515 my $include_paths = join(' ',map {'-I../../'.$_} @all_deps_for_module); 530 516 531 517 # is target a library? … … 789 775 $dep_target = "\$(OUTBASE)/$dep/$1.a"; 790 776 } 791 elsif ($dep =~ m|^bundled/(.*)|) 792 { 793 $dep_target = "lib$1.a"; 794 } 795 elsif ($dep =~ m|^bin/(.*)|) 777 elsif ($dep =~ m|^.*/(.*)|) 796 778 { 797 779 $dep_target = "\$(OUTBASE)/$dep/$1$platform_exe_ext"; … … 799 781 else 800 782 { 801 die "Don't know how to add compile-time " . 802 "dependency on $dep"; 783 $dep_target = "lib$dep.a"; 803 784 } 804 785 … … 821 802 foreach my $dep (reverse @all_deps_for_module) 822 803 { 823 if ($dep =~ m|^lib /(.+)$|)804 if ($dep =~ m|^lib\/(.+)$|) 824 805 { 825 806 push @lib_files, "\$(OUTBASE)/$dep/$1.a"; 826 807 } 827 elsif ($dep =~ m|^ bundled/(.+)$|)808 elsif ($dep =~ m|^([^/]+)$|) 828 809 { 829 810 push @lib_files, "../../$dep/lib$1.a"; -
box/trunk/infrastructure/makeparcels.pl.in
r2738 r2794 244 244 push @parcel_deps, "$dir/docs/${name}.html"; 245 245 } 246 elsif ($type eq ' configure')246 elsif ($type eq 'subdir') 247 247 { 248 248 shift @args; … … 256 256 $name-clean: 257 257 cd $name; \$(MAKE) clean 258 259 258 EOF 260 259 push @parcel_deps, "$name-build"; -
box/trunk/modules.txt
r2717 r2794 27 27 28 28 lib/backupclient lib/server lib/crypto lib/compress 29 lib/backupstore lib/server lib/raidfile lib/backupclient bundled/tdb29 lib/backupstore lib/server lib/raidfile lib/backupclient 30 30 31 31 bin/bbackupobjdump lib/backupclient lib/backupstore 32 bin/bbstored lib/raidfile lib/server lib/backupstore lib/backupclient bundled/tdb32 bin/bbstored lib/raidfile lib/server lib/backupstore lib/backupclient 33 33 bin/bbstoreaccounts lib/raidfile lib/backupstore 34 bin/bbackupd lib/server lib/backupclient bundled/tdb34 bin/bbackupd lib/server lib/backupclient qdbm 35 35 bin/bbackupquery lib/server lib/backupclient 36 36 bin/bbackupctl lib/server lib/backupclient -
box/trunk/parcels.txt
r2717 r2794 19 19 html bbackupd.conf 20 20 21 subdir qdbm libqdbm.a 21 22 22 23 EXCEPT:mingw32,mingw32msvc … … 66 67 html raidfile.conf 67 68 68 configure bundled/tdb69 70 69 EXCEPT:mingw32,mingw32msvc 71 70 man bbstored.8
Note: See TracChangeset
for help on using the changeset viewer.
