Skip to content

Commit 8a67452

Browse files
committed
Added full dir list and rudimentary block allocator
In writing the initial allocator, I ran into the rather difficult problem of trying to iterate through the entire filesystem cheaply and with only constant memory consumption (which prohibits recursive functions). The solution was to simply thread all directory blocks onto a massive linked-list that spans the entire filesystem. With the linked-list it was easy to create a traverse function for all blocks in use on the filesystem (which has potential for other utility), and add the rudimentary block allocator using a bit-vector. While the linked-list may add complexity (especially where needing to maintain atomic operations), the linked-list helps simplify what is currently the most expensive operation in the filesystem, with no cost to space (the linked-list can reuse the pointers used for chained directory blocks).
1 parent ca01b72 commit 8a67452

File tree

7 files changed

+498
-56
lines changed

7 files changed

+498
-56
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ size: $(OBJ)
3131
$(SIZE) -t $^
3232

3333
.SUFFIXES:
34-
test: $(TEST)
34+
test: test_format test_dirs test_files test_alloc
3535
test_%: tests/test_%.sh
3636
./$<
3737

0 commit comments

Comments
 (0)