Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
449d6e2e
Commit
449d6e2e
authored
Feb 07, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't discard ENOSYS from DefaultFile.
parent
0fa3281f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
fuse/defaultfile.go
fuse/defaultfile.go
+1
-1
fuse/defaultread_test.go
fuse/defaultread_test.go
+58
-0
fuse/opcode.go
fuse/opcode.go
+1
-1
No files found.
fuse/defaultfile.go
View file @
449d6e2e
...
...
@@ -23,7 +23,7 @@ func (f *DefaultFile) String() string {
}
func
(
f
*
DefaultFile
)
Read
(
buf
[]
byte
,
off
int64
)
(
ReadResult
,
Status
)
{
return
&
ReadResultData
{}
,
ENOSYS
return
nil
,
ENOSYS
}
func
(
f
*
DefaultFile
)
Write
(
data
[]
byte
,
off
int64
)
(
uint32
,
Status
)
{
...
...
fuse/defaultread_test.go
0 → 100644
View file @
449d6e2e
package
fuse
import
(
"io/ioutil"
"log"
"os"
"testing"
)
var
_
=
log
.
Println
type
DefaultReadFS
struct
{
DefaultFileSystem
size
uint64
exist
bool
}
func
(
fs
*
DefaultReadFS
)
GetAttr
(
name
string
,
context
*
Context
)
(
*
Attr
,
Status
)
{
if
name
==
""
{
return
&
Attr
{
Mode
:
S_IFDIR
|
0755
},
OK
}
if
name
==
"file"
{
return
&
Attr
{
Mode
:
S_IFREG
|
0644
,
Size
:
fs
.
size
},
OK
}
return
nil
,
ENOENT
}
func
(
fs
*
DefaultReadFS
)
Open
(
name
string
,
f
uint32
,
context
*
Context
)
(
File
,
Status
)
{
return
&
DefaultFile
{},
OK
}
func
defaultReadTest
()
(
root
string
,
cleanup
func
())
{
fs
:=
&
NotifyFs
{}
var
err
error
dir
,
err
:=
ioutil
.
TempDir
(
""
,
"go-fuse"
)
CheckSuccess
(
err
)
pathfs
:=
NewPathNodeFs
(
fs
,
nil
)
state
,
_
,
err
:=
MountNodeFileSystem
(
dir
,
pathfs
,
nil
)
CheckSuccess
(
err
)
state
.
Debug
=
VerboseTest
()
go
state
.
Loop
()
return
dir
,
func
()
{
state
.
Unmount
()
os
.
Remove
(
dir
)
}
}
func
TestDefaultRead
(
t
*
testing
.
T
)
{
root
,
clean
:=
defaultReadTest
()
defer
clean
()
_
,
err
:=
ioutil
.
ReadFile
(
root
+
"/file"
)
if
err
==
nil
{
t
.
Fatal
(
"should have failed read."
)
}
}
fuse/opcode.go
View file @
449d6e2e
...
...
@@ -283,7 +283,7 @@ func doRead(state *MountState, req *request) {
if
fd
,
ok
:=
req
.
readResult
.
(
*
ReadResultFd
);
ok
{
req
.
fdData
=
fd
req
.
flatData
=
nil
}
else
if
req
.
readResult
!=
nil
{
}
else
if
req
.
readResult
!=
nil
&&
req
.
status
.
Ok
()
{
req
.
flatData
,
req
.
status
=
req
.
readResult
.
Bytes
(
buf
)
}
}
...
...
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