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
c6e90c78
Commit
c6e90c78
authored
Jun 22, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide PrefixFileSystem type.
parent
ce00c912
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
28 deletions
+36
-28
fuse/pathfs/prefixfs.go
fuse/pathfs/prefixfs.go
+36
-28
No files found.
fuse/pathfs/prefixfs.go
View file @
c6e90c78
...
...
@@ -9,107 +9,115 @@ import (
)
// PrefixFileSystem adds a path prefix to incoming calls.
type
P
refixFileSystem
struct
{
FileSystem
type
p
refixFileSystem
struct
{
FileSystem
FileSystem
Prefix
string
}
func
(
fs
*
PrefixFileSystem
)
prefixed
(
n
string
)
string
{
func
NewPrefixFileSystem
(
fs
FileSystem
,
prefix
string
)
FileSystem
{
return
&
prefixFileSystem
{
fs
,
prefix
}
}
func
(
fs
*
prefixFileSystem
)
prefixed
(
n
string
)
string
{
return
filepath
.
Join
(
fs
.
Prefix
,
n
)
}
func
(
fs
*
P
refixFileSystem
)
GetAttr
(
name
string
,
context
*
fuse
.
Context
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
GetAttr
(
name
string
,
context
*
fuse
.
Context
)
(
*
fuse
.
Attr
,
fuse
.
Status
)
{
return
fs
.
FileSystem
.
GetAttr
(
fs
.
prefixed
(
name
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Readlink
(
name
string
,
context
*
fuse
.
Context
)
(
string
,
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Readlink
(
name
string
,
context
*
fuse
.
Context
)
(
string
,
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Readlink
(
fs
.
prefixed
(
name
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Mknod
(
name
string
,
mode
uint32
,
dev
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
p
refixFileSystem
)
Mknod
(
name
string
,
mode
uint32
,
dev
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
return
fs
.
FileSystem
.
Mknod
(
fs
.
prefixed
(
name
),
mode
,
dev
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Mkdir
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
p
refixFileSystem
)
Mkdir
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
fuse
.
Status
{
return
fs
.
FileSystem
.
Mkdir
(
fs
.
prefixed
(
name
),
mode
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Unlink
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Unlink
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Unlink
(
fs
.
prefixed
(
name
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Rmdir
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Rmdir
(
name
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Rmdir
(
fs
.
prefixed
(
name
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Symlink
(
value
string
,
linkName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Symlink
(
value
string
,
linkName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Symlink
(
value
,
fs
.
prefixed
(
linkName
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Rename
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Rename
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Rename
(
fs
.
prefixed
(
oldName
),
fs
.
prefixed
(
newName
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Link
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Link
(
oldName
string
,
newName
string
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Link
(
fs
.
prefixed
(
oldName
),
fs
.
prefixed
(
newName
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
Chmod
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Chmod
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Chmod
(
fs
.
prefixed
(
name
),
mode
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Chown
(
name
string
,
uid
uint32
,
gid
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Chown
(
name
string
,
uid
uint32
,
gid
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Chown
(
fs
.
prefixed
(
name
),
uid
,
gid
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Truncate
(
name
string
,
offset
uint64
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Truncate
(
name
string
,
offset
uint64
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Truncate
(
fs
.
prefixed
(
name
),
offset
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Open
(
name
string
,
flags
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Open
(
name
string
,
flags
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Open
(
fs
.
prefixed
(
name
),
flags
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
OpenDir
(
name
string
,
context
*
fuse
.
Context
)
(
stream
[]
fuse
.
DirEntry
,
status
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
OpenDir
(
name
string
,
context
*
fuse
.
Context
)
(
stream
[]
fuse
.
DirEntry
,
status
fuse
.
Status
)
{
return
fs
.
FileSystem
.
OpenDir
(
fs
.
prefixed
(
name
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
OnMount
(
nodeFs
*
PathNodeFs
)
{
func
(
fs
*
p
refixFileSystem
)
OnMount
(
nodeFs
*
PathNodeFs
)
{
fs
.
FileSystem
.
OnMount
(
nodeFs
)
}
func
(
fs
*
P
refixFileSystem
)
OnUnmount
()
{
func
(
fs
*
p
refixFileSystem
)
OnUnmount
()
{
fs
.
FileSystem
.
OnUnmount
()
}
func
(
fs
*
P
refixFileSystem
)
Access
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Access
(
name
string
,
mode
uint32
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Access
(
fs
.
prefixed
(
name
),
mode
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Create
(
name
string
,
flags
uint32
,
mode
uint32
,
context
*
fuse
.
Context
)
(
file
fuse
.
File
,
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Create
(
fs
.
prefixed
(
name
),
flags
,
mode
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
Utimens
(
name
string
,
Atime
*
time
.
Time
,
Mtime
*
time
.
Time
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
Utimens
(
name
string
,
Atime
*
time
.
Time
,
Mtime
*
time
.
Time
,
context
*
fuse
.
Context
)
(
code
fuse
.
Status
)
{
return
fs
.
FileSystem
.
Utimens
(
fs
.
prefixed
(
name
),
Atime
,
Mtime
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
GetXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
([]
byte
,
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
GetXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
([]
byte
,
fuse
.
Status
)
{
return
fs
.
FileSystem
.
GetXAttr
(
fs
.
prefixed
(
name
),
attr
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
p
refixFileSystem
)
SetXAttr
(
name
string
,
attr
string
,
data
[]
byte
,
flags
int
,
context
*
fuse
.
Context
)
fuse
.
Status
{
return
fs
.
FileSystem
.
SetXAttr
(
fs
.
prefixed
(
name
),
attr
,
data
,
flags
,
context
)
}
func
(
fs
*
P
refixFileSystem
)
ListXAttr
(
name
string
,
context
*
fuse
.
Context
)
([]
string
,
fuse
.
Status
)
{
func
(
fs
*
p
refixFileSystem
)
ListXAttr
(
name
string
,
context
*
fuse
.
Context
)
([]
string
,
fuse
.
Status
)
{
return
fs
.
FileSystem
.
ListXAttr
(
fs
.
prefixed
(
name
),
context
)
}
func
(
fs
*
P
refixFileSystem
)
RemoveXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
fuse
.
Status
{
func
(
fs
*
p
refixFileSystem
)
RemoveXAttr
(
name
string
,
attr
string
,
context
*
fuse
.
Context
)
fuse
.
Status
{
return
fs
.
FileSystem
.
RemoveXAttr
(
fs
.
prefixed
(
name
),
attr
,
context
)
}
func
(
fs
*
PrefixFileSystem
)
String
()
string
{
return
fmt
.
Sprintf
(
"PrefixFileSystem(%s,%s)"
,
fs
.
FileSystem
.
String
(),
fs
.
Prefix
)
func
(
fs
*
prefixFileSystem
)
String
()
string
{
return
fmt
.
Sprintf
(
"prefixFileSystem(%s,%s)"
,
fs
.
FileSystem
.
String
(),
fs
.
Prefix
)
}
func
(
fs
*
prefixFileSystem
)
StatFs
(
name
string
)
*
fuse
.
StatfsOut
{
return
fs
.
FileSystem
.
StatFs
(
fs
.
prefixed
(
name
))
}
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