Skip to content

Commit b0f1396

Browse files
committed
Proofread
1 parent 9a6f991 commit b0f1396

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

README.md

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ tables for inodes and files are set when the inode is accessed. The initial step
1313
before accessing an inode involves a lookup process. The inode for a file is
1414
identified by invoking the lookup handler of the parent inode.
1515

16-
## Current features
16+
## Features
1717

1818
* Directories: create, remove, list, rename;
1919
* Regular files: create, remove, read/write (through page cache), rename;
2020
* Hard/Symbolic links (also symlink or soft link): create, remove, rename;
2121
* No extended attribute support
2222

23-
## Prerequisite
23+
## Prerequisites
2424

2525
Install linux kernel header in advance.
2626
```shell
@@ -84,11 +84,20 @@ At present, simplefs only provides straightforward features.
8484
Each block is 4 KiB large.
8585

8686
### Superblock
87-
The superblock is the first block of the partition (block 0). It contains the partition's metadata, such as the number of blocks, number of inodes, number of free inodes/blocks, ...
87+
The superblock, located at the first block of the partition (block 0), stores
88+
the partition's metadata. This includes the total number of blocks, the total
89+
number of inodes, and the counts of free inodes and blocks.
8890

8991
### Inode store
90-
Contains all the inodes of the partition. The maximum number of inodes is equal to the number of blocks of the partition. Each inode contains 72 B of data: standard data such as file size and number of used blocks, as well as a simplefs-specific field `ei_block`. This block contains:
91-
- for a directory: the list of files in this directory. A directory can contain at most 40920 files, and filenames are limited to 255 characters to fit in a single block.
92+
This section contains all the inodes of the partition, with the maximum number
93+
of inodes being equal to the number of blocks in the partition. Each inode
94+
occupies 72 bytes of data, encompassing standard information such as the file
95+
size and the number of blocks used, in addition to a simplefs-specific field
96+
named `ei_block`. This field, `ei_block`, serves different purposes depending
97+
on the type of file:
98+
- For a directory, it contains the list of files within that directory.
99+
A directory can hold a maximum of 40,920 files, with filenames restricted
100+
to a maximum of 255 characters to ensure they fit within a single block.
92101
```
93102
inode
94103
+-----------------------+
@@ -110,7 +119,10 @@ Contains all the inodes of the partition. The maximum number of inodes is equal
110119
+----------------+
111120
112121
```
113-
- for a file: the list of extents containing the actual data of this file. Since block IDs are stored as `sizeof(struct simplefs_extent)` bytes values, at most 341 links fit in a single block, limiting the size of a file to around 10.65 MiB (10912 KiB).
122+
- For a file, it lists the extents that hold the actual data of the file.
123+
Given that block IDs are stored as values of `sizeof(struct simplefs_extent)`
124+
bytes, a single block can accommodate up to 341 links. This limitation
125+
restricts the maximum size of a file to approximately 10.65 MiB (10,912 KiB).
114126
```
115127
inode
116128
+-----------------------+
@@ -137,10 +149,13 @@ Contains all the inodes of the partition. The maximum number of inodes is equal
137149
```
138150

139151
### Extent support
140-
The extent covers consecutive blocks, we allocate consecutive disk blocks for it at a single time. It is described by `struct simplefs_extent` which contains three members:
141-
- `ee_block`: first logical block extent covers.
142-
- `ee_len`: number of blocks covered by extent.
143-
- `ee_start`: first physical block extent covers.
152+
An extent spans consecutive blocks; therefore, we allocate consecutive disk blocks
153+
for it in a single operation. It is defined by `struct simplefs_extent`, which
154+
comprises three members:
155+
- `ee_block`: the first logical block that the extent covers.
156+
- `ee_len`: the number of blocks the extent covers.
157+
- `ee_start`: the first physical block that the extent covers."
158+
144159
```
145160
struct simplefs_extent
146161
+----------------+
@@ -155,7 +170,6 @@ struct simplefs_extent
155170
+---------+
156171
211 | |
157172
+---------+
158-
159173
```
160174

161175
## TODO
@@ -164,5 +178,5 @@ struct simplefs_extent
164178

165179
## License
166180

167-
`simplefs` is released under the BSD 2 clause license. Use of this source code is governed by
168-
a BSD-style license that can be found in the LICENSE file.
181+
`simplefs` is released under the BSD 2 clause license. Use of this source code
182+
is governed by a BSD-style license that can be found in the LICENSE file.

0 commit comments

Comments
 (0)