Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
redoxfs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
redoxfs
Commits
e869b3b1
Commit
e869b3b1
authored
Aug 11, 2019
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update_path' into 'master'
Update path after frename See merge request
!46
parents
602a63ac
924adef1
Pipeline
#5651
passed with stages
in 2 minutes and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
src/mount/redox/resource.rs
src/mount/redox/resource.rs
+9
-0
src/mount/redox/scheme.rs
src/mount/redox/scheme.rs
+3
-2
No files found.
src/mount/redox/resource.rs
View file @
e869b3b1
...
...
@@ -13,6 +13,7 @@ use filesystem::FileSystem;
pub
trait
Resource
<
D
:
Disk
>
{
fn
block
(
&
self
)
->
u64
;
fn
dup
(
&
self
)
->
Result
<
Box
<
Resource
<
D
>>>
;
fn
set_path
(
&
mut
self
,
path
:
&
str
);
fn
read
(
&
mut
self
,
buf
:
&
mut
[
u8
],
fs
:
&
mut
FileSystem
<
D
>
)
->
Result
<
usize
>
;
fn
write
(
&
mut
self
,
buf
:
&
[
u8
],
fs
:
&
mut
FileSystem
<
D
>
)
->
Result
<
usize
>
;
fn
seek
(
&
mut
self
,
offset
:
usize
,
whence
:
usize
,
fs
:
&
mut
FileSystem
<
D
>
)
->
Result
<
usize
>
;
...
...
@@ -63,6 +64,10 @@ impl<D: Disk> Resource<D> for DirResource {
}))
}
fn
set_path
(
&
mut
self
,
path
:
&
str
)
{
self
.path
=
path
.to_string
();
}
fn
read
(
&
mut
self
,
buf
:
&
mut
[
u8
],
_
fs
:
&
mut
FileSystem
<
D
>
)
->
Result
<
usize
>
{
let
data
=
self
.data
.as_ref
()
.ok_or
(
Error
::
new
(
EISDIR
))
?
;
let
mut
i
=
0
;
...
...
@@ -284,6 +289,10 @@ impl<D: Disk> Resource<D> for FileResource {
}))
}
fn
set_path
(
&
mut
self
,
path
:
&
str
)
{
self
.path
=
path
.to_string
();
}
fn
read
(
&
mut
self
,
buf
:
&
mut
[
u8
],
fs
:
&
mut
FileSystem
<
D
>
)
->
Result
<
usize
>
{
if
self
.flags
&
O_ACCMODE
==
O_RDWR
||
self
.flags
&
O_ACCMODE
==
O_RDONLY
{
let
count
=
fs
.read_node
(
self
.block
,
self
.seek
,
buf
)
?
;
...
...
src/mount/redox/scheme.rs
View file @
e869b3b1
...
...
@@ -522,8 +522,8 @@ impl<D: Disk> Scheme for FileScheme<D> {
// println!("Frename {}, {} from {}, {}", id, path, uid, gid);
let
files
=
self
.files
.borrow_mut
();
if
let
Some
(
file
)
=
files
.get
(
&
id
)
{
let
mut
files
=
self
.files
.borrow_mut
();
if
let
Some
(
file
)
=
files
.get
_mut
(
&
id
)
{
//TODO: Check for EINVAL
// The new pathname contained a path prefix of the old, or, more generally,
// an attempt was made to make a directory a subdirectory of itself.
...
...
@@ -607,6 +607,7 @@ impl<D: Disk> Scheme for FileScheme<D> {
fs
.insert_blocks
(
orig
.0
,
BLOCK_SIZE
,
parent
.0
)
?
;
}
file
.set_path
(
path
);
Ok
(
0
)
}
else
{
Err
(
Error
::
new
(
EPERM
))
...
...
Write
Preview
Markdown
is supported
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