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
20262305
Commit
20262305
authored
Apr 21, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename RawFuseFile to FuseFile.
parent
ca24733f
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
24 additions
and
24 deletions
+24
-24
fuse/default.go
fuse/default.go
+2
-2
fuse/default_test.go
fuse/default_test.go
+1
-1
fuse/lockingfs.go
fuse/lockingfs.go
+2
-2
fuse/loopback.go
fuse/loopback.go
+2
-2
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+4
-4
fuse/timingfs.go
fuse/timingfs.go
+2
-2
fuse/types.go
fuse/types.go
+3
-3
fuse/wrappedfs.go
fuse/wrappedfs.go
+2
-2
unionfs/unionfs.go
unionfs/unionfs.go
+2
-2
zipfs/multizip.go
zipfs/multizip.go
+2
-2
zipfs/zipfs.go
zipfs/zipfs.go
+2
-2
No files found.
fuse/default.go
View file @
20262305
...
@@ -240,7 +240,7 @@ func (me *DefaultPathFilesystem) Truncate(name string, offset uint64) (code Stat
...
@@ -240,7 +240,7 @@ func (me *DefaultPathFilesystem) Truncate(name string, offset uint64) (code Stat
return
ENOSYS
return
ENOSYS
}
}
func
(
me
*
DefaultPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
DefaultPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
FuseFile
,
code
Status
)
{
return
nil
,
ENOSYS
return
nil
,
ENOSYS
}
}
...
@@ -259,7 +259,7 @@ func (me *DefaultPathFilesystem) Access(name string, mode uint32) (code Status)
...
@@ -259,7 +259,7 @@ func (me *DefaultPathFilesystem) Access(name string, mode uint32) (code Status)
return
ENOSYS
return
ENOSYS
}
}
func
(
me
*
DefaultPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
DefaultPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
FuseFile
,
code
Status
)
{
return
nil
,
ENOSYS
return
nil
,
ENOSYS
}
}
...
...
fuse/default_test.go
View file @
20262305
...
@@ -28,6 +28,6 @@ func TestPathFs(t *testing.T) {
...
@@ -28,6 +28,6 @@ func TestPathFs(t *testing.T) {
func
TestDummyFile
(
t
*
testing
.
T
)
{
func
TestDummyFile
(
t
*
testing
.
T
)
{
d
:=
new
(
DefaultFuseFile
)
d
:=
new
(
DefaultFuseFile
)
var
filePtr
Raw
FuseFile
=
d
var
filePtr
FuseFile
=
d
_
=
filePtr
_
=
filePtr
}
}
fuse/lockingfs.go
View file @
20262305
...
@@ -92,7 +92,7 @@ func (me *LockingPathFilesystem) Truncate(name string, offset uint64) (code Stat
...
@@ -92,7 +92,7 @@ func (me *LockingPathFilesystem) Truncate(name string, offset uint64) (code Stat
return
me
.
Original
.
Truncate
(
name
,
offset
)
return
me
.
Original
.
Truncate
(
name
,
offset
)
}
}
func
(
me
*
LockingPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
LockingPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
FuseFile
,
code
Status
)
{
return
me
.
Original
.
Open
(
name
,
flags
)
return
me
.
Original
.
Open
(
name
,
flags
)
}
}
...
@@ -120,7 +120,7 @@ func (me *LockingPathFilesystem) Access(name string, mode uint32) (code Status)
...
@@ -120,7 +120,7 @@ func (me *LockingPathFilesystem) Access(name string, mode uint32) (code Status)
return
me
.
Original
.
Access
(
name
,
mode
)
return
me
.
Original
.
Access
(
name
,
mode
)
}
}
func
(
me
*
LockingPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
LockingPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
FuseFile
,
code
Status
)
{
me
.
lock
.
Lock
()
me
.
lock
.
Lock
()
defer
me
.
lock
.
Unlock
()
defer
me
.
lock
.
Unlock
()
return
me
.
Original
.
Create
(
name
,
flags
,
mode
)
return
me
.
Original
.
Create
(
name
,
flags
,
mode
)
...
...
fuse/loopback.go
View file @
20262305
...
@@ -77,7 +77,7 @@ func (me *LoopbackFileSystem) OpenDir(name string) (stream chan DirEntry, status
...
@@ -77,7 +77,7 @@ func (me *LoopbackFileSystem) OpenDir(name string) (stream chan DirEntry, status
return
output
,
OK
return
output
,
OK
}
}
func
(
me
*
LoopbackFileSystem
)
Open
(
name
string
,
flags
uint32
)
(
fuseFile
Raw
FuseFile
,
status
Status
)
{
func
(
me
*
LoopbackFileSystem
)
Open
(
name
string
,
flags
uint32
)
(
fuseFile
FuseFile
,
status
Status
)
{
f
,
err
:=
os
.
OpenFile
(
me
.
GetPath
(
name
),
int
(
flags
),
0
)
f
,
err
:=
os
.
OpenFile
(
me
.
GetPath
(
name
),
int
(
flags
),
0
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
OsErrorToFuseError
(
err
)
return
nil
,
OsErrorToFuseError
(
err
)
...
@@ -141,7 +141,7 @@ func (me *LoopbackFileSystem) Access(name string, mode uint32) (code Status) {
...
@@ -141,7 +141,7 @@ func (me *LoopbackFileSystem) Access(name string, mode uint32) (code Status) {
return
Status
(
syscall
.
Access
(
me
.
GetPath
(
name
),
mode
))
return
Status
(
syscall
.
Access
(
me
.
GetPath
(
name
),
mode
))
}
}
func
(
me
*
LoopbackFileSystem
)
Create
(
path
string
,
flags
uint32
,
mode
uint32
)
(
fuseFile
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
LoopbackFileSystem
)
Create
(
path
string
,
flags
uint32
,
mode
uint32
)
(
fuseFile
FuseFile
,
code
Status
)
{
f
,
err
:=
os
.
OpenFile
(
me
.
GetPath
(
path
),
int
(
flags
)
|
os
.
O_CREATE
,
mode
)
f
,
err
:=
os
.
OpenFile
(
me
.
GetPath
(
path
),
int
(
flags
)
|
os
.
O_CREATE
,
mode
)
return
&
LoopbackFile
{
file
:
f
},
OsErrorToFuseError
(
err
)
return
&
LoopbackFile
{
file
:
f
},
OsErrorToFuseError
(
err
)
}
}
...
...
fuse/pathfilesystem.go
View file @
20262305
...
@@ -191,10 +191,10 @@ func (me *PathFileSystemConnector) getDir(h uint64) RawFuseDir {
...
@@ -191,10 +191,10 @@ func (me *PathFileSystemConnector) getDir(h uint64) RawFuseDir {
return
me
.
openFiles
[
h
]
.
(
RawFuseDir
)
return
me
.
openFiles
[
h
]
.
(
RawFuseDir
)
}
}
func
(
me
*
PathFileSystemConnector
)
getFile
(
h
uint64
)
Raw
FuseFile
{
func
(
me
*
PathFileSystemConnector
)
getFile
(
h
uint64
)
FuseFile
{
me
.
fileLock
.
RLock
()
me
.
fileLock
.
RLock
()
defer
me
.
fileLock
.
RUnlock
()
defer
me
.
fileLock
.
RUnlock
()
return
me
.
openFiles
[
h
]
.
(
Raw
FuseFile
)
return
me
.
openFiles
[
h
]
.
(
FuseFile
)
}
}
func
(
me
*
PathFileSystemConnector
)
verify
()
{
func
(
me
*
PathFileSystemConnector
)
verify
()
{
...
@@ -748,7 +748,7 @@ func (me *PathFileSystemConnector) Create(header *InHeader, input *CreateIn, nam
...
@@ -748,7 +748,7 @@ func (me *PathFileSystemConnector) Create(header *InHeader, input *CreateIn, nam
func
(
me
*
PathFileSystemConnector
)
Release
(
header
*
InHeader
,
input
*
ReleaseIn
)
{
func
(
me
*
PathFileSystemConnector
)
Release
(
header
*
InHeader
,
input
*
ReleaseIn
)
{
_
,
_
,
node
:=
me
.
GetPath
(
header
.
NodeId
)
_
,
_
,
node
:=
me
.
GetPath
(
header
.
NodeId
)
f
:=
me
.
unregisterFile
(
node
,
input
.
Fh
)
.
(
Raw
FuseFile
)
f
:=
me
.
unregisterFile
(
node
,
input
.
Fh
)
.
(
FuseFile
)
f
.
Release
()
f
.
Release
()
}
}
...
@@ -812,7 +812,7 @@ func (me *PathFileSystemConnector) ListXAttr(header *InHeader) (data []byte, cod
...
@@ -812,7 +812,7 @@ func (me *PathFileSystemConnector) ListXAttr(header *InHeader) (data []byte, cod
}
}
func
(
me
*
PathFileSystemConnector
)
Write
(
input
*
WriteIn
,
data
[]
byte
)
(
written
uint32
,
code
Status
)
{
func
(
me
*
PathFileSystemConnector
)
Write
(
input
*
WriteIn
,
data
[]
byte
)
(
written
uint32
,
code
Status
)
{
f
:=
me
.
getFile
(
input
.
Fh
)
.
(
Raw
FuseFile
)
f
:=
me
.
getFile
(
input
.
Fh
)
.
(
FuseFile
)
return
f
.
Write
(
input
,
data
)
return
f
.
Write
(
input
,
data
)
}
}
...
...
fuse/timingfs.go
View file @
20262305
...
@@ -166,7 +166,7 @@ func (me *TimingPathFilesystem) Truncate(name string, offset uint64) (code Statu
...
@@ -166,7 +166,7 @@ func (me *TimingPathFilesystem) Truncate(name string, offset uint64) (code Statu
return
me
.
Original
.
Truncate
(
name
,
offset
)
return
me
.
Original
.
Truncate
(
name
,
offset
)
}
}
func
(
me
*
TimingPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
TimingPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
FuseFile
,
code
Status
)
{
defer
me
.
startTimer
(
"Open"
,
name
)()
defer
me
.
startTimer
(
"Open"
,
name
)()
return
me
.
Original
.
Open
(
name
,
flags
)
return
me
.
Original
.
Open
(
name
,
flags
)
}
}
...
@@ -191,7 +191,7 @@ func (me *TimingPathFilesystem) Access(name string, mode uint32) (code Status) {
...
@@ -191,7 +191,7 @@ func (me *TimingPathFilesystem) Access(name string, mode uint32) (code Status) {
return
me
.
Original
.
Access
(
name
,
mode
)
return
me
.
Original
.
Access
(
name
,
mode
)
}
}
func
(
me
*
TimingPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
TimingPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
FuseFile
,
code
Status
)
{
defer
me
.
startTimer
(
"Create"
,
name
)()
defer
me
.
startTimer
(
"Create"
,
name
)()
return
me
.
Original
.
Create
(
name
,
flags
,
mode
)
return
me
.
Original
.
Create
(
name
,
flags
,
mode
)
}
}
...
...
fuse/types.go
View file @
20262305
...
@@ -544,7 +544,7 @@ type RawFileSystem interface {
...
@@ -544,7 +544,7 @@ type RawFileSystem interface {
FsyncDir
(
header
*
InHeader
,
input
*
FsyncIn
)
(
code
Status
)
FsyncDir
(
header
*
InHeader
,
input
*
FsyncIn
)
(
code
Status
)
}
}
type
Raw
FuseFile
interface
{
type
FuseFile
interface
{
Read
(
*
ReadIn
,
*
BufferPool
)
([]
byte
,
Status
)
Read
(
*
ReadIn
,
*
BufferPool
)
([]
byte
,
Status
)
// u32 <-> u64 ?
// u32 <-> u64 ?
Write
(
*
WriteIn
,
[]
byte
)
(
written
uint32
,
code
Status
)
Write
(
*
WriteIn
,
[]
byte
)
(
written
uint32
,
code
Status
)
...
@@ -571,7 +571,7 @@ type PathFilesystem interface {
...
@@ -571,7 +571,7 @@ type PathFilesystem interface {
Chmod
(
name
string
,
mode
uint32
)
(
code
Status
)
Chmod
(
name
string
,
mode
uint32
)
(
code
Status
)
Chown
(
name
string
,
uid
uint32
,
gid
uint32
)
(
code
Status
)
Chown
(
name
string
,
uid
uint32
,
gid
uint32
)
(
code
Status
)
Truncate
(
name
string
,
offset
uint64
)
(
code
Status
)
Truncate
(
name
string
,
offset
uint64
)
(
code
Status
)
Open
(
name
string
,
flags
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
Open
(
name
string
,
flags
uint32
)
(
file
FuseFile
,
code
Status
)
GetXAttr
(
name
string
,
attribute
string
)
(
data
[]
byte
,
code
Status
)
GetXAttr
(
name
string
,
attribute
string
)
(
data
[]
byte
,
code
Status
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
)
Status
...
@@ -587,7 +587,7 @@ type PathFilesystem interface {
...
@@ -587,7 +587,7 @@ type PathFilesystem interface {
Unmount
()
Unmount
()
Access
(
name
string
,
mode
uint32
)
(
code
Status
)
Access
(
name
string
,
mode
uint32
)
(
code
Status
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
FuseFile
,
code
Status
)
Utimens
(
name
string
,
AtimeNs
uint64
,
CtimeNs
uint64
)
(
code
Status
)
Utimens
(
name
string
,
AtimeNs
uint64
,
CtimeNs
uint64
)
(
code
Status
)
// unimplemented: poll, ioctl, bmap.
// unimplemented: poll, ioctl, bmap.
...
...
fuse/wrappedfs.go
View file @
20262305
...
@@ -54,7 +54,7 @@ func (me *WrappingPathFilesystem) Truncate(name string, offset uint64) (code Sta
...
@@ -54,7 +54,7 @@ func (me *WrappingPathFilesystem) Truncate(name string, offset uint64) (code Sta
return
me
.
Original
.
Truncate
(
name
,
offset
)
return
me
.
Original
.
Truncate
(
name
,
offset
)
}
}
func
(
me
*
WrappingPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
WrappingPathFilesystem
)
Open
(
name
string
,
flags
uint32
)
(
file
FuseFile
,
code
Status
)
{
return
me
.
Original
.
Open
(
name
,
flags
)
return
me
.
Original
.
Open
(
name
,
flags
)
}
}
...
@@ -74,7 +74,7 @@ func (me *WrappingPathFilesystem) Access(name string, mode uint32) (code Status)
...
@@ -74,7 +74,7 @@ func (me *WrappingPathFilesystem) Access(name string, mode uint32) (code Status)
return
me
.
Original
.
Access
(
name
,
mode
)
return
me
.
Original
.
Access
(
name
,
mode
)
}
}
func
(
me
*
WrappingPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
Raw
FuseFile
,
code
Status
)
{
func
(
me
*
WrappingPathFilesystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
FuseFile
,
code
Status
)
{
return
me
.
Original
.
Create
(
name
,
flags
,
mode
)
return
me
.
Original
.
Create
(
name
,
flags
,
mode
)
}
}
...
...
unionfs/unionfs.go
View file @
20262305
...
@@ -287,7 +287,7 @@ func (me *UnionFs) Readlink(name string) (out string, code fuse.Status) {
...
@@ -287,7 +287,7 @@ func (me *UnionFs) Readlink(name string) (out string, code fuse.Status) {
return
""
,
fuse
.
ENOENT
return
""
,
fuse
.
ENOENT
}
}
func
(
me
*
UnionFs
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
fuseFile
fuse
.
Raw
FuseFile
,
code
fuse
.
Status
)
{
func
(
me
*
UnionFs
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
fuseFile
fuse
.
FuseFile
,
code
fuse
.
Status
)
{
// TODO(hanwen) - we should check that the name is not a
// TODO(hanwen) - we should check that the name is not a
// directory in another branch.
// directory in another branch.
writable
:=
me
.
fileSystems
[
0
]
writable
:=
me
.
fileSystems
[
0
]
...
@@ -406,7 +406,7 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status
...
@@ -406,7 +406,7 @@ func (me *UnionFs) OpenDir(directory string) (stream chan fuse.DirEntry, status
return
stream
,
fuse
.
OK
return
stream
,
fuse
.
OK
}
}
func
(
me
*
UnionFs
)
Open
(
name
string
,
flags
uint32
)
(
fuseFile
fuse
.
Raw
FuseFile
,
status
fuse
.
Status
)
{
func
(
me
*
UnionFs
)
Open
(
name
string
,
flags
uint32
)
(
fuseFile
fuse
.
FuseFile
,
status
fuse
.
Status
)
{
branch
:=
me
.
getBranch
(
name
)
branch
:=
me
.
getBranch
(
name
)
if
flags
&
fuse
.
O_ANYWRITE
!=
0
&&
branch
>
0
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
&&
branch
>
0
{
err
:=
me
.
Promote
(
name
,
me
.
branches
[
branch
])
err
:=
me
.
Promote
(
name
,
me
.
branches
[
branch
])
...
...
zipfs/multizip.go
View file @
20262305
...
@@ -184,7 +184,7 @@ func (me *MultiZipFs) Unlink(name string) (code fuse.Status) {
...
@@ -184,7 +184,7 @@ func (me *MultiZipFs) Unlink(name string) (code fuse.Status) {
return
fuse
.
EPERM
return
fuse
.
EPERM
}
}
func
(
me
*
MultiZipFs
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
Raw
FuseFile
,
code
fuse
.
Status
)
{
func
(
me
*
MultiZipFs
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
FuseFile
,
code
fuse
.
Status
)
{
if
0
!=
flags
&
uint32
(
fuse
.
O_ANYWRITE
)
{
if
0
!=
flags
&
uint32
(
fuse
.
O_ANYWRITE
)
{
return
nil
,
fuse
.
EPERM
return
nil
,
fuse
.
EPERM
}
}
...
@@ -205,7 +205,7 @@ func (me *MultiZipFs) Open(name string, flags uint32) (file fuse.RawFuseFile, co
...
@@ -205,7 +205,7 @@ func (me *MultiZipFs) Open(name string, flags uint32) (file fuse.RawFuseFile, co
return
nil
,
fuse
.
ENOENT
return
nil
,
fuse
.
ENOENT
}
}
func
(
me
*
MultiZipFs
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
fuse
.
Raw
FuseFile
,
code
fuse
.
Status
)
{
func
(
me
*
MultiZipFs
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
)
(
file
fuse
.
FuseFile
,
code
fuse
.
Status
)
{
dir
,
base
:=
filepath
.
Split
(
name
)
dir
,
base
:=
filepath
.
Split
(
name
)
if
dir
!=
CONFIG_PREFIX
{
if
dir
!=
CONFIG_PREFIX
{
return
nil
,
fuse
.
EPERM
return
nil
,
fuse
.
EPERM
...
...
zipfs/zipfs.go
View file @
20262305
...
@@ -135,7 +135,7 @@ func (me *ZipFileFuse) GetAttr(name string) (*fuse.Attr, fuse.Status) {
...
@@ -135,7 +135,7 @@ func (me *ZipFileFuse) GetAttr(name string) (*fuse.Attr, fuse.Status) {
return
a
,
fuse
.
OK
return
a
,
fuse
.
OK
}
}
func
(
me
*
ZipFileFuse
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
Raw
FuseFile
,
code
fuse
.
Status
)
{
func
(
me
*
ZipFileFuse
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
FuseFile
,
code
fuse
.
Status
)
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
return
nil
,
fuse
.
EPERM
}
}
...
@@ -183,7 +183,7 @@ type ZipFile struct {
...
@@ -183,7 +183,7 @@ type ZipFile struct {
fuse
.
DefaultFuseFile
fuse
.
DefaultFuseFile
}
}
func
NewZipFile
(
f
*
zip
.
File
)
fuse
.
Raw
FuseFile
{
func
NewZipFile
(
f
*
zip
.
File
)
fuse
.
FuseFile
{
data
:=
make
([]
byte
,
f
.
UncompressedSize
)
data
:=
make
([]
byte
,
f
.
UncompressedSize
)
rc
,
err
:=
f
.
Open
()
rc
,
err
:=
f
.
Open
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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