Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add File System #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add File System #7

wants to merge 1 commit into from

Conversation

rupeshkoushik07
Copy link
Member

This doc gives you all the info about filesystem.rs, from its Inode structure to its metadata management, write-ahead logging, and path traversal tools.


- **File**: Represents a standard file that contains data.
- **CharDev**: Denotes a character device such as `/dev/null` or `/dev/zero`, including random number generators.
- **Socket**: Represents a Unix domain socket, used for inter-process communication.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for all sockets not just unix


- **Common Metadata (all Inode types)**:
- `size`: Size of the file in bytes.
- `uid`, `gid`: User and group identity numbers.
Copy link
Member

@JustinCappos JustinCappos May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more useful to explain how we handle things like uid / gid. Do they have a meaning in our current implementation? Do they get set with setuid, etc.? Are the mode bits checked?

So, instead of just documenting the fields, it may be better to explain how what we have done differs from POSIX so a developer knows what to expect. (This is a general comment, not meant to only apply to uid, gid, etc.)

- `log_metadata`: Adds a log entry (inode number and potentially some inode data) to a log file, enabling crash recovery or the ability to undo certain changes.
- `persist_metadata`: Serializes the entire FilesystemMetadata object and writes its data onto disk, allowing the system to remember the state of the filesystem.

# Path Traversal
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a bit more explanation of how these functions work under the hood would be extremely helpful.


## Write Ahead Logging

- **Log File**: Modifications to filesystem metadata are initially recorded in the "lind.md.log" file before being committed to actual metadata structures.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a little bit more here would also be useful. Espeically explaining when we log

Copy link
Collaborator

@rennergade rennergade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start, we've requested a few places to further enrich this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants