Commit 82cd6e7b authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Update for weekly 2012-02.14

parent 1ea7b36d
...@@ -113,11 +113,11 @@ func (me *LoopbackFile) Release() { ...@@ -113,11 +113,11 @@ func (me *LoopbackFile) Release() {
} }
func (me *LoopbackFile) Fsync(*FsyncIn) (code Status) { func (me *LoopbackFile) Fsync(*FsyncIn) (code Status) {
return ToStatus(syscall.Fsync(me.File.Fd())) return ToStatus(syscall.Fsync(int(me.File.Fd())))
} }
func (me *LoopbackFile) Truncate(size uint64) Status { func (me *LoopbackFile) Truncate(size uint64) Status {
return ToStatus(syscall.Ftruncate(me.File.Fd(), int64(size))) return ToStatus(syscall.Ftruncate(int(me.File.Fd()), int64(size)))
} }
// futimens missing from 6g runtime. // futimens missing from 6g runtime.
...@@ -132,7 +132,7 @@ func (me *LoopbackFile) Chown(uid uint32, gid uint32) Status { ...@@ -132,7 +132,7 @@ func (me *LoopbackFile) Chown(uid uint32, gid uint32) Status {
func (me *LoopbackFile) GetAttr() (*Attr, Status) { func (me *LoopbackFile) GetAttr() (*Attr, Status) {
st := syscall.Stat_t{} st := syscall.Stat_t{}
err := syscall.Fstat(me.File.Fd(), &st) err := syscall.Fstat(int(me.File.Fd()), &st)
if err != nil { if err != nil {
return nil, ToStatus(err) return nil, ToStatus(err)
} }
......
...@@ -39,7 +39,7 @@ func ToStatus(err error) Status { ...@@ -39,7 +39,7 @@ func ToStatus(err error) Status {
case syscall.Errno: case syscall.Errno:
return Status(t) return Status(t)
case *os.SyscallError: case *os.SyscallError:
return Status(t.Errno.(syscall.Errno)) return Status(t.Err.(syscall.Errno))
case *os.PathError: case *os.PathError:
return ToStatus(t.Err) return ToStatus(t.Err)
case *os.LinkError: case *os.LinkError:
......
...@@ -19,8 +19,8 @@ func unixgramSocketpair() (l, r *os.File, err error) { ...@@ -19,8 +19,8 @@ func unixgramSocketpair() (l, r *os.File, err error) {
return nil, nil, os.NewSyscallError("socketpair", return nil, nil, os.NewSyscallError("socketpair",
err.(syscall.Errno)) err.(syscall.Errno))
} }
l = os.NewFile(fd[0], "socketpair-half1") l = os.NewFile(uintptr(fd[0]), "socketpair-half1")
r = os.NewFile(fd[1], "socketpair-half2") r = os.NewFile(uintptr(fd[1]), "socketpair-half2")
return return
} }
...@@ -118,7 +118,7 @@ func getConnection(local *os.File) (f *os.File, err error) { ...@@ -118,7 +118,7 @@ func getConnection(local *os.File) (f *os.File, err error) {
// n, oobn, recvflags, from, errno - todo: error checking. // n, oobn, recvflags, from, errno - todo: error checking.
_, oobn, _, _, _, oobn, _, _,
err := syscall.Recvmsg( err := syscall.Recvmsg(
local.Fd(), data[:], control[:], 0) int(local.Fd()), data[:], control[:], 0)
if err != nil { if err != nil {
return return
} }
...@@ -138,7 +138,7 @@ func getConnection(local *os.File) (f *os.File, err error) { ...@@ -138,7 +138,7 @@ func getConnection(local *os.File) (f *os.File, err error) {
err = fmt.Errorf("getConnection: fd < 0: %d", fd) err = fmt.Errorf("getConnection: fd < 0: %d", fd)
return return
} }
f = os.NewFile(int(fd), "<fuseConnection>") f = os.NewFile(uintptr(fd), "<fuseConnection>")
return return
} }
......
...@@ -272,7 +272,7 @@ func (me *MountState) write(req *request) Status { ...@@ -272,7 +272,7 @@ func (me *MountState) write(req *request) Status {
if req.flatData == nil { if req.flatData == nil {
_, err = me.mountFile.Write(req.outHeaderBytes) _, err = me.mountFile.Write(req.outHeaderBytes)
} else { } else {
_, err = Writev(me.mountFile.Fd(), _, err = Writev(int(me.mountFile.Fd()),
[][]byte{req.outHeaderBytes, req.flatData}) [][]byte{req.outHeaderBytes, req.flatData})
} }
......
...@@ -24,11 +24,11 @@ func init() { ...@@ -24,11 +24,11 @@ func init() {
os.O_WRONLY: "WRONLY", os.O_WRONLY: "WRONLY",
os.O_RDWR: "RDWR", os.O_RDWR: "RDWR",
os.O_APPEND: "APPEND", os.O_APPEND: "APPEND",
os.O_ASYNC: "ASYNC", syscall.O_ASYNC: "ASYNC",
os.O_CREATE: "CREAT", os.O_CREATE: "CREAT",
os.O_EXCL: "EXCL", os.O_EXCL: "EXCL",
os.O_NOCTTY: "NOCTTY", syscall.O_NOCTTY: "NOCTTY",
os.O_NONBLOCK: "NONBLOCK", syscall.O_NONBLOCK: "NONBLOCK",
os.O_SYNC: "SYNC", os.O_SYNC: "SYNC",
os.O_TRUNC: "TRUNC", os.O_TRUNC: "TRUNC",
......
package fuse package fuse
// #include <linux/fuse.h>
import "C"
import ( import (
"os" "os"
"syscall" "syscall"
) )
const ( const (
FUSE_ROOT_ID = 1 FUSE_ROOT_ID = 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment