Commit Graph

108 Commits

Author SHA1 Message Date
Sebastian Messmer
1da3e6cbae - Fix for reading empty files out of bounds
- Fixed race condition (https://github.com/cryfs/cryfs/issues/224 and https://github.com/cryfs/cryfs/issues/243)
2019-01-12 23:21:12 -08:00
Sebastian Messmer
6c006721a7 Make traversal exception safe 2019-01-06 10:25:50 -08:00
Sebastian Messmer
9c6713a00e Fix cryfs-stat 2018-11-10 12:38:57 -08:00
Sebastian Messmer
7ba57b4387 Improve blob initialization by using correct size 2018-09-26 20:27:40 -07:00
Sebastian Messmer
8d21e09159 Introduce fspp::num_bytes_t 2018-09-15 14:32:58 -07:00
Sebastian Messmer
f439bf9d0f Remove c style casts and unaligned memory accesses 2017-12-03 19:01:41 +00:00
Sebastian Messmer
5fe3cada4c Enable some more clang-tidy checks and fix warnings 2017-10-29 16:35:10 +00:00
Sebastian Messmer
e38af1001d Remove unused using statements 2017-10-29 15:47:46 +00:00
Sebastian Messmer
76e7f7da72 Introduce clang-tidy and fix corresponding warnings 2017-10-27 04:02:51 +01:00
Sebastian Messmer
73aab31ade Make LoopThread noncopyable 2017-09-19 20:16:47 +01:00
Sebastian Messmer
5458af7c52 Rename blockstore::Key -> blockstore::BlockId 2017-09-17 02:07:27 +01:00
Sebastian Messmer
f7c089ba47 Fix clang 5.0 compiler warnings 2017-09-16 17:45:15 +01:00
Sebastian Messmer
b027f8c007 Merge from develop 2016-09-24 20:43:54 +02:00
Sebastian Messmer
46183976ee Fix missing virtual destructor and potential integer overflow 2016-09-21 20:07:20 +02:00
Sebastian Messmer
32f06f288a Fix tree traversal and add test case for it 2016-09-07 22:25:18 +02:00
Sebastian Messmer
904e3dd7a1 Merge 2016-09-07 22:07:56 +02:00
Sebastian Messmer
ea349cf79b Fix traversal bug and add test case for it 2016-09-07 19:02:41 +02:00
Sebastian Messmer
a4ce49aef4 Fix unique_ref test cases 2016-07-22 14:07:06 +02:00
Sebastian Messmer
64d26c2f6e Fix compiler error on older gcc 2016-07-22 12:58:59 +02:00
Sebastian Messmer
e38c0f1e8b Fix isRightBorderNode when growing trees 2016-07-17 10:32:59 +02:00
Sebastian Messmer
bbdd8a548b Special case treatment for traversals until exactly the last leaf has to load the last leaf to grow it. Before this commit, we just always loaded the last traversed leaf and checked its size. Now we only do so if it's the right border leaf. This saves us loading some leaves. 2016-07-17 10:16:09 +02:00
Sebastian Messmer
eab7cb1df4 Implement BlockStore::overwrite(). This is the last step in ensuring that the write() call doen't have to load leaves if they're only overwritten anyhow. 2016-07-16 11:42:06 +02:00
Sebastian Messmer
eb792daefc More preparations for not loading blocks in write() calls 2016-07-15 21:06:41 +02:00
Sebastian Messmer
d80b95514e Traversal doesn't load leaves, but returns the key. This way, the write() call can (after a future commit) write to full leaves without loading them beforehand. 2016-07-15 20:12:24 +02:00
Sebastian Messmer
582917c1f5 Improve code decreasing tree depth 2016-07-15 16:23:00 +02:00
Sebastian Messmer
b1b90b8c3d Further reduce number of nodes loaded when deleting a tree and write test cases for it 2016-07-15 15:42:34 +02:00
Sebastian Messmer
c428d5642a Minimize number of Block::write() calls when creating new nodes in a traversal. Also add test cases for it. 2016-07-15 12:48:20 +02:00
Sebastian Messmer
f42e08a5f6 Fix DataTree::key() when called while traversing 2016-07-14 17:56:47 +02:00
Sebastian Messmer
6ff0839e90 Add locking to blob 2016-07-14 16:36:30 +02:00
Sebastian Messmer
3f04a7411c If tree depth increases, and we already traversed the old tree, don't go into it again to grow its last leaf. 2016-07-14 14:23:15 +02:00
Sebastian Messmer
cbe122cb5f Add assertions 2016-07-14 13:23:36 +02:00
Sebastian Messmer
0bb6b320d4 Add asserts 2016-07-14 12:58:42 +02:00
Sebastian Messmer
0dbfdf3e2b When shrinking a tree, LeafTraverser takes care of decreasing tree depth, not DataTree anymore. This way, LeafTraverser is now responsible for increasing and decreasing depth as necessary. 2016-07-14 12:55:54 +02:00
Sebastian Messmer
35a4e42ba5 Small fixes in traversal algorithm 2016-07-14 12:38:25 +02:00
Sebastian Messmer
fce81f47ff Simplify code a bit and add assertions 2016-07-14 12:03:15 +02:00
Sebastian Messmer
9e9369b9ed Performance optimization: When removing or shrinking a tree, we don't load/read leaves anymore. Loading inner nodes is enough to get all block IDs and then we can delete the leaves from their IDs without loading them. 2016-07-13 11:27:31 +02:00
Sebastian Messmer
7a68757599 Remove unneeded subtrees when shrinking tree 2016-07-13 07:08:53 +02:00
Sebastian Messmer
cf38eb0eb3 Use tree traversal to remove data tree. 2016-07-13 00:29:36 +02:00
Sebastian Messmer
508766d2f2 Fix traversal and add test cases 2016-07-13 00:22:35 +02:00
Sebastian Messmer
845b0b5239 Use LeafTraversor for resizing blobs 2016-07-12 20:36:12 +02:00
Sebastian Messmer
a19d79361c If a tree is grown by a traversal, the tree is kept in a balanced state as long as possible during the traversal 2016-07-12 09:57:56 +02:00
Sebastian Messmer
1bf20277e4 Removed unnecessary code 2016-07-12 01:10:27 +02:00
Sebastian Messmer
58f2212043 Don't query size on traversal 2016-07-12 01:09:30 +02:00
Sebastian Messmer
582c9c1a4c Fix traversal 2016-07-12 01:04:33 +02:00
Sebastian Messmer
98b85ea8b6 Started rewriting traversal 2016-07-10 22:57:39 +02:00
Sebastian Messmer
dde89da556 Improve traverseLeaves 2016-07-10 08:38:02 +02:00
Sebastian Messmer
e85019e95b Cache value of DataTree.numLeaves(). This should make read()/write() faster. 2016-07-05 23:56:44 -07:00
Sebastian Messmer
a242076ecc Performance improvement: Allow more parallelity when getting read()/write() syscalls to the same blob 2016-07-05 23:02:59 -07:00
Sebastian Messmer
1c0199e147 When the user specifies a block size for the file system, this is taken as the physical block size, not virtual block size. 2016-03-16 19:30:26 +00:00
Sebastian Messmer
08c1d206af Fix compiler error 2016-03-09 00:13:18 +01:00