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
75e419f3
Commit
75e419f3
authored
Jul 24, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OpenFileOp.kernelResponse
parent
5cc86afa
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
61 deletions
+62
-61
fuseops/ops.go
fuseops/ops.go
+7
-6
internal/fuseshim/buffer.go
internal/fuseshim/buffer.go
+8
-8
internal/fuseshim/fuse.go
internal/fuseshim/fuse.go
+47
-47
No files found.
fuseops/ops.go
View file @
75e419f3
...
...
@@ -18,7 +18,9 @@ import (
"fmt"
"os"
"time"
"unsafe"
"github.com/jacobsa/fuse/internal/fusekernel"
"github.com/jacobsa/fuse/internal/fuseshim"
"golang.org/x/net/context"
)
...
...
@@ -622,7 +624,6 @@ func (o *ReleaseDirHandleOp) respond() {
// (cf.https://github.com/osxfuse/osxfuse/issues/199).
type
OpenFileOp
struct
{
commonOp
bfReq
*
fuseshim
.
OpenRequest
// The ID of the inode to be opened.
Inode
InodeID
...
...
@@ -637,12 +638,12 @@ type OpenFileOp struct {
Handle
HandleID
}
func
(
o
*
OpenFileOp
)
respond
(
)
{
resp
:=
fuseshim
.
OpenResponse
{
Handle
:
fuseshim
.
HandleID
(
o
.
Handle
),
}
func
(
o
*
OpenFileOp
)
kernelResponse
()
(
msg
[]
byte
)
{
buf
:=
fuseshim
.
NewBuffer
(
unsafe
.
Sizeof
(
fusekernel
.
OpenOut
{}))
out
:=
(
*
fusekernel
.
OpenOut
)(
buf
.
Alloc
(
unsafe
.
Sizeof
(
fusekernel
.
OpenOut
{})))
out
.
Fh
=
uint64
(
o
.
Handle
)
o
.
bfReq
.
Respond
(
&
resp
)
msg
=
buf
return
}
...
...
internal/fuseshim/buffer.go
View file @
75e419f3
...
...
@@ -6,13 +6,13 @@ import (
"github.com/jacobsa/fuse/internal/fusekernel"
)
//
buffer provides a mechanism for constructing a message from
//
multiple
segments.
type
b
uffer
[]
byte
//
Buffer provides a mechanism for constructing a message from multiple
// segments.
type
B
uffer
[]
byte
// alloc allocates size bytes and returns a pointer to the new
// segment.
func
(
w
*
buffer
)
a
lloc
(
size
uintptr
)
unsafe
.
Pointer
{
func
(
w
*
Buffer
)
A
lloc
(
size
uintptr
)
unsafe
.
Pointer
{
s
:=
int
(
size
)
if
len
(
*
w
)
+
s
>
cap
(
*
w
)
{
old
:=
*
w
...
...
@@ -25,15 +25,15 @@ func (w *buffer) alloc(size uintptr) unsafe.Pointer {
}
// reset clears out the contents of the buffer.
func
(
w
*
b
uffer
)
reset
()
{
func
(
w
*
B
uffer
)
reset
()
{
for
i
:=
range
(
*
w
)[
:
cap
(
*
w
)]
{
(
*
w
)[
i
]
=
0
}
*
w
=
(
*
w
)[
:
0
]
}
func
newBuffer
(
extra
uintptr
)
buffer
{
func
NewBuffer
(
extra
uintptr
)
(
buf
Buffer
)
{
const
hdrSize
=
unsafe
.
Sizeof
(
fusekernel
.
OutHeader
{})
buf
:=
make
(
b
uffer
,
hdrSize
,
hdrSize
+
extra
)
return
buf
buf
=
make
(
B
uffer
,
hdrSize
,
hdrSize
+
extra
)
return
}
internal/fuseshim/fuse.go
View file @
75e419f3
This diff is collapsed.
Click to expand it.
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