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
dd1fcfed
Commit
dd1fcfed
authored
Jul 27, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed more build errors.
parent
d6d4cb87
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
connection.go
connection.go
+12
-4
ops.go
ops.go
+17
-0
No files found.
connection.go
View file @
dd1fcfed
...
@@ -91,7 +91,7 @@ type Connection struct {
...
@@ -91,7 +91,7 @@ type Connection struct {
type
opState
struct
{
type
opState
struct
{
inMsg
*
buffer
.
InMessage
inMsg
*
buffer
.
InMessage
op
fuseops
.
Op
op
fuseops
.
Op
opID
uint
64
// For logging
opID
uint
32
// For logging
}
}
// Create a connection wrapping the supplied file descriptor connected to the
// Create a connection wrapping the supplied file descriptor connected to the
...
@@ -407,7 +407,7 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
...
@@ -407,7 +407,7 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
}
}
// Convert the message to an op.
// Convert the message to an op.
op
,
err
:
=
convertInMessage
(
m
,
c
.
protocol
)
op
,
err
=
convertInMessage
(
m
,
c
.
protocol
)
if
err
!=
nil
{
if
err
!=
nil
{
err
=
fmt
.
Errorf
(
"convertInMessage: %v"
,
err
)
err
=
fmt
.
Errorf
(
"convertInMessage: %v"
,
err
)
return
return
...
@@ -420,14 +420,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
...
@@ -420,14 +420,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
c
.
debugLog
(
opID
,
1
,
"<- %#v"
,
op
)
c
.
debugLog
(
opID
,
1
,
"<- %#v"
,
op
)
// Special case: handle interrupt requests inline.
// Special case: handle interrupt requests inline.
if
interruptOp
,
ok
:=
op
.
(
*
fuseops
.
I
nternalInterruptOp
);
ok
{
if
interruptOp
,
ok
:=
op
.
(
*
i
nternalInterruptOp
);
ok
{
c
.
handleInterrupt
(
interruptOp
.
FuseID
)
c
.
handleInterrupt
(
interruptOp
.
FuseID
)
continue
continue
}
}
// Set up a context that remembers information about this op.
// Set up a context that remembers information about this op.
ctx
=
c
.
beginOp
(
m
.
Header
()
.
Opcode
,
m
.
Header
()
.
Unique
)
ctx
=
c
.
beginOp
(
m
.
Header
()
.
Opcode
,
m
.
Header
()
.
Unique
)
ctx
=
context
.
WithValue
(
ctx
,
contextKey
,
opState
{
m
,
op
ID
,
op
})
ctx
=
context
.
WithValue
(
ctx
,
contextKey
,
opState
{
m
,
op
,
opID
})
// Special case: responding to statfs is required to make mounting work on
// Special case: responding to statfs is required to make mounting work on
// OS X. We don't currently expose the capability for the file system to
// OS X. We don't currently expose the capability for the file system to
...
@@ -442,6 +442,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
...
@@ -442,6 +442,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
}
}
}
}
// Reply to an op previously read using ReadOp, with the supplied error (or nil
// if successful). The context must be the context returned by ReadOp.
//
// LOCKS_EXCLUDED(c.mu)
func
(
c
*
Connection
)
Reply
(
ctx
context
.
Context
,
err
error
)
{
panic
(
"TODO"
)
}
// Close the connection. Must not be called until operations that were read
// Close the connection. Must not be called until operations that were read
// from the connection have been responded to.
// from the connection have been responded to.
func
(
c
*
Connection
)
close
()
(
err
error
)
{
func
(
c
*
Connection
)
close
()
(
err
error
)
{
...
...
ops.go
View file @
dd1fcfed
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
package
fuse
package
fuse
import
(
import
(
"fmt"
"syscall"
"syscall"
"unsafe"
"unsafe"
...
@@ -151,6 +152,22 @@ func kernelResponse(
...
@@ -151,6 +152,22 @@ func kernelResponse(
// Internal
// Internal
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
// A sentinel used for unknown ops. The user is expected to respond with a
// non-nil error.
type
unknownOp
struct
{
opCode
uint32
inode
fuseops
.
InodeID
}
func
(
o
*
unknownOp
)
ShortDesc
()
(
desc
string
)
{
desc
=
fmt
.
Sprintf
(
"<opcode %d>(inode=%v)"
,
o
.
opCode
,
o
.
inode
)
return
}
func
(
o
*
unknownOp
)
DebugString
()
string
{
return
o
.
ShortDesc
()
}
// Common implementation for our "internal" ops that don't need to be pretty.
// Common implementation for our "internal" ops that don't need to be pretty.
type
internalOp
struct
{
type
internalOp
struct
{
}
}
...
...
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