Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robin Randhawa
redoxfs
Commits
8c57fd95
Verified
Commit
8c57fd95
authored
Jun 18, 2018
by
jD91mZM2
Browse files
Fix bugs & increase page size
parent
a1c69a8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/mount/redox/scheme.rs
View file @
8c57fd95
...
...
@@ -20,7 +20,7 @@ use super::spin::Mutex;
/// The size to round offset/len up to.
/// This ensures more fmaps can share the same memory even with different parameters.
const
PAGE_SIZE
:
usize
=
8
;
const
PAGE_SIZE
:
usize
=
4096
;
/// The max amount of fmaps that can be held simultaneously.
/// This restriction is here because we can under no circumstances reallocate,
/// that would invalidate previous mappings.
...
...
@@ -38,7 +38,7 @@ impl FmapKey {
FmapKey
{
block
:
self
.block
,
offset
:
self
.offset
-
self
.offset
%
PAGE_SIZE
,
size
:
if
remainder
==
0
{
self
.size
}
else
{
self
.size
-
remainder
+
self
.size
}
size
:
if
remainder
==
0
{
self
.size
}
else
{
self
.size
-
remainder
+
PAGE_SIZE
}
}
}
pub
fn
is_compatible
(
&
self
,
other
:
&
FmapKey
)
->
bool
{
...
...
@@ -68,7 +68,7 @@ impl Fmaps {
let
mut
first_empty
=
None
;
for
(
i
,
entry
)
in
self
.0
.iter_mut
()
.enumerate
()
{
match
entry
{
None
=>
first_empty
=
Some
(
i
),
None
if
first_empty
.is_none
()
=>
first_empty
=
Some
(
i
),
Some
(
entry
)
if
entry
.0
.is_compatible
(
key
)
=>
return
Ok
((
i
,
entry
)),
_
=>
()
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment