Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
Kirill Smelkov
jacobsa-fuse
Commits
aff2fc2f
Commit
aff2fc2f
authored
Jul 22, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ripped out the toBazilfuseResponse logic from commonOp.
parent
f004d3ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
30 deletions
+3
-30
fuseops/common_op.go
fuseops/common_op.go
+3
-30
No files found.
fuseops/common_op.go
View file @
aff2fc2f
...
...
@@ -30,10 +30,8 @@ import (
type
internalOp
interface
{
Op
// Convert to a bazilfuse response compatible with the Respond method on the
// wrapped bazilfuse request. If that Respond method takes no arguments,
// return nil.
toBazilfuseResponse
()
interface
{}
// Respond to the underlying bazilfuse request, successfully.
respond
()
}
// A helper for embedding common behavior.
...
...
@@ -134,7 +132,7 @@ func (o *commonOp) Respond(err error) {
// If successful, we should respond to bazilfuse with the appropriate struct.
if
err
==
nil
{
o
.
sendBazilfuseResponse
(
o
.
op
.
toBazilfuseResponse
()
)
o
.
op
.
respond
(
)
return
}
...
...
@@ -156,28 +154,3 @@ func (o *commonOp) Respond(err error) {
// Send a response to the kernel.
o
.
bazilReq
.
RespondError
(
err
)
}
// Respond with the supplied response struct, which must be accepted by a
// method called Respond on o.bazilReq.
//
// Special case: nil means o.bazilReq.Respond accepts no parameters.
func
(
o
*
commonOp
)
sendBazilfuseResponse
(
resp
interface
{})
{
// Find the Respond method.
v
:=
reflect
.
ValueOf
(
o
.
bazilReq
)
respond
:=
v
.
MethodByName
(
"Respond"
)
// Special case: handle successful ops with no response struct.
if
resp
==
nil
{
o
.
Logf
(
"-> (%s) OK"
,
o
.
op
.
ShortDesc
())
respond
.
Call
([]
reflect
.
Value
{})
return
}
// Otherwise, send the response struct to the kernel.
if
o
.
debugLog
!=
nil
{
o
.
Logf
(
"-> %v"
,
resp
)
}
respond
.
Call
([]
reflect
.
Value
{
reflect
.
ValueOf
(
resp
)})
}
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