| blocks | u64 | Size of the filesystem if `frsize` units |
| bfree | u64 | Number of free blocks |
| bavail | u64 | Number of free blocks for unprivileged users |
| files | u64 | Number of inodes |
| ffree | u64 | Number of free inodes |
| namemax | u64 | Maximum filename length |
## Messages
| Field | Type | Descripton |
@ -246,6 +265,22 @@ The `id` is just a number without any meaning for the `webfuse2 provider`. It is
Most responses contain a `result` encoding the status of the operation. While successful responses may contain additional data, erroneous responses must not be decoded by a `webfuse2 service` implementation beyond the `result` value.
### Unknown requests
There are two reserved message types in `webfuse2`:
- **0x00:** Unknown request
- **0x80:** Unknown response
A `webfuse2 service` may send a request of type `unknown request` for conformance testing reasons.
Since each request requires a response, a `webfuse2 provider` must respond to any unknown requests with a message of `unknown response` type. This allows to add new request types in future.
### Accept additional data in requests
Both, a `webfuse2 provider` and a `webfuse service` must accept messages that contain more data than specified. This allows to add optional fields to existing requests and / or responses in future.
_Note there are no optional fields in the current revision of the `webfuse2 protocol`.
### Message Types
_Note that the following numbers are in `hexadecimal` notation._
@ -631,17 +666,24 @@ Read from a file description (see [man read(2)](https://man7.org/linux/man-pages
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x90) |
| result | result | operation status |
| result | result | amount of byte read or error code |
| data | bytes | requested data |
_Note that results returns the amount of bytes read on success._
### write
Write to a file (see [man write(2)](https://man7.org/linux/man-pages/man2/write.2.html), [man pread(2)](https://man7.org/linux/man-pages/man2/pread.2.html)).
#### Request
| Field | Data Type | Description |
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x17) |
| data | bytes | data to write |
| offset | u64 | offset to write to |
| handle | handle (u64) | handle of the file |
#### Response
@ -649,16 +691,22 @@ Read from a file description (see [man read(2)](https://man7.org/linux/man-pages
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x91) |
| result | result | operation status |
| result | result | amount of bytes written or error code |
_Note that results returns the amount of bytes written on success._
### mkdir
Create a directory (see [man mkdir(2)](https://man7.org/linux/man-pages/man2/mkdir.2.html)).
#### Request
| Field | Data Type | Description |
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x12) |
| path | string | path of the directory |
| mode | mode (u32) | directory permissions |
#### Response
@ -670,12 +718,15 @@ Read from a file description (see [man read(2)](https://man7.org/linux/man-pages
### readdir
Reads the contents of a directory.
#### Request
| Field | Data Type | Description |
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x13) |
| path | string | path of the directory |
#### Response
@ -684,15 +735,19 @@ Read from a file description (see [man read(2)](https://man7.org/linux/man-pages
| id | u32 | message id |
| type | u8 | message type (0x93) |
| result | result | operation status |
| items | strings | names of the directory entries |
### rmdir
Delete a directory (see [man rmdir(2)](https://man7.org/linux/man-pages/man2/rmdir.2.html)).
#### Request
| Field | Data Type | Description |
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x14) |
| path | string | path of the directory |
#### Response
@ -704,12 +759,15 @@ Read from a file description (see [man read(2)](https://man7.org/linux/man-pages
### statfs
Get filesystem statistics (see [man statvfs(3)](https://man7.org/linux/man-pages/man3/statvfs.3.html)).
#### Request
| Field | Data Type | Description |
| ------ | --------- | ----------- |
| id | u32 | message id |
| type | u8 | message type (0x15) |
| path | string | path of the file |
#### Response
@ -718,6 +776,7 @@ Read from a file description (see [man read(2)](https://man7.org/linux/man-pages