Commit Graph

32 Commits

Author SHA1 Message Date
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
Ming-Hung Tsai
6863db6f86 [thin] fix duplicated counting of mapped blocks in restore emitter 2016-08-10 23:40:48 +08:00
Ming-Hung Tsai
778c153c1e [block-cache] Add check_raw() to bcache::validator 2016-02-27 15:21:13 +08:00
Ming-Hung Tsai
d2260dee34 Show the block address in exception string 2016-02-27 15:04:08 +08:00
Joe Thornber
c32aaab028 [validators] Move the btree node validator into a separate file. 2015-08-11 11:58:07 +01:00
Joe Thornber
b67cc29609 [btree] bad checksum exceptions now mention the block location 2015-08-04 15:12:41 +01:00
Joe Thornber
c8d8af488f [btree] When using lower_bound() assign to an int rather than unsigned
Patch from Ming-Hung Tsai
2015-05-26 14:24:55 +01:00
Joe Thornber
cf903cfea6 [btree] lower bound search should return an empty optional if every entry in the node is higher.
Patch from Ming-Hung Tsai
2015-05-26 14:09:29 +01:00
Joe Thornber
85d1701ba1 [btree_damage_visitor] Check the value_size agrees.
Patch from Ming-Hung Tsai
2015-05-26 12:06:34 +01:00
Joe Thornber
a7c96c0e1e [everything] Fix circular shared pointer references.
We had a cycle from transaction_manager <-> space_map, and also from
the ref_counters back up to the tm.

This prevented objects being destroyed when various programs exited.

From now on we'll try and only use a shared ptr if ownership is
implied.  Otherwise a reference will be used (eg, for up pointers).
2014-08-26 11:14:49 +01:00
Joe Thornber
ecb6bee2b2 prefetch btree nodes when walking a tree 2014-07-25 16:32:59 +01:00
Joe Thornber
7e870ea5a6 start removing block_manager<>::block 2014-07-25 14:46:51 +01:00
Joe Thornber
b32908d5c2 work in progress 2014-07-25 10:35:04 +01:00
Joe Thornber
9470937b10 [btree] When creating a new multilayer btree the initial node should
have block_traits, rather than the ValueTraits.
2014-07-02 15:02:32 +01:00
Joe Thornber
256cd16ab3 node_ref now checks the value_type sizes match, and the data fits within a single block. 2014-06-06 15:05:41 +01:00
Joe Thornber
eb8d4c6f0b Get tools building with g++ 4.8.1 2013-06-25 13:48:02 +01:00
Joe Thornber
83a09e1a2a [btree] use a block_ref_counter for internal nodes 2013-06-20 14:29:48 +01:00
Joe Thornber
e89d81e318 [btree] fix bug in earlier patch. inc_children was always begin called. 2013-06-20 14:26:17 +01:00
Joe Thornber
16c9efc85c [btree] Avoid an extra shadow op in split_sibling 2013-06-20 12:17:59 +01:00
Joe Thornber
c8a5d0753d [btree] factor out inc_children 2013-06-20 12:17:16 +01:00
Joe Thornber
a2e51062e3 [btree] call inc_children when shadowning a btree node. 2013-06-19 17:20:12 +01:00
Joe Thornber
ec99e6fd93 [btree] update the root_ after an insert
!!!
2013-06-19 17:19:24 +01:00
Joe Thornber
480e94d4eb Remove some more global using namespaces 2013-05-28 13:53:23 +01:00
Joe Thornber
6706493304 Remove some global 'using namespace's 2013-05-28 13:48:10 +01:00
Joe Thornber
b0d1fa0851 Sanitise btree_detail::node_location 2013-05-15 13:37:30 +01:00
Joe Thornber
44d0b1903f [btree] allow visitors to trap node access failures such as checksum error. 2013-05-07 15:22:13 +01:00
Joe Thornber
8e0271b3bf [btree] When walking a btree use a validator when taking the locks.
We really can't rely on anything in the block if the checksum is
wrong.
2013-05-07 14:54:20 +01:00
Joe Thornber
a828cde96d [btree] visitor now passed as a reference rather than shared_ptr 2013-05-02 12:31:33 +01:00
Joe Thornber
5d0b23beea Some btree visitor tidying.
Introduce node_location to replace the long list of parameters.  Also
add a depth field to keep track of the depth from root.
2013-05-01 16:16:23 +01:00
Joe Thornber
5367631c8c [various data structures] Reuse validators rather than always creating a new one. 2013-04-26 14:15:20 +01:00
Joe Thornber
f9bf18adf6 Move array_t to gmock 2013-03-22 13:42:20 +00:00
Joe Thornber
aacca8d963 Introduce persistent-data/data-structures/ 2013-01-11 19:26:51 +00:00