cache tools wip

This commit is contained in:
Joe Thornber 2013-03-15 16:24:17 +00:00
parent 907dc34499
commit 843cf76d41
5 changed files with 46 additions and 18 deletions

View File

@ -19,6 +19,10 @@
.PHONY: all .PHONY: all
PROGRAMS=\ PROGRAMS=\
cache_check \
cache_dump \
cache_restore \
\
thin_debug \ thin_debug \
thin_check \ thin_check \
thin_dump \ thin_dump \
@ -39,6 +43,8 @@ SOURCE=\
persistent-data/space-maps/recursive.cc \ persistent-data/space-maps/recursive.cc \
persistent-data/space-maps/careful_alloc.cc \ persistent-data/space-maps/careful_alloc.cc \
\ \
cache/metadata_disk_structures.cc \
\
thin-provisioning/human_readable_format.cc \ thin-provisioning/human_readable_format.cc \
thin-provisioning/metadata.cc \ thin-provisioning/metadata.cc \
thin-provisioning/metadata_checker.cc \ thin-provisioning/metadata_checker.cc \
@ -49,6 +55,10 @@ SOURCE=\
thin-provisioning/xml_format.cc thin-provisioning/xml_format.cc
PROGRAM_SOURCE=\ PROGRAM_SOURCE=\
cache/check.cc \
cache/dump.cc \
cache/restore.cc \
\
thin-provisioning/thin_check.cc \ thin-provisioning/thin_check.cc \
thin-provisioning/thin_dump.cc \ thin-provisioning/thin_dump.cc \
thin-provisioning/thin_restore.cc thin-provisioning/thin_restore.cc
@ -89,19 +99,8 @@ test-programs: $(TEST_PROGRAMS)
%.o: %.cc %.o: %.cc
$(CXX) -c $(INCLUDES) $(CXXFLAGS) -o $@ $< $(CXX) -c $(INCLUDES) $(CXXFLAGS) -o $@ $<
# CACHE_CHECK_SOURCE=\ #----------------------------------------------------------------
# persistent-data/checksum.cc \ # Thin provisioning tools
# persistent-data/endian_utils.cc \
# persistent-data/error_set.cc \
# persistent-data/hex_dump.cc \
# cacmetadata.cc \
# metadata_checker.cc \
# cache_metadata_disk_structures.cc \
# space_map.cc \
# space_map_disk.cc \
# space_map_recursive.cc \
# space_map_transactional.cc \
# transaction_manager.cc
THIN_DEBUG_SOURCE=$(SOURCE) THIN_DEBUG_SOURCE=$(SOURCE)
THIN_DUMP_SOURCE=$(SOURCE) THIN_DUMP_SOURCE=$(SOURCE)
@ -121,8 +120,6 @@ THIN_CHECK_SOURCE=\
thin-provisioning/metadata_checker.cc \ thin-provisioning/metadata_checker.cc \
thin-provisioning/metadata_disk_structures.cc thin-provisioning/metadata_disk_structures.cc
#CACHE_CHECK_OBJECTS=$(subst .cc,.o,$(CACHE_CHECK_SOURCE))
THIN_DEBUG_OBJECTS=$(subst .cc,.o,$(THIN_DEBUG_SOURCE)) THIN_DEBUG_OBJECTS=$(subst .cc,.o,$(THIN_DEBUG_SOURCE))
THIN_DUMP_OBJECTS=$(subst .cc,.o,$(THIN_DUMP_SOURCE)) THIN_DUMP_OBJECTS=$(subst .cc,.o,$(THIN_DUMP_SOURCE))
THIN_RESTORE_OBJECTS=$(subst .cc,.o,$(THIN_RESTORE_SOURCE)) THIN_RESTORE_OBJECTS=$(subst .cc,.o,$(THIN_RESTORE_SOURCE))
@ -140,8 +137,26 @@ thin_restore: $(THIN_RESTORE_OBJECTS) thin-provisioning/thin_restore.o
thin_check: $(THIN_CHECK_OBJECTS) thin-provisioning/thin_check.o thin_check: $(THIN_CHECK_OBJECTS) thin-provisioning/thin_check.o
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
#cache_check: $(CACHE_CHECK_OBJECTS) cache_check.o #----------------------------------------------------------------
# $(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) # Cache tools
CACHE_CHECK_SOURCE=\
persistent-data/checksum.cc \
persistent-data/endian_utils.cc \
persistent-data/error_set.cc \
persistent-data/hex_dump.cc \
persistent-data/lock_tracker.cc \
persistent-data/space_map.cc \
persistent-data/space-maps/disk.cc \
persistent-data/space-maps/recursive.cc \
persistent-data/space-maps/careful_alloc.cc \
persistent-data/transaction_manager.cc \
cache/metadata_disk_structures.cc
CACHE_CHECK_OBJECTS=$(subst .cc,.o,$(CACHE_CHECK_SOURCE))
cache_check: $(CACHE_CHECK_OBJECTS) cache/check.o
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
clean: clean:
$(RM) *.o unit-tests/*.o *.d unit-tests/*.d $(TEST_PROGRAMS) $(PROGRAMS) $(OBJECTS) $(RM) *.o unit-tests/*.o *.d unit-tests/*.d $(TEST_PROGRAMS) $(PROGRAMS) $(OBJECTS)

View File

@ -20,6 +20,7 @@
#include <getopt.h> #include <getopt.h>
#include <libgen.h> #include <libgen.h>
#if 0
#include "array.h" #include "array.h"
#include "metadata.h" #include "metadata.h"
#include "metadata_checker.h" #include "metadata_checker.h"
@ -98,3 +99,9 @@ int main(int argc, char **argv)
return check(argv[optind], quiet); return check(argv[optind], quiet);
} }
#else
int main(int argc, char **argv)
{
cerr << "not implemented" << endl;
return 1;
}

View File

@ -19,7 +19,7 @@
#include <iostream> #include <iostream>
#include <getopt.h> #include <getopt.h>
#include <libgen.h> #include <libgen.h>
#if 0
#include "human_readable_format.h" #include "human_readable_format.h"
#include "cache_metadata_dumper.h" #include "cache_metadata_dumper.h"
#include "cache_metadata.h" #include "cache_metadata.h"
@ -117,3 +117,9 @@ int main(int argc, char **argv)
return dump(argv[optind], format, repair, metadata_snap); return dump(argv[optind], format, repair, metadata_snap);
} }
#else
int main(int argc, char **argv)
{
return 1;
}
#endif