Commit Graph

64 Commits

Author SHA1 Message Date
Ming-Hung Tsai 3f19818c56 [thin] Adopt stateful random number generators 2020-08-05 22:14:01 +08:00
Ming-Hung Tsai 0c3c5f6c1e [sequence_generator] Fix parameters and span boundary checking 2020-07-29 16:26:14 +08:00
Ming-Hung Tsai 661b4de5de [run_set] Add lower_bound and upper_bound functions 2020-07-29 16:18:23 +08:00
Ming-Hung Tsai 105b8ec1cf [base] Factor out sequence_generator 2020-07-29 15:33:25 +08:00
Ming-Hung Tsai e62022a200 [base] Move run_set to namespace base 2020-07-29 15:33:25 +08:00
Ming-Hung Tsai 061d966e7a [io_generator] Support mixed sequential and random io pattern 2020-07-25 17:46:59 +08:00
Ming-Hung Tsai 7ed013fcab [io_generator] Rename offset_generator classes, and fix bugs
- Rename the classes for general-purpose usage
- Fix duplicated sequential number generation while wrap around
- Enable unaligned random number generation
2020-07-25 17:20:59 +08:00
Ming-Hung Tsai aabc3a9dbc [io_generator] Add random map to avoid generating repeated addresses 2020-07-25 16:53:44 +08:00
Ming-Hung Tsai ce8945e829 [io_generator] Fix address boundary for doing IO
Limit the addresses to be within the specified range
2020-06-30 17:12:42 +08:00
Ming-Hung Tsai 084ac4b950 [io_generator] Simplify the class interface 2020-06-24 12:26:09 +08:00
Ming-Hung Tsai a345b894d3 [math_utils] Add is_power_of_two() 2020-06-19 18:07:55 +08:00
Ming-Hung Tsai 5260a87c0b [base] Move math_utils to namespace base 2020-06-19 18:07:55 +08:00
Ming-Hung Tsai 12d7178199 [base] Introduce io_generator 2020-06-19 18:07:55 +08:00
Joe Thornber 4313469475 [all] Switch from boost::shared_ptr -> std::shared_ptr.
Shared_ptr has moved into the standard library since these tools were
first written.
2020-04-30 15:02:43 +01:00
Joe Thornber ad79b627a4 Merge branch 'master' of github.com:jthornber/thin-provisioning-tools 2020-04-08 12:30:26 +01:00
Joe Thornber 8db3800e2c [base/application] One of the run methods wasn't overriding 2020-04-08 12:19:06 +01:00
Arusekk 3ed3925370 Fix compilation with uClibc
Closes #12
2020-03-25 15:58:02 +01:00
Ming-Hung Tsai 955e11bc28 [block-cache] fix potential file descriptor leak
Encapsulate file descriptor into an object, to ensure that an fd will be
closed properly while exception raised, e.g., the block_cache throws
exception during the block_manager's construction.
2020-02-23 15:41:16 +08:00
Joe Thornber 0fc7529c01 [cache_repair, thin_repair] fix bug introduced in recent patch
I hadn't realised that check_file_exists() also checked that it was
a regular file, which we don't want for the couple of uses I recently
added.

This patch adds an optional arg must_be_regular_file, and defaults
it to true, preserving the original behaviour.  The recent additions
have this set to false.
2019-10-14 09:21:38 +01:00
Joe Thornber 58048dc178 [file_utils] Use aligned memory in zero_superblock 2018-04-17 11:42:43 +01:00
csonto 39809c17b2 [*_restore] Fix leaking file descriptor (#89) 2017-11-14 15:09:11 +00:00
Joe Thornber 5b92f410ec [*_restore] if things go wrong wipe the superblock.
So we don't leave the metadata device with partially restored metadata.
2017-09-28 14:39:24 +01:00
Ming-Hung Tsai b7d418131d Spin-off syscall-related file operations (#78)
* [file_utils] spin-off syscall-related file operations

1. Eliminate the potential circular dependency between
   persistent-data/block.h and persistent-data/file_utils.h,
   if the former one wants to include the latter.
2. Avoid namespace pollution by removing the "using namespace std"
   declaration in block.tcc.
3. Correct the header hierarchy: base/xml_utils.h now no longer
   depends on the higher-level persistent-data/file_utils.h

* [file_utils] support block files in get_file_length()
2017-04-29 18:51:52 +01:00
Joe Thornber 4493d6d39d [disk-units] remove some dead code. 2017-03-13 13:16:56 +00:00
Joe Thornber 702a38f438 [many tools] fix bug in previous patch 2016-08-10 23:39:48 +08:00
Joe Thornber c2fdbad322 Merge branch '2016-07-07-improve-thin-repair-error-message' into v0.7-devel
Conflicts:
	Makefile.in
	VERSION
	configure.ac
	persistent-data/file_utils.cc
2016-07-11 15:51:30 +01:00
Joe Thornber 4779fb9b80 [various] Improve documentation
Output file must be preallocated.
2016-07-11 14:53:03 +01:00
Joe Thornber c8fec7ec40 [cache_writeback] Coded, needs testing 2016-04-14 08:54:32 +01:00
Joe Thornber 286f70ceac Merge remote-tracking branch 'remotes/github-m-h-tsai/v0.6.2-repairtool' into 2016-02-29-mingus-merge
Conflicts:
	Makefile.in
	VERSION
	thin-provisioning/commands.cc
	thin-provisioning/commands.h
	thin-provisioning/thin_delta.cc
2016-02-29 10:29:28 +00:00
Ming-Hung Tsai d28e64aff0 [xml_parser] Allow element handlers to stop parsing 2016-02-27 15:20:45 +08:00
Joe Thornber 6637a30618 [base] Move container_of to own file 2016-02-24 14:42:37 +00:00
Joe Thornber a5a53648c9 Merge branch '2015-08-19-thin-show-duplicates' into merge-thin-ls
Conflicts:
	Makefile.in
	block-cache/block_cache.h
	main.cc
	thin-provisioning/commands.h
2016-02-24 14:31:51 +00:00
Joe Thornber 767c39cf71 [build] switch to c++11
Conflicts:
	Makefile.in
	chunker/cache_stream.cc
	chunker/cache_stream.h
	thin-provisioning/thin_archive.cc
	thin-provisioning/thin_show_duplicates.cc
	unit-tests/Makefile.in
2016-02-16 16:45:44 +00:00
Joe Thornber 1e0d2a16cc [disk_units] add missing header 2016-01-20 18:11:48 +00:00
Joe Thornber d858a43f07 [grid_layout] avoid extra newline at end of grid 2016-01-20 10:40:48 +00:00
Joe Thornber d19164a177 [disk_units] tweak rounding 2016-01-20 09:50:47 +00:00
Joe Thornber e15b11edb1 [thin_ls, base] Factor out grid_layout 2016-01-20 06:58:59 +00:00
Joe Thornber 070b7e6fe1 [disk_units] Don't put a space between numerator and unit 2016-01-19 14:44:06 +00:00
Joe Thornber 7ce4e451ff [base, thin_ls] factor out disk_units code 2016-01-19 11:40:00 +00:00
Joe Thornber c93e728ef4 [base] introduce a command type that gets registered with the app 2016-01-08 12:51:52 +00:00
Joe Thornber 216e5acb6c [thin_show_dups] remove variable number of mems per chunks.
Too slow and not used.
2015-09-04 13:48:02 +01:00
Joe Thornber 3b96812328 [thin_show_dups] switch to boost::circular_buffer in the rolling_hash 2015-09-04 11:28:33 +01:00
Joe Thornber 506b0a8a08 [thin_show_dups] inline some hash functions 2015-09-04 11:10:19 +01:00
Joe Thornber 5d383c0293 [thin_show_dups] get the backup break working in the rolling hash 2015-09-04 10:10:41 +01:00
Joe Thornber 750ce0f47b [thin_show_dups] variable_chunk_stream 2015-09-03 13:02:29 +01:00
Joe Thornber 5f11f5af99 [progress_bar] Tidy up the appearance when at 100% 2015-08-20 11:12:53 +01:00
Joe Thornber a934ee69c4 [error_state] add a sneaky little stream operator to simplify combining error_states 2015-04-08 13:58:41 +01:00
Joe Thornber 408b38a0f8 Forgot error_string.h/cc from previous commit 2015-01-17 10:22:57 +00:00
Joe Thornber f1130198e1 include libgen.h in application.cc for the declaration of basename.
Unfortunately it defines basename as a macro, so also change member
function name from basename() to get_basename().
2015-01-16 10:48:19 +00:00
Joe Thornber dd9bd206c6 Old glibc doesn't provide these macros, so we have to define them.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
2015-01-16 10:12:30 +00:00