Commit Graph

240 Commits

Author SHA1 Message Date
Ming-Hung Tsai
7a1c6dc4bf [space-map-disk] improve performance of finding a free bitmap entry
* Simply test the raw bitmap entries against zero, to avoid
  time-consumed reference-count value extraction.

* Improve the way of iterating entries inside a bitmap:
  Extract 64-bit of bitmap entries at once, and use bitwise shift
  to iterate through the entries.
2020-02-29 17:39:17 +08:00
Ming-Hung Tsai
cb0a77e2ae [block-manager] remove unused copy-assignment operator
block_cache::block is non-copyable, and so are the containing structures.
2020-02-29 00:29:01 +08: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
Ming-Hung Tsai
d6a8c03aa2 [btree_damage_visitor] factor out non-template functions 2020-02-17 11:42:24 +00:00
Joe Thornber
5e5409f48b [space-map/noop] Be explicit about returning an optional
Needed for older version of g++
2019-06-05 11:07:28 +01:00
Joe Thornber
7be9be1494 [space-maps/noop] Add the noops space map
Used when we know we're npt modifying the metadata.
2019-06-04 10:38:58 +01:00
Joe Thornber
aace49cdd6 [thin_repair] work in progress 2019-03-29 12:56:31 +00:00
Ming-Hung Tsai
8abac422b2 [space-map-disk] fix the search range (#117) 2019-01-03 10:46:35 +00:00
Ming-Hung Tsai
788f507e46 [run_set] fix invalid iterator operations (#113) 2018-09-05 11:21:09 +01:00
Ming-Hung Tsai
4b08c7793d [space map] fix accounting of allocatable blocks (#98)
Preserve the input block first to avoid reusing it in subsequent
shadow operations, e.g., shadow another block when releasing
a recursive lock. (issue #97)
2018-06-07 07:45:37 +01:00
Ming-Hung Tsai
582e424560 [space-map-disk] fix the number of free blocks (#93) 2018-04-17 14:00:44 +01:00
csonto
5b5aa971a0 Detect XML in *_check tools (#86)
* [*_check] Detect XML in cache_check and era_check

This is based on previous commit b10d8d4440.

* [*_check] Fix typo in check_superblock
2017-10-05 13:47:10 +01:00
Joe Thornber
3c761e6822 [all tools] Factor out open_bm() and open_tm.
Many duplicates of this code.
2017-10-05 11:53:40 +01:00
Ming-Hung Tsai
591f725232 [space map disk] reduce the lock counts to speed up free block searching (#84)
Avoid repetitively acquiring/releasing the bitmap while finding a free block
2017-09-04 18:05:19 +01:00
Joe Thornber
467be1a69e Add some std namespaces to get tests building.
I guess a rogue header had previously been using the std namespace.
2017-07-24 15:40:17 +01:00
Joe Thornber
209af19a02 [block manager] Don't allow the cache to be bigger than the block dev. 2017-07-24 15:28:23 +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
8f25e1b234 [space-map-disk] optimise updating a ref count 2017-04-11 11:59:49 +01:00
Joe Thornber
db44b5b928 [space-map-disk] Keep track of the allocated prefix so we can start searching in a better place. 2017-04-11 09:40:08 +01:00
Joe Thornber
f2448b17ad [checksum] Switch to a faster implementation of crc32 2017-03-21 12:03:11 -04:00
Joe Thornber
73ae456175 [persistent-data/block] ::exit() if write_ref drops below zero
We were throwing before, which obviously isn't allowed in a destructor.
2017-03-13 13:18:44 +00:00
Ming-Hung Tsai
6863db6f86 [thin] fix duplicated counting of mapped blocks in restore emitter 2016-08-10 23:40:48 +08:00
Joe Thornber
52de2dd38e Merge branch 'v0.7-devel' of github.com:jthornber/thin-provisioning-tools into v0.7-devel 2016-07-11 15:51:58 +01: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
Ming-Hung Tsai
7eac48793c [space map disk] tidy up: add const qualifier 2016-06-20 00:40:10 +08:00
Ming-Hung Tsai
60eb608825 [counting_visitor] fix the path for ValueCounter 2016-06-20 00:30:25 +08:00
Joe Thornber
a3eac8d5d8 Merge branch 'v0.7-devel' of github.com:jthornber/thin-provisioning-tools into v0.7-devel 2016-06-14 16:33:00 +01:00
Joe Thornber
642740e1b6 Merge branch '2016-03-08-cache-writeback' into v0.7-devel 2016-06-14 16:30:16 +01:00
Joe Thornber
b77ba14a2a [block] Use the definition of SECTOR_SHIFT from block-cache 2016-06-14 16:28:14 +01:00
Ming-Hung Tsai
2203e2b513 [btree_node_checker] tidy up the code
1. Add const qualifiers
2. Add virtual destructor
2016-05-20 00:53:35 +08:00
Joe Thornber
3c02151a4f Merge branch 'master' into v0.7-devel
Conflicts:
	persistent-data/file_utils.cc
	persistent-data/file_utils.h
2016-04-05 13:13:10 +01:00
Thanos Makatos
ab958ee752 improve error message when failing to stat block device 2016-04-06 15:56:08 +03:00
Ming-Hung Tsai
810e86e675 [counting_visitor] cleanup: remove redundant statements 2016-04-05 17:05:28 +08:00
Ming-Hung Tsai
9322fc9f14 [btree_damage_visitor] cleanup: remove redundant statements 2016-04-05 16:18:46 +08:00
Ming-Hung Tsai
1dce79bd55 [btree_damage_visitor] cleanup: use btree_node_checker 2016-04-05 16:09:58 +08:00
Ming-Hung Tsai
6dc9a90fec [counting_visitor] fix unnecessary value visiting
1. Do not inherit btree_damage_visitor to avoid unnecessary
   value visiting.
   (reverts commit b22495997a)
2. Use btree_node_checker to do node checking
2016-04-05 16:09:58 +08:00
Ming-Hung Tsai
4a4dc1a5e0 [btree_node_checker] first draft
Spin-off from btree_damage_visitor
2016-04-03 00:43:43 +08:00
Joe Thornber
2288fc4565 Merge branch 'master' into 2016-02-03-fix-thin-trim 2016-03-31 16:39:54 +01:00
Joe Thornber
8b2ec7a3aa Merge branch 'master' into v0.7-devel
Conflicts:
	VERSION
	persistent-data/space-maps/disk.cc
	persistent-data/space-maps/disk.h
2016-03-22 12:04:51 +00:00
Joe Thornber
a21f97e405 [space map disk] Add get_nr_blocks_in_data_sm()
which just uses the root
2016-03-21 17:16:41 +00:00
Joe Thornber
8676198e76 [file_utils] rename get_nr_blocks() -> get_nr_metadata_blocks() and introduce get_nr_blocks() 2016-03-04 10:43:58 +00:00
Joe Thornber
3f6cae4ebc [persistent-data] persistent-data/data-structures/btree_key_value_extractor.h doesn't appear to be used
So remove
2016-02-29 11:12:50 +00: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
d068ec8082 Add utility class binary_block_counter 2016-02-27 15:22:09 +08:00
Ming-Hung Tsai
b22495997a Allow counting_visitor to work with damaged btrees 2016-02-27 15:22:00 +08:00
Ming-Hung Tsai
ad03114bf7 Add utility class btree_detail::key_value_extractor 2016-02-27 15:21:44 +08:00
Ming-Hung Tsai
c571a08f6c Add utility class btree_detail::noop_value_visitor 2016-02-27 15:21:32 +08:00
Ming-Hung Tsai
a48227188e Add utility class btree_detail::noop_damage_visitor 2016-02-27 15:21:23 +08:00
Ming-Hung Tsai
778c153c1e [block-cache] Add check_raw() to bcache::validator 2016-02-27 15:21:13 +08:00