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

Move ReverseJoin and CurrentOwner into misc.go.

parent 75dc7589
...@@ -170,3 +170,19 @@ func ioctl(fd int, cmd int, arg uintptr) (int, int) { ...@@ -170,3 +170,19 @@ func ioctl(fd int, cmd int, arg uintptr) (int, int) {
func Version() string { func Version() string {
return version return version
} }
func ReverseJoin(rev_components []string, sep string) string {
components := make([]string, len(rev_components))
for i, v := range rev_components {
components[len(rev_components)-i-1] = v
}
return strings.Join(components, sep)
}
func CurrentOwner() *Owner {
return &Owner{
Uid: uint32(os.Getuid()),
Gid: uint32(os.Getgid()),
}
}
...@@ -207,14 +207,6 @@ func (me *inode) GetFullPath() (path string) { ...@@ -207,14 +207,6 @@ func (me *inode) GetFullPath() (path string) {
return ReverseJoin(rev_components, "/") return ReverseJoin(rev_components, "/")
} }
func ReverseJoin(rev_components []string, sep string) string {
components := make([]string, len(rev_components))
for i, v := range rev_components {
components[len(rev_components)-i-1] = v
}
return strings.Join(components, sep)
}
func (me *inode) GetPath() (path string, mount *mountData) { func (me *inode) GetPath() (path string, mount *mountData) {
if me.NodeId != FUSE_ROOT_ID && me.Parent == nil { if me.NodeId != FUSE_ROOT_ID && me.Parent == nil {
// Deleted node. Treat as if the filesystem was unmounted. // Deleted node. Treat as if the filesystem was unmounted.
...@@ -277,13 +269,6 @@ func (me *inode) setParent(newParent *inode) { ...@@ -277,13 +269,6 @@ func (me *inode) setParent(newParent *inode) {
} }
} }
func CurrentOwner() *Owner {
return &Owner{
Uid: uint32(os.Getuid()),
Gid: uint32(os.Getgid()),
}
}
func NewFileSystemOptions() *FileSystemOptions { func NewFileSystemOptions() *FileSystemOptions {
return &FileSystemOptions{ return &FileSystemOptions{
NegativeTimeout: 0.0, NegativeTimeout: 0.0,
......
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