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
de0799bb
Commit
de0799bb
authored
May 25, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small performance optimizations.
parent
c1a117cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
fuse/fsconnector.go
fuse/fsconnector.go
+4
-4
fuse/misc.go
fuse/misc.go
+3
-3
fuse/mountstate.go
fuse/mountstate.go
+1
-2
fuse/request.go
fuse/request.go
+4
-2
No files found.
fuse/fsconnector.go
View file @
de0799bb
...
...
@@ -94,12 +94,12 @@ func (c *FileSystemConnector) childLookup(out *raw.EntryOut, fsi FsNode) {
func
(
c
*
FileSystemConnector
)
findMount
(
parent
*
Inode
,
name
string
)
(
mount
*
fileSystemMount
)
{
parent
.
treeLock
.
RLock
()
defer
parent
.
treeLock
.
RUnlock
()
if
parent
.
mounts
==
nil
{
return
nil
if
parent
.
mounts
!=
nil
{
mount
=
parent
.
mounts
[
name
]
}
parent
.
treeLock
.
RUnlock
()
return
parent
.
mounts
[
name
]
return
}
func
(
c
*
FileSystemConnector
)
toInode
(
nodeid
uint64
)
*
Inode
{
...
...
fuse/misc.go
View file @
de0799bb
...
...
@@ -75,9 +75,9 @@ func CheckSuccess(e error) {
}
// Thanks to Andrew Gerrand for this hack.
func
asSlice
(
ptr
unsafe
.
Pointer
,
byteCount
uintptr
)
[]
byte
{
h
:=
&
reflect
.
SliceHeader
{
uintptr
(
ptr
),
int
(
byteCount
),
int
(
byteCount
)}
return
*
(
*
[]
byte
)(
unsafe
.
Pointer
(
h
))
func
toSlice
(
dest
*
[]
byte
,
ptr
unsafe
.
Pointer
,
byteCount
uintptr
)
{
h
:=
(
*
reflect
.
SliceHeader
)(
unsafe
.
Pointer
(
dest
))
*
h
=
reflect
.
SliceHeader
{
uintptr
(
ptr
),
int
(
byteCount
),
int
(
byteCount
)}
}
func
Version
()
string
{
...
...
fuse/mountstate.go
View file @
de0799bb
...
...
@@ -295,8 +295,6 @@ func (ms *MountState) loop(exitIdle bool) {
}
func
(
ms
*
MountState
)
handleRequest
(
req
*
request
)
{
defer
ms
.
returnRequest
(
req
)
req
.
parse
()
if
req
.
handler
==
nil
{
req
.
status
=
ENOSYS
...
...
@@ -320,6 +318,7 @@ func (ms *MountState) handleRequest(req *request) {
log
.
Printf
(
"writer: Write/Writev failed, err: %v. opcode: %v"
,
errNo
,
operationName
(
req
.
inHeader
.
Opcode
))
}
ms
.
returnRequest
(
req
)
}
func
(
ms
*
MountState
)
AllocOut
(
req
*
request
,
size
uint32
)
[]
byte
{
...
...
fuse/request.go
View file @
de0799bb
...
...
@@ -171,7 +171,7 @@ func (r *request) parse() {
}
}
r
.
outBuf
=
zeroOutBuf
copy
(
r
.
outBuf
[
:
r
.
handler
.
OutputSize
],
zeroOutBuf
[
:
r
.
handler
.
OutputSize
])
r
.
outData
=
unsafe
.
Pointer
(
&
r
.
outBuf
[
sizeOfOutHeader
])
}
...
...
@@ -189,7 +189,9 @@ func (r *request) serialize() (header []byte, data []byte) {
o
.
Length
=
uint32
(
int
(
sizeOfOutHeader
)
+
int
(
dataLength
)
+
int
(
len
(
r
.
flatData
)))
copy
(
header
[
sizeOfOutHeader
:
],
asSlice
(
r
.
outData
,
dataLength
))
var
asSlice
[]
byte
toSlice
(
&
asSlice
,
r
.
outData
,
dataLength
)
copy
(
header
[
sizeOfOutHeader
:
],
asSlice
)
return
header
,
r
.
flatData
}
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