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
c44a5101
Commit
c44a5101
authored
Apr 22, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use log.Printf for errors.
parent
547051cf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
13 deletions
+6
-13
fuse/fuse.go
fuse/fuse.go
+6
-13
No files found.
fuse/fuse.go
View file @
c44a5101
...
...
@@ -80,8 +80,6 @@ type MountState struct {
}
// Mount filesystem on mountPoint.
//
// TODO - error handling should perhaps be user-serviceable.
func
(
me
*
MountState
)
Mount
(
mountPoint
string
)
os
.
Error
{
file
,
mp
,
err
:=
mount
(
mountPoint
)
if
err
!=
nil
{
...
...
@@ -104,10 +102,6 @@ func (me *MountState) Unmount() os.Error {
return
result
}
func
(
me
*
MountState
)
Error
(
err
os
.
Error
)
{
log
.
Println
(
"error: "
,
err
)
}
func
(
me
*
MountState
)
Write
(
req
*
request
)
{
if
req
.
outHeaderBytes
==
nil
{
return
...
...
@@ -122,8 +116,8 @@ func (me *MountState) Write(req *request) {
}
if
err
!=
nil
{
me
.
Error
(
os
.
NewError
(
fmt
.
Sp
rintf
(
"writer: Write/Writev %v failed, err: %v. Opcode: %v"
,
req
.
outHeaderBytes
,
err
,
operationName
(
req
.
inHeader
.
Opcode
))
))
log
.
P
rintf
(
"writer: Write/Writev %v failed, err: %v. Opcode: %v"
,
req
.
outHeaderBytes
,
err
,
operationName
(
req
.
inHeader
.
Opcode
))
}
}
...
...
@@ -239,8 +233,7 @@ func (me *MountState) Loop(threaded bool) {
break
}
readErr
:=
os
.
NewError
(
fmt
.
Sprintf
(
"Failed to read from fuse conn: %v"
,
err
))
me
.
Error
(
readErr
)
log
.
Printf
(
"Failed to read from fuse conn: %v"
,
err
)
break
}
...
...
@@ -257,7 +250,7 @@ func (me *MountState) Loop(threaded bool) {
func
(
me
*
MountState
)
chopMessage
(
req
*
request
)
*
operationHandler
{
inHSize
:=
unsafe
.
Sizeof
(
InHeader
{})
if
len
(
req
.
inputBuf
)
<
inHSize
{
me
.
Error
(
os
.
NewError
(
fmt
.
Sprintf
(
"Short read for input header: %v"
,
req
.
inputBuf
))
)
log
.
Printf
(
"Short read for input header: %v"
,
req
.
inputBuf
)
return
nil
}
...
...
@@ -266,13 +259,13 @@ func (me *MountState) chopMessage(req *request) *operationHandler {
handler
:=
getHandler
(
req
.
inHeader
.
Opcode
)
if
handler
==
nil
||
handler
.
Func
==
nil
{
log
.
Print
ln
(
"Unknown opcode %d (input)"
,
req
.
inHeader
.
Opcode
)
log
.
Print
f
(
"Unknown opcode %d (input)"
,
req
.
inHeader
.
Opcode
)
req
.
status
=
ENOSYS
return
handler
}
if
len
(
req
.
arg
)
<
handler
.
InputSize
{
log
.
Print
ln
(
"Short read for %v: %v"
,
req
.
inHeader
.
Opcode
,
req
.
arg
)
log
.
Print
f
(
"Short read for %v: %v"
,
req
.
inHeader
.
Opcode
,
req
.
arg
)
req
.
status
=
EIO
return
handler
}
...
...
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