Skip to content

Commit

Permalink
Move ReverseJoin and CurrentOwner into misc.go.
Browse files Browse the repository at this point in the history
  • Loading branch information
hanwen committed May 25, 2011
1 parent 75dc758 commit e975a7d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
16 changes: 16 additions & 0 deletions fuse/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,19 @@ func ioctl(fd int, cmd int, arg uintptr) (int, int) {
func Version() string {
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()),
}
}

15 changes: 0 additions & 15 deletions fuse/pathfilesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,6 @@ func (me *inode) GetFullPath() (path string) {
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) {
if me.NodeId != FUSE_ROOT_ID && me.Parent == nil {
// Deleted node. Treat as if the filesystem was unmounted.
Expand Down Expand Up @@ -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 {
return &FileSystemOptions{
NegativeTimeout: 0.0,
Expand Down

0 comments on commit e975a7d

Please sign in to comment.