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
a07a396c
Commit
a07a396c
authored
Jul 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for init ops.
parent
6a25a107
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
3 deletions
+46
-3
connection.go
connection.go
+3
-3
fuseops/convert.go
fuseops/convert.go
+16
-0
fuseops/ops.go
fuseops/ops.go
+27
-0
No files found.
connection.go
View file @
a07a396c
...
...
@@ -112,9 +112,9 @@ func (c *Connection) Init() (err error) {
return
}
initOp
,
ok
:=
op
.
(
*
fuseops
.
InitOp
)
initOp
,
ok
:=
op
.
(
*
fuseops
.
In
ternalIn
itOp
)
if
!
ok
{
err
=
fmt
.
Errorf
(
"Expected *fuseops.InitOp, got %T"
,
op
)
err
=
fmt
.
Errorf
(
"Expected *fuseops.In
ternalIn
itOp, got %T"
,
op
)
return
}
...
...
@@ -137,7 +137,7 @@ func (c *Connection) Init() (err error) {
}
if
initOp
.
Kernel
.
LT
(
c
.
protocol
)
{
c
.
protocol
=
r
.
Kernel
c
.
protocol
=
initOp
.
Kernel
}
// Respond to the init op.
...
...
fuseops/convert.go
View file @
a07a396c
...
...
@@ -418,6 +418,22 @@ func Convert(
io
=
to
co
=
&
to
.
commonOp
case
fusekernel
.
OpInit
:
type
input
fusekernel
.
InitIn
in
:=
(
*
input
)(
m
.
Consume
(
unsafe
.
Sizeof
(
input
{})))
if
in
==
nil
{
err
=
errors
.
New
(
"Corrupt OpInit"
)
return
}
to
:=
&
InternalInitOp
{
Kernel
:
fusekernel
.
Protocol
{
in
.
Major
,
in
.
Minor
},
MaxReadahead
:
in
.
MaxReadahead
,
Flags
:
fusekernel
.
InitFlags
(
in
.
Flags
),
}
io
=
to
co
=
&
to
.
commonOp
default
:
to
:=
&
unknownOp
{
opCode
:
m
.
Header
()
.
Opcode
,
...
...
fuseops/ops.go
View file @
a07a396c
...
...
@@ -945,3 +945,30 @@ type InternalInterruptOp struct {
func
(
o
*
InternalInterruptOp
)
kernelResponse
()
(
b
buffer
.
OutMessage
)
{
panic
(
"Shouldn't get here."
)
}
// Do not use this struct directly. See the TODO in fuseops/ops.go.
type
InternalInitOp
struct
{
commonOp
// In
Kernel
fusekernel
.
Protocol
// Out
Library
fusekernel
.
Protocol
MaxReadahead
uint32
Flags
fusekernel
.
InitFlags
MaxWrite
uint32
}
func
(
o
*
InternalInitOp
)
kernelResponse
()
(
b
buffer
.
OutMessage
)
{
b
=
buffer
.
NewOutMessage
(
unsafe
.
Sizeof
(
fusekernel
.
InitOut
{}))
out
:=
(
*
fusekernel
.
InitOut
)(
b
.
Grow
(
unsafe
.
Sizeof
(
fusekernel
.
InitOut
{})))
out
.
Major
=
o
.
Library
.
Major
out
.
Minor
=
o
.
Library
.
Minor
out
.
MaxReadahead
=
o
.
MaxReadahead
out
.
Flags
=
uint32
(
o
.
Flags
)
out
.
MaxWrite
=
o
.
MaxWrite
return
}
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