Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
redoxfs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Will Angenent
redoxfs
Commits
47c9acc4
Commit
47c9acc4
authored
7 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Version 3 - bump block size to 4096
parent
513bfaf8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/header.rs
+6
-9
6 additions, 9 deletions
src/header.rs
src/lib.rs
+3
-1
3 additions, 1 deletion
src/lib.rs
with
9 additions
and
10 deletions
src/header.rs
+
6
−
9
View file @
47c9acc4
...
@@ -3,14 +3,14 @@ use std::ops::{Deref, DerefMut};
...
@@ -3,14 +3,14 @@ use std::ops::{Deref, DerefMut};
use
uuid
::
Uuid
;
use
uuid
::
Uuid
;
use
BLOCK_SIZE
;
use
{
BLOCK_SIZE
,
SIGNATURE
,
VERSION
}
;
/// The header of the filesystem
/// The header of the filesystem
#[repr(packed)]
#[repr(packed)]
pub
struct
Header
{
pub
struct
Header
{
/// Signature, should be
b"RedoxFS\0"
/// Signature, should be
SIGNATURE
pub
signature
:
[
u8
;
8
],
pub
signature
:
[
u8
;
8
],
/// Version, should be
1
/// Version, should be
VERSION
pub
version
:
u64
,
pub
version
:
u64
,
/// Disk ID, a 128-bit unique identifier
/// Disk ID, a 128-bit unique identifier
pub
uuid
:
[
u8
;
16
],
pub
uuid
:
[
u8
;
16
],
...
@@ -25,9 +25,6 @@ pub struct Header {
...
@@ -25,9 +25,6 @@ pub struct Header {
}
}
impl
Header
{
impl
Header
{
pub
const
SIGNATURE
:
&
'static
[
u8
;
8
]
=
b"RedoxFS
\0
"
;
pub
const
VERSION
:
u64
=
2
;
pub
fn
default
()
->
Header
{
pub
fn
default
()
->
Header
{
Header
{
Header
{
signature
:
[
0
;
8
],
signature
:
[
0
;
8
],
...
@@ -43,8 +40,8 @@ impl Header {
...
@@ -43,8 +40,8 @@ impl Header {
pub
fn
new
(
size
:
u64
,
root
:
u64
,
free
:
u64
)
->
Header
{
pub
fn
new
(
size
:
u64
,
root
:
u64
,
free
:
u64
)
->
Header
{
let
uuid
=
Uuid
::
new_v4
();
let
uuid
=
Uuid
::
new_v4
();
Header
{
Header
{
signature
:
*
Header
::
SIGNATURE
,
signature
:
*
SIGNATURE
,
version
:
Header
::
VERSION
,
version
:
VERSION
,
uuid
:
*
uuid
.as_bytes
(),
uuid
:
*
uuid
.as_bytes
(),
size
:
size
,
size
:
size
,
root
:
root
,
root
:
root
,
...
@@ -54,7 +51,7 @@ impl Header {
...
@@ -54,7 +51,7 @@ impl Header {
}
}
pub
fn
valid
(
&
self
)
->
bool
{
pub
fn
valid
(
&
self
)
->
bool
{
&
self
.signature
==
Header
::
SIGNATURE
&&
self
.version
==
Header
::
VERSION
&
self
.signature
==
SIGNATURE
&&
self
.version
==
VERSION
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
3
−
1
View file @
47c9acc4
...
@@ -6,7 +6,9 @@
...
@@ -6,7 +6,9 @@
extern
crate
syscall
;
extern
crate
syscall
;
extern
crate
uuid
;
extern
crate
uuid
;
pub
const
BLOCK_SIZE
:
u64
=
512
;
pub
const
BLOCK_SIZE
:
u64
=
4096
;
pub
const
SIGNATURE
:
&
'static
[
u8
;
8
]
=
b"RedoxFS
\0
"
;
pub
const
VERSION
:
u64
=
3
;
pub
use
self
::
disk
::{
Disk
,
DiskCache
,
DiskFile
};
pub
use
self
::
disk
::{
Disk
,
DiskCache
,
DiskFile
};
pub
use
self
::
ex_node
::
ExNode
;
pub
use
self
::
ex_node
::
ExNode
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment