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
b82db8eb
Commit
b82db8eb
authored
Jul 06, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update for weekly 23/6.
parent
00bf79b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
fuse/misc.go
fuse/misc.go
+2
-2
fuse/opcode.go
fuse/opcode.go
+4
-4
fuse/request.go
fuse/request.go
+4
-3
No files found.
fuse/misc.go
View file @
b82db8eb
...
...
@@ -155,8 +155,8 @@ func MyPID() string {
}
// Thanks to Andrew Gerrand for this hack.
func
asSlice
(
ptr
unsafe
.
Pointer
,
byteCount
int
)
[]
byte
{
h
:=
&
reflect
.
SliceHeader
{
uintptr
(
ptr
),
byteCount
,
byteCount
}
func
asSlice
(
ptr
unsafe
.
Pointer
,
byteCount
uintptr
)
[]
byte
{
h
:=
&
reflect
.
SliceHeader
{
uintptr
(
ptr
),
int
(
byteCount
),
int
(
byteCount
)
}
return
*
(
*
[]
byte
)(
unsafe
.
Pointer
(
h
))
}
...
...
fuse/opcode.go
View file @
b82db8eb
...
...
@@ -298,8 +298,8 @@ type castPointerFunc func(unsafe.Pointer) interface{}
type
operationHandler
struct
{
Name
string
Func
operationFunc
InputSize
int
OutputSize
int
InputSize
uintptr
OutputSize
uintptr
DecodeIn
castPointerFunc
DecodeOut
castPointerFunc
FileNames
int
...
...
@@ -332,7 +332,7 @@ func init() {
operationHandlers
[
i
]
=
&
operationHandler
{
Name
:
"UNKNOWN"
}
}
for
op
,
sz
:=
range
map
[
opcode
]
int
{
for
op
,
sz
:=
range
map
[
opcode
]
uintptr
{
_OP_FORGET
:
unsafe
.
Sizeof
(
ForgetIn
{}),
_OP_GETATTR
:
unsafe
.
Sizeof
(
GetAttrIn
{}),
_OP_SETATTR
:
unsafe
.
Sizeof
(
SetAttrIn
{}),
...
...
@@ -364,7 +364,7 @@ func init() {
operationHandlers
[
op
]
.
InputSize
=
sz
}
for
op
,
sz
:=
range
map
[
opcode
]
int
{
for
op
,
sz
:=
range
map
[
opcode
]
uintptr
{
_OP_LOOKUP
:
unsafe
.
Sizeof
(
EntryOut
{}),
_OP_GETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
_OP_SETATTR
:
unsafe
.
Sizeof
(
AttrOut
{}),
...
...
fuse/request.go
View file @
b82db8eb
...
...
@@ -78,7 +78,7 @@ func (me *request) OutputDebug() string {
}
func
(
me
*
request
)
parse
()
{
inHSize
:=
unsafe
.
Sizeof
(
InHeader
{}
)
inHSize
:=
int
(
unsafe
.
Sizeof
(
InHeader
{})
)
if
len
(
me
.
inputBuf
)
<
inHSize
{
log
.
Printf
(
"Short read for input header: %v"
,
me
.
inputBuf
)
return
...
...
@@ -94,7 +94,7 @@ func (me *request) parse() {
return
}
if
len
(
me
.
arg
)
<
me
.
handler
.
InputSize
{
if
len
(
me
.
arg
)
<
int
(
me
.
handler
.
InputSize
)
{
log
.
Printf
(
"Short read for %v: %v"
,
me
.
inHeader
.
opcode
,
me
.
arg
)
me
.
status
=
EIO
return
...
...
@@ -135,7 +135,8 @@ func (me *request) serialize() {
outHeader
:=
(
*
OutHeader
)(
unsafe
.
Pointer
(
&
me
.
outHeaderBytes
[
0
]))
outHeader
.
Unique
=
me
.
inHeader
.
Unique
outHeader
.
Status
=
-
me
.
status
outHeader
.
Length
=
uint32
(
sizeOfOutHeader
+
dataLength
+
len
(
me
.
flatData
))
outHeader
.
Length
=
uint32
(
int
(
sizeOfOutHeader
)
+
int
(
dataLength
)
+
int
(
len
(
me
.
flatData
)))
copy
(
me
.
outHeaderBytes
[
sizeOfOutHeader
:
],
asSlice
(
me
.
outData
,
dataLength
))
}
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