Commit ca24733f authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Rename DefaultRawFuseFile to DefaultFuseFile.

parent d2f8777d
...@@ -5,7 +5,7 @@ package fuse ...@@ -5,7 +5,7 @@ package fuse
type ReadOnlyFile struct { type ReadOnlyFile struct {
data []byte data []byte
DefaultRawFuseFile DefaultFuseFile
} }
func NewReadOnlyFile(data []byte) *ReadOnlyFile { func NewReadOnlyFile(data []byte) *ReadOnlyFile {
......
...@@ -137,25 +137,25 @@ func (me *DefaultRawFuseFileSystem) FsyncDir(header *InHeader, input *FsyncIn) ( ...@@ -137,25 +137,25 @@ func (me *DefaultRawFuseFileSystem) FsyncDir(header *InHeader, input *FsyncIn) (
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// DefaultRawFuseFile // DefaultFuseFile
func (me *DefaultRawFuseFile) Read(*ReadIn, *BufferPool) ([]byte, Status) { func (me *DefaultFuseFile) Read(*ReadIn, *BufferPool) ([]byte, Status) {
return []byte(""), ENOSYS return []byte(""), ENOSYS
} }
func (me *DefaultRawFuseFile) Write(*WriteIn, []byte) (uint32, Status) { func (me *DefaultFuseFile) Write(*WriteIn, []byte) (uint32, Status) {
return 0, ENOSYS return 0, ENOSYS
} }
func (me *DefaultRawFuseFile) Flush() Status { func (me *DefaultFuseFile) Flush() Status {
return ENOSYS return ENOSYS
} }
func (me *DefaultRawFuseFile) Release() { func (me *DefaultFuseFile) Release() {
} }
func (me *DefaultRawFuseFile) Fsync(*FsyncIn) (code Status) { func (me *DefaultFuseFile) Fsync(*FsyncIn) (code Status) {
return ENOSYS return ENOSYS
} }
......
...@@ -27,7 +27,7 @@ func TestPathFs(t *testing.T) { ...@@ -27,7 +27,7 @@ func TestPathFs(t *testing.T) {
} }
func TestDummyFile(t *testing.T) { func TestDummyFile(t *testing.T) {
d := new(DefaultRawFuseFile) d := new(DefaultFuseFile)
var filePtr RawFuseFile = d var filePtr RawFuseFile = d
_ = filePtr _ = filePtr
} }
...@@ -2,7 +2,7 @@ package fuse ...@@ -2,7 +2,7 @@ package fuse
// A FUSE file that accepts any write, and always returns EOF. // A FUSE file that accepts any write, and always returns EOF.
type DevNullFile struct { type DevNullFile struct {
DefaultRawFuseFile DefaultFuseFile
} }
func NewDevNullFile() *DevNullFile { func NewDevNullFile() *DevNullFile {
......
...@@ -47,18 +47,6 @@ type fuseRequest struct { ...@@ -47,18 +47,6 @@ type fuseRequest struct {
} }
type MountState struct { type MountState struct {
// We should store the RawFuseFile/Dirs on the Go side,
// otherwise our files may be GCd. Here, the index is the Fh
// field
openedFiles map[uint64]RawFuseFile
openedFilesMutex sync.RWMutex
nextFreeFile uint64
openedDirs map[uint64]RawFuseDir
openedDirsMutex sync.RWMutex
nextFreeDir uint64
// Empty if unmounted. // Empty if unmounted.
mountPoint string mountPoint string
fileSystem RawFileSystem fileSystem RawFileSystem
...@@ -167,8 +155,6 @@ func (me *MountState) Write(req *fuseRequest) { ...@@ -167,8 +155,6 @@ func (me *MountState) Write(req *fuseRequest) {
func NewMountState(fs RawFileSystem) *MountState { func NewMountState(fs RawFileSystem) *MountState {
me := new(MountState) me := new(MountState)
me.openedDirs = make(map[uint64]RawFuseDir)
me.openedFiles = make(map[uint64]RawFuseFile)
me.mountPoint = "" me.mountPoint = ""
me.fileSystem = fs me.fileSystem = fs
me.buffers = NewBufferPool() me.buffers = NewBufferPool()
......
...@@ -175,7 +175,7 @@ func (me *LoopbackFileSystem) FillOptions(options *PathFileSystemConnectorOption ...@@ -175,7 +175,7 @@ func (me *LoopbackFileSystem) FillOptions(options *PathFileSystemConnectorOption
type LoopbackFile struct { type LoopbackFile struct {
file *os.File file *os.File
DefaultRawFuseFile DefaultFuseFile
} }
func (me *LoopbackFile) Read(input *ReadIn, buffers *BufferPool) ([]byte, Status) { func (me *LoopbackFile) Read(input *ReadIn, buffers *BufferPool) ([]byte, Status) {
......
...@@ -598,5 +598,5 @@ type PathFilesystem interface { ...@@ -598,5 +598,5 @@ type PathFilesystem interface {
type DefaultRawFuseDir struct{} type DefaultRawFuseDir struct{}
type DefaultPathFilesystem struct{} type DefaultPathFilesystem struct{}
type DefaultRawFuseFile struct{} type DefaultFuseFile struct{}
type DefaultRawFuseFileSystem struct{} type DefaultRawFuseFileSystem struct{}
...@@ -31,7 +31,7 @@ type zipCreateFile struct { ...@@ -31,7 +31,7 @@ type zipCreateFile struct {
Basename string Basename string
zfs *MultiZipFs zfs *MultiZipFs
fuse.DefaultRawFuseFile fuse.DefaultFuseFile
} }
func (me *zipCreateFile) Write(input *fuse.WriteIn, nameBytes []byte) (uint32, fuse.Status) { func (me *zipCreateFile) Write(input *fuse.WriteIn, nameBytes []byte) (uint32, fuse.Status) {
......
...@@ -180,7 +180,7 @@ func (me *ZipFileFuse) OpenDir(name string) (stream chan fuse.DirEntry, code fus ...@@ -180,7 +180,7 @@ func (me *ZipFileFuse) OpenDir(name string) (stream chan fuse.DirEntry, code fus
type ZipFile struct { type ZipFile struct {
data []byte data []byte
fuse.DefaultRawFuseFile fuse.DefaultFuseFile
} }
func NewZipFile(f *zip.File) fuse.RawFuseFile { func NewZipFile(f *zip.File) fuse.RawFuseFile {
......
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