-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Tree-Based File System | ||
|
||
![GitHub](https://img.shields.io/github/license/your-username/tree-based-file-system) | ||
![GitHub last commit](https://img.shields.io/github/last-commit/your-username/tree-based-file-system) | ||
|
||
This repository contains a thread-safe, real tree-based (not inodes) file system implementation written in C. | ||
It was developed as part of a course at University of Warsaw (MIMUW). What was difficult about it? | ||
I had to implement a method `tree_move`, which operated on 2 subtrees of the file system at the same time, | ||
and thus it was very difficult to lock the nodes in a correct order. The naive solution was to lock the root | ||
of the file system. A better solution was to find the LCA of the two subtrees and lock it. But to do it | ||
without locking the whole subtree under the LCA, one had to very carefully DFS-traverse (not BFS! because it doesn't preserve the preorder) the tree, | ||
locking the nodes in `reader` mode, then the target nodes in `writer` node (yes, I have also implemented my own version of `rwlock`, a lock which can be locked | ||
either in reader or writer mode). Doing it wrong resulted in a deadlock which happened *very* rarely, so every iteration of working on the synchronization algorithm required *extensive* testing :) | ||
|
||
## Table of Contents | ||
|
||
- [Introduction](#introduction) | ||
- [Features](#features) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
|
||
## Introduction | ||
|
||
The Tree-Based File System is a data structure that simulates a file system hierarchy. It allows the creation, deletion, and navigation of directories and files within a virtual file system. The implementation is designed to be thread-safe, allowing multiple threads to interact with the file system concurrently without data corruption or inconsistencies. | ||
|
||
## Features | ||
|
||
- Thread-safe operations: The file system is designed to be accessed and modified by multiple threads simultaneously while ensuring data integrity and consistency. | ||
- Directory support: The file system supports the creation and management of directories, allowing for the organization of files in a hierarchical manner. | ||
- File operations: No files! that's not a very usable file system :) it would be trivial to add them, but for educational purposes, everything is a directory | ||
- Lightweight and efficient: The implementation is designed to be efficient, ensuring minimal overhead during operations. | ||
|
||
## Contributing | ||
Contributions to the Tree-Based File System project are welcome! If you find any bugs, have suggestions for improvements, or would like to add new features, please feel free to open an issue or submit a pull request. | ||
|
||
When contributing to this repository, please ensure that your code follows the established coding conventions, and include appropriate tests to maintain the project's reliability. | ||
|
||
## License | ||
This project is licensed under the MIT License - see the LICENSE file for details. | ||
|
||
We hope you find the Tree-Based File System useful for your needs. If you encounter any issues or have any questions, feel free to open an issue or contact the project maintainers. | ||
|
||
Happy coding! |