Commit graph

81 commits

Author SHA1 Message Date
Szymon Walter 7e2b3bc2f1 give SectorSize the 'static lifetime 2018-03-22 09:57:32 +01:00
Szymon Walter 36f13bea2a Reformat
- `length::Length` was renamed as `size::Size` to better reflect the
 purpose
 - `sector::Size` was renamed as `sector::SectorSize`
 - lifetime names were given meaning (etc. `'vol`, `'inode`)
 - `Volume` and `Length` were changed to be generic over `S:
 SectorSize`, instead of `Idx` and now use `Address<S>` as the only
 addressing (indexing) type
2018-03-22 09:37:22 +01:00
Szymon Walter e0e2807425 Merge branch 'master' of github.com:pi-pi3/ext2-rs 2018-03-22 01:06:55 +01:00
Szymon Walter bebfa33564 Implement a directory entry iterator for inode
Calling `directory()` on an `Inode` returns an `Iterator` over entries in
a directory at that `Inode`, it it's a directory, or `None` otherwise.

An example of recursively walking the directory tree is included in test
`walkdir`.

This takes us a step closer to `fopen` (#2)
2018-03-22 01:02:05 +01:00
Szymon Walter f83ad71b3c enable reading the entire contents of inodes 2018-03-21 23:05:41 +01:00
Szymon Walter 117b8d4e75 redo error handling 2018-03-21 20:40:39 +01:00
Szymon Walter 934266ca4b add constraints to Size trait 2018-03-21 18:54:50 +01:00
Szymon Walter ec479815aa Merge pull request #3 from pi-pi3/dev
Merge Dev
2018-03-21 18:46:08 +01:00
Szymon Walter c42fb978c2 add README and LICENSE 2018-03-21 18:45:07 +01:00
Szymon Walter d5423d7199 Change sector::Address implementation to use u32
This way a `u64` is guaranteed to be able to index specific bytes in a
Volume.
2018-03-21 18:17:36 +01:00
Szymon Walter e6218401ce implement doubly indirect pointer tables 2018-03-20 15:44:12 +01:00
Szymon Walter 30aed8bde7 add an InodeBlocks Iterator for iterating over the blocks of an inode 2018-03-20 15:17:16 +01:00
Szymon Walter 83a9d706a3 rename Volume::len to Volume::size 2018-03-20 14:56:09 +01:00
Szymon Walter d24fde3c3d fix safe read reading zero bytes 2018-03-20 14:34:06 +01:00
Szymon Walter 2a755f740d fix sector::Address::with_block_size 2018-03-20 13:42:52 +01:00
Szymon Walter 6c2dc293e0 shorten too long lines 2018-03-20 12:58:39 +01:00
Szymon Walter a1436f2d26 satisfy lints 2018-03-20 12:57:00 +01:00
Szymon Walter 02f70ee974 add 1024 sized sectors 2018-03-20 12:53:27 +01:00
Szymon Walter ce162aae90 rename buffer to volume to better reflect its purpose 2018-03-20 12:49:44 +01:00
Szymon Walter ab069b60e6 rename block to sector to better reflect its purpose 2018-03-20 12:46:27 +01:00
Szymon Walter 6e86749246 fix bad log(block_size) 2018-03-20 12:39:45 +01:00
Szymon Walter fbdbeb2842 fix Address::sub 2018-03-20 12:38:22 +01:00
Szymon Walter 764c4de6bf fix with_block_size 2018-03-20 12:35:05 +01:00
Szymon Walter 7c57c047bc make Buffer generic over its index, instead of usize 2018-03-20 12:30:36 +01:00
Szymon Walter 7e0af1b8f6 add generic Idx type argument to Buffer and Length 2018-03-20 11:05:56 +01:00
Szymon Walter 88b1e3b668 impl Step for block Address to allow range iterating 2018-03-20 10:42:22 +01:00
Szymon Walter 63f0203601 add assert to block address unsafe constructos 2018-03-20 10:33:17 +01:00
Szymon Walter 2966b628fa rewrite how block addresses are constructed 2018-03-20 10:30:40 +01:00
Szymon Walter 677c072b45 fix arithmetic errors 2018-03-20 10:21:05 +01:00
Szymon Walter b55633205e add block_size and log_block_size methods to Address 2018-03-20 10:16:30 +01:00
Szymon Walter e6ebd09b3e derive PartialOrd and Ord for Address 2018-03-20 10:14:24 +01:00
Szymon Walter 69b3ba7552 impl Debug, LowerHex, Display for Address 2018-03-20 10:13:21 +01:00
Szymon Walter 3dca5904a1 i accidentaly 2018-03-20 10:03:18 +01:00
Szymon Walter 5cfa684c03 rename ext2.bin to ext2.img 2018-03-20 10:03:09 +01:00
Szymon Walter e456764a20 rename ext2.bin to ext2.img to better reflect its contents 2018-03-20 10:01:44 +01:00
Szymon Walter cb1de4b2e3 add a way to address block in an ext2 fs 2018-03-20 07:21:24 +01:00
Szymon Walter f816ebdbe7 allow indexing inodes independent of the block group 2018-03-19 21:42:45 +01:00
Szymon Walter d1905db917 make update_global and update_inode private 2018-03-19 21:09:48 +01:00
Szymon Walter 95533395d9 add methods for querying and manipulating inodes to Ext2 2018-03-19 20:49:59 +01:00
Szymon Walter 7dd27917bd add in_use method for Inode to check whether there are any hard links 2018-03-19 20:42:27 +01:00
Szymon Walter c798b2bdb2 add Debug impls 2018-03-19 20:38:32 +01:00
Szymon Walter eef8f86e8b add find_inode function do impl Inode 2018-03-19 20:25:35 +01:00
Szymon Walter 6ce24624a7 add version and inode_size methods 2018-03-19 19:55:22 +01:00
Szymon Walter 1415941a96 update update_global method on Ext2 2018-03-19 19:41:45 +01:00
Szymon Walter fb1b5bdef5 fix unsafe keywords 2018-03-19 19:36:30 +01:00
Szymon Walter 959572eca1 mark Superblock::find unsafe; add test 2018-03-19 19:33:56 +01:00
Szymon Walter 0fc2c934d9 add offset argument to BlockGroupDescriptor::find_... 2018-03-19 19:33:20 +01:00
Szymon Walter 35170f2aee add block group descriptor table loading to Ext2 struct 2018-03-19 19:32:36 +01:00
Szymon Walter f1b5d2b2a0 rewrite fs to init in new 2018-03-19 18:38:33 +01:00
Szymon Walter e6acaad9a9 port BlockGroupDescriptor table finding to Buffer 2018-03-19 18:10:27 +01:00