forked from bazil/fuse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- go test runs and successfuly mounts a dir, but, doing an ls in said dir will result in 'device not configured'. - more info here: bazil#104
- Loading branch information
Showing
25 changed files
with
353 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build freebsd | ||
|
||
package fuse | ||
|
||
import "syscall" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// +build openbsd | ||
|
||
package fuse | ||
|
||
import "syscall" | ||
|
||
const ( | ||
ENOATTR = Errno(syscall.ENOATTR) | ||
) | ||
|
||
const ( | ||
errNoXattr = ENOATTR | ||
) | ||
|
||
func init() { | ||
errnoNames[errNoXattr] = "ENOATTR" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package fstestutil | ||
|
||
import "errors" | ||
|
||
func getMountInfo(mnt string) (*MountInfo, error) { | ||
return nil, errors.New("OpenBSD has no useful mount information") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package fs_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"bazil.org/fuse/fs/fstestutil" | ||
"golang.org/x/sys/unix" | ||
) | ||
|
||
type exchangeData struct { | ||
fstestutil.File | ||
// this struct cannot be zero size or multiple instances may look identical | ||
_ int | ||
} | ||
|
||
func TestExchangeDataNotSupported(t *testing.T) { | ||
t.Parallel() | ||
mnt, err := fstestutil.MountedT(t, fstestutil.SimpleFS{&fstestutil.ChildMap{ | ||
"one": &exchangeData{}, | ||
"two": &exchangeData{}, | ||
}}, nil) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
defer mnt.Close() | ||
|
||
if err := unix.Exchangedata(mnt.Dir+"/one", mnt.Dir+"/two", 0); err != unix.ENOTSUP { | ||
t.Fatalf("expected ENOTSUP from exchangedata: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build freebsd | ||
|
||
package fuse | ||
|
||
import "time" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// +build openbsd | ||
|
||
package fuse | ||
|
||
import "time" | ||
|
||
type attr struct { | ||
Ino uint64 | ||
Size uint64 | ||
Blocks uint64 | ||
Atime uint64 | ||
Mtime uint64 | ||
Ctime uint64 | ||
AtimeNsec uint32 | ||
MtimeNsec uint32 | ||
CtimeNsec uint32 | ||
Mode uint32 | ||
Nlink uint32 | ||
UID uint32 | ||
Gid uint32 | ||
Rdev uint32 | ||
Blksize uint32 | ||
padding uint32 | ||
} | ||
|
||
func (a *attr) Crtime() time.Time { | ||
return time.Time{} | ||
} | ||
|
||
func (a *attr) SetCrtime(s uint64, ns uint32) { | ||
// ignored on openbsd | ||
} | ||
|
||
func (a *attr) SetFlags(f uint32) { | ||
// ignored on openbsd | ||
} | ||
|
||
type setattrIn struct { | ||
setattrInCommon | ||
} | ||
|
||
func (in *setattrIn) BkupTime() time.Time { | ||
return time.Time{} | ||
} | ||
|
||
func (in *setattrIn) Chgtime() time.Time { | ||
return time.Time{} | ||
} | ||
|
||
func (in *setattrIn) Flags() uint32 { | ||
return 0 | ||
} | ||
|
||
func openFlags(flags uint32) OpenFlags { | ||
return OpenFlags(flags) | ||
} | ||
|
||
type getxattrIn struct { | ||
getxattrInCommon | ||
} | ||
|
||
type setxattrIn struct { | ||
setxattrInCommon | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package fuse | ||
|
||
// Maximum file write size we are prepared to receive from the kernel. | ||
// | ||
// This number is just a guess. | ||
const maxWrite = 128 * 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package fuse | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"unsafe" | ||
|
||
"bazil.org/fuse/syscallx" | ||
) | ||
|
||
const fuseBufMaxSize = (1024 * 4096) | ||
|
||
func mount(dir string, conf *mountConfig, ready chan<- struct{}, errp *error) (*os.File, error) { | ||
defer close(ready) | ||
|
||
fmt.Printf("mount(%v, %v)\n", dir, conf) | ||
f, err := os.OpenFile("/dev/fuse0", os.O_RDWR, 0000) | ||
if err != nil { | ||
*errp = err | ||
return nil, err | ||
} | ||
|
||
fuse_args := syscallx.Fusefs_args{ | ||
FD: int(f.Fd()), | ||
MaxRead: fuseBufMaxSize, | ||
} | ||
|
||
fmt.Printf("fusefs_args: %#v\n", fuse_args) | ||
|
||
err = syscallx.Mount("fuse", dir, 0, uintptr(unsafe.Pointer(&fuse_args))) | ||
return f, err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// +build freebsd | ||
|
||
package fuse | ||
|
||
func localVolume(conf *mountConfig) error { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// +build openbsd | ||
|
||
package fuse | ||
|
||
func localVolume(conf *mountConfig) error { | ||
return nil | ||
} | ||
|
||
func volumeName(name string) MountOption { | ||
return dummyOption | ||
} | ||
|
||
func daemonTimeout(name string) MountOption { | ||
return func(conf *mountConfig) error { | ||
conf.options["timeout"] = name | ||
return nil | ||
} | ||
} | ||
|
||
func noAppleXattr(conf *mountConfig) error { | ||
return nil | ||
} | ||
|
||
func noAppleDouble(conf *mountConfig) error { | ||
return nil | ||
} | ||
|
||
func exclCreate(conf *mountConfig) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright 2014 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
#include "textflag.h" | ||
|
||
TEXT ·use(SB),NOSPLIT,$0 | ||
RET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package fstestutil | ||
|
||
import "errors" | ||
|
||
func getMountInfo(mnt string) (*MountInfo, error) { | ||
return nil, errors.New("OpenBSD has no useful mount information") | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package syscallx | ||
|
||
import "fmt" | ||
|
||
/* This is the source file for syscallx_darwin_*.go, to regenerate run | ||
./generate | ||
*/ | ||
|
||
//sys mount(tpe string, dir string, flags int, data uintptr) (err error) | ||
|
||
func Mount(tpe string, dir string, flags int, data uintptr) (err error) { | ||
fmt.Printf("mount(%v, %v, %v, %v)\n", tpe, dir, flags, data) | ||
return mount(tpe, dir, flags, data) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// mksyscall.pl -l32 mount_openbsd.go | ||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT | ||
|
||
package syscallx | ||
|
||
import "syscall" | ||
|
||
import "unsafe" | ||
|
||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
|
||
func mount(tpe string, dir string, flags int, data uintptr) (err error) { | ||
var _p0 *byte | ||
_p0, err = syscall.BytePtrFromString(tpe) | ||
if err != nil { | ||
return | ||
} | ||
var _p1 *byte | ||
_p1, err = syscall.BytePtrFromString(dir) | ||
if err != nil { | ||
return | ||
} | ||
_, _, e1 := syscall.Syscall6(syscall.SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) | ||
use(unsafe.Pointer(_p0)) | ||
use(unsafe.Pointer(_p1)) | ||
if e1 != 0 { | ||
err = e1 | ||
} | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// mksyscall.pl mount_openbsd.go | ||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT | ||
|
||
package syscallx | ||
|
||
import "syscall" | ||
|
||
import "unsafe" | ||
|
||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT | ||
|
||
func mount(tpe string, dir string, flags int, data uintptr) (err error) { | ||
var _p0 *byte | ||
_p0, err = syscall.BytePtrFromString(tpe) | ||
if err != nil { | ||
return | ||
} | ||
var _p1 *byte | ||
_p1, err = syscall.BytePtrFromString(dir) | ||
if err != nil { | ||
return | ||
} | ||
_, _, e1 := syscall.Syscall6(syscall.SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) | ||
use(unsafe.Pointer(_p0)) | ||
use(unsafe.Pointer(_p1)) | ||
if e1 != 0 { | ||
err = e1 | ||
} | ||
return | ||
} |
Oops, something went wrong.