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
Kirill Smelkov
go-fuse
Commits
5c9096d6
Commit
5c9096d6
authored
Jun 23, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide Writev syscall, remove Linkat syscall.
parent
3d0731da
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
58 deletions
+8
-58
fuse/misc_linux_test.go
fuse/misc_linux_test.go
+0
-34
fuse/mountstate_darwin.go
fuse/mountstate_darwin.go
+1
-1
fuse/mountstate_linux.go
fuse/mountstate_linux.go
+1
-1
fuse/syscall_darwin.go
fuse/syscall_darwin.go
+3
-3
fuse/syscall_linux.go
fuse/syscall_linux.go
+3
-19
No files found.
fuse/misc_linux_test.go
deleted
100644 → 0
View file @
3d0731da
// +build linux
package
fuse
import
(
"io/ioutil"
"os"
"syscall"
"testing"
)
func
TestLinkAt
(
t
*
testing
.
T
)
{
dir
,
_
:=
ioutil
.
TempDir
(
""
,
"go-fuse-misc_test"
)
ioutil
.
WriteFile
(
dir
+
"/a"
,
[]
byte
{
42
},
0644
)
f
,
_
:=
os
.
Open
(
dir
)
e
:=
Linkat
(
int
(
f
.
Fd
()),
"a"
,
int
(
f
.
Fd
()),
"b"
)
if
e
!=
0
{
t
.
Fatalf
(
"Linkat %d"
,
e
)
}
var
s1
,
s2
syscall
.
Stat_t
err
:=
syscall
.
Lstat
(
dir
+
"/a"
,
&
s1
)
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat a: %v"
,
err
)
}
err
=
syscall
.
Lstat
(
dir
+
"/b"
,
&
s2
)
if
err
!=
nil
{
t
.
Fatalf
(
"Lstat b: %v"
,
err
)
}
if
s1
.
Ino
!=
s2
.
Ino
{
t
.
Fatal
(
"Ino mismatch"
,
s1
,
s2
)
}
}
fuse/mountstate_darwin.go
View file @
5c9096d6
...
...
@@ -17,7 +17,7 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status {
header
=
req
.
serializeHeader
(
len
(
req
.
flatData
))
}
_
,
err
:=
W
ritev
(
int
(
ms
.
mountFd
),
[][]
byte
{
header
,
req
.
flatData
})
_
,
err
:=
w
ritev
(
int
(
ms
.
mountFd
),
[][]
byte
{
header
,
req
.
flatData
})
if
req
.
readResult
!=
nil
{
req
.
readResult
.
Done
()
}
...
...
fuse/mountstate_linux.go
View file @
5c9096d6
...
...
@@ -27,7 +27,7 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status {
header
=
req
.
serializeHeader
(
len
(
req
.
flatData
))
}
_
,
err
:=
W
ritev
(
ms
.
mountFd
,
[][]
byte
{
header
,
req
.
flatData
})
_
,
err
:=
w
ritev
(
ms
.
mountFd
,
[][]
byte
{
header
,
req
.
flatData
})
if
req
.
readResult
!=
nil
{
req
.
readResult
.
Done
()
}
...
...
fuse/syscall_darwin.go
View file @
5c9096d6
...
...
@@ -9,14 +9,14 @@ import (
// TODO - move these into Go's syscall package.
func
writev
(
fd
int
,
iovecs
*
syscall
.
Iovec
,
cnt
int
)
(
n
int
,
errno
int
)
{
func
sys_
writev
(
fd
int
,
iovecs
*
syscall
.
Iovec
,
cnt
int
)
(
n
int
,
errno
int
)
{
n1
,
_
,
e1
:=
syscall
.
Syscall
(
syscall
.
SYS_WRITEV
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
iovecs
)),
uintptr
(
cnt
))
return
int
(
n1
),
int
(
e1
)
}
func
W
ritev
(
fd
int
,
packet
[][]
byte
)
(
n
int
,
err
error
)
{
func
w
ritev
(
fd
int
,
packet
[][]
byte
)
(
n
int
,
err
error
)
{
iovecs
:=
make
([]
syscall
.
Iovec
,
0
,
len
(
packet
))
for
_
,
v
:=
range
packet
{
...
...
@@ -30,7 +30,7 @@ func Writev(fd int, packet [][]byte) (n int, err error) {
iovecs
=
append
(
iovecs
,
vec
)
}
n
,
errno
:=
writev
(
fd
,
&
iovecs
[
0
],
len
(
iovecs
))
n
,
errno
:=
sys_
writev
(
fd
,
&
iovecs
[
0
],
len
(
iovecs
))
if
errno
!=
0
{
err
=
os
.
NewSyscallError
(
"writev"
,
syscall
.
Errno
(
errno
))
}
...
...
fuse/syscall_linux.go
View file @
5c9096d6
...
...
@@ -8,14 +8,14 @@ import (
// TODO - move these into Go's syscall package.
func
writev
(
fd
int
,
iovecs
*
syscall
.
Iovec
,
cnt
int
)
(
n
int
,
errno
int
)
{
func
sys_
writev
(
fd
int
,
iovecs
*
syscall
.
Iovec
,
cnt
int
)
(
n
int
,
errno
int
)
{
n1
,
_
,
e1
:=
syscall
.
Syscall
(
syscall
.
SYS_WRITEV
,
uintptr
(
fd
),
uintptr
(
unsafe
.
Pointer
(
iovecs
)),
uintptr
(
cnt
))
return
int
(
n1
),
int
(
e1
)
}
func
W
ritev
(
fd
int
,
packet
[][]
byte
)
(
n
int
,
err
error
)
{
func
w
ritev
(
fd
int
,
packet
[][]
byte
)
(
n
int
,
err
error
)
{
iovecs
:=
make
([]
syscall
.
Iovec
,
0
,
len
(
packet
))
for
_
,
v
:=
range
packet
{
...
...
@@ -29,25 +29,9 @@ func Writev(fd int, packet [][]byte) (n int, err error) {
iovecs
=
append
(
iovecs
,
vec
)
}
n
,
errno
:=
writev
(
fd
,
&
iovecs
[
0
],
len
(
iovecs
))
n
,
errno
:=
sys_
writev
(
fd
,
&
iovecs
[
0
],
len
(
iovecs
))
if
errno
!=
0
{
err
=
os
.
NewSyscallError
(
"writev"
,
syscall
.
Errno
(
errno
))
}
return
n
,
err
}
const
AT_FDCWD
=
-
100
func
Linkat
(
fd1
int
,
n1
string
,
fd2
int
,
n2
string
)
int
{
b1
:=
syscall
.
StringBytePtr
(
n1
)
b2
:=
syscall
.
StringBytePtr
(
n2
)
_
,
_
,
errNo
:=
syscall
.
Syscall6
(
syscall
.
SYS_LINKAT
,
uintptr
(
fd1
),
uintptr
(
unsafe
.
Pointer
(
b1
)),
uintptr
(
fd2
),
uintptr
(
unsafe
.
Pointer
(
b2
)),
0
,
0
)
return
int
(
errNo
)
}
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