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
66f65406
Commit
66f65406
authored
Sep 05, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default implementations.
parent
bf20a9f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
12 deletions
+139
-12
fuse/Makefile
fuse/Makefile
+1
-0
fuse/defaultnode.go
fuse/defaultnode.go
+136
-0
fuse/pathfs.go
fuse/pathfs.go
+2
-12
No files found.
fuse/Makefile
View file @
66f65406
...
...
@@ -8,6 +8,7 @@ MANUAL_GOFILES=api.go \
copy.go
\
default.go
\
defaultfile.go
\
defaultnode.go
\
defaultraw.go
\
direntry.go
\
files.go
\
...
...
fuse/defaultnode.go
0 → 100644
View file @
66f65406
package
fuse
import
(
"os"
)
type
DefaultNodeFileSystem
struct
{
root
DefaultFsNode
}
func
(
me
*
DefaultNodeFileSystem
)
Unmount
()
{
}
func
(
me
*
DefaultNodeFileSystem
)
Mount
(
conn
*
FileSystemConnector
)
{
}
func
(
me
*
DefaultNodeFileSystem
)
StatFs
()
*
StatfsOut
{
return
nil
}
func
(
me
*
DefaultNodeFileSystem
)
Root
()
FsNode
{
return
&
me
.
root
}
////////////////////////////////////////////////////////////////
// FsNode default
type
DefaultFsNode
struct
{
inode
*
Inode
}
func
(
me
*
DefaultFsNode
)
SetInode
(
node
*
Inode
)
{
if
me
.
inode
!=
nil
{
panic
(
"already have Inode"
)
}
me
.
inode
=
node
}
func
(
me
*
DefaultFsNode
)
Inode
()
*
Inode
{
return
me
.
inode
}
func
(
me
*
DefaultFsNode
)
RmChild
(
name
string
,
child
FsNode
)
{
}
func
(
me
*
DefaultFsNode
)
AddChild
(
name
string
,
child
FsNode
)
{
}
func
(
me
*
DefaultFsNode
)
Lookup
(
name
string
)
(
fi
*
os
.
FileInfo
,
node
FsNode
,
code
Status
)
{
return
nil
,
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Access
(
mode
uint32
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Readlink
(
c
*
Context
)
([]
byte
,
Status
)
{
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Mknod
(
name
string
,
mode
uint32
,
dev
uint32
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
newNode
FsNode
,
code
Status
)
{
return
nil
,
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Mkdir
(
name
string
,
mode
uint32
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
newNode
FsNode
,
code
Status
)
{
return
nil
,
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Unlink
(
name
string
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Rmdir
(
name
string
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Symlink
(
name
string
,
content
string
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
newNode
FsNode
,
code
Status
)
{
return
nil
,
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Rename
(
oldName
string
,
newParent
FsNode
,
newName
string
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Link
(
name
string
,
existing
FsNode
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
newNode
FsNode
,
code
Status
)
{
return
nil
,
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
,
context
*
Context
)
(
file
File
,
fi
*
os
.
FileInfo
,
newNode
FsNode
,
code
Status
)
{
return
nil
,
nil
,
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Open
(
flags
uint32
,
context
*
Context
)
(
file
File
,
code
Status
)
{
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Flush
(
file
File
,
openFlags
uint32
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
OpenDir
(
context
*
Context
)
(
chan
DirEntry
,
Status
)
{
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
GetXAttr
(
attribute
string
,
context
*
Context
)
(
data
[]
byte
,
code
Status
)
{
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
RemoveXAttr
(
attr
string
,
context
*
Context
)
Status
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
SetXAttr
(
attr
string
,
data
[]
byte
,
flags
int
,
context
*
Context
)
Status
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
ListXAttr
(
context
*
Context
)
(
attrs
[]
string
,
code
Status
)
{
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
GetAttr
(
file
File
,
context
*
Context
)
(
fi
*
os
.
FileInfo
,
code
Status
)
{
return
nil
,
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Chmod
(
file
File
,
perms
uint32
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Chown
(
file
File
,
uid
uint32
,
gid
uint32
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Truncate
(
file
File
,
size
uint64
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
func
(
me
*
DefaultFsNode
)
Utimens
(
file
File
,
atime
uint64
,
mtime
uint64
,
context
*
Context
)
(
code
Status
)
{
return
ENOSYS
}
fuse/pathfs.go
View file @
66f65406
...
...
@@ -48,13 +48,14 @@ func (me *PathNodeFs) Root() FsNode {
// there is a one-to-one mapping of paths and inodes, ie. FSes that
// disallow hardlinks.
type
pathInode
struct
{
inode
*
Inode
ifs
*
PathNodeFs
fs
FileSystem
Name
string
// This is nil at the root of the mount.
Parent
*
pathInode
DefaultFsNode
}
// GetPath returns the path relative to the mount governing this
...
...
@@ -92,17 +93,6 @@ func (me *pathInode) RmChild(name string, child FsNode) {
ch
.
Parent
=
nil
}
func
(
me
*
pathInode
)
SetInode
(
node
*
Inode
)
{
if
me
.
inode
!=
nil
{
panic
(
"already have Inode"
)
}
me
.
inode
=
node
}
func
(
me
*
pathInode
)
Inode
()
*
Inode
{
return
me
.
inode
}
////////////////////////////////////////////////////////////////
func
(
me
*
pathInode
)
Readlink
(
c
*
Context
)
([]
byte
,
Status
)
{
...
...
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