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
dfbf9db0
Commit
dfbf9db0
authored
Mar 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up path generation.
parent
6f555712
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
fuse/pathfilesystem.go
fuse/pathfilesystem.go
+8
-7
No files found.
fuse/pathfilesystem.go
View file @
dfbf9db0
...
@@ -63,13 +63,11 @@ func (me *inodeData) Key() string {
...
@@ -63,13 +63,11 @@ func (me *inodeData) Key() string {
func
(
me
*
inodeData
)
GetPath
()
(
path
string
,
mount
*
mountData
)
{
func
(
me
*
inodeData
)
GetPath
()
(
path
string
,
mount
*
mountData
)
{
// TODO - softcode this.
// TODO - softcode this.
var
components
[
100
]
string
rev_components
:=
make
([]
string
,
0
,
10
)
j
:=
len
(
components
)
inode
:=
me
inode
:=
me
for
;
inode
!=
nil
&&
inode
.
mount
==
nil
;
inode
=
inode
.
Parent
{
for
;
inode
!=
nil
&&
inode
.
mount
==
nil
;
inode
=
inode
.
Parent
{
j
--
rev_components
=
append
(
rev_components
,
inode
.
Name
)
components
[
j
]
=
inode
.
Name
}
}
if
inode
==
nil
{
if
inode
==
nil
{
panic
(
"did not find parent with mount"
)
panic
(
"did not find parent with mount"
)
...
@@ -81,8 +79,11 @@ func (me *inodeData) GetPath() (path string, mount *mountData) {
...
@@ -81,8 +79,11 @@ func (me *inodeData) GetPath() (path string, mount *mountData) {
if
mount
.
unmountPending
{
if
mount
.
unmountPending
{
return
""
,
nil
return
""
,
nil
}
}
components
:=
make
([]
string
,
len
(
rev_components
))
fullPath
:=
strings
.
Join
(
components
[
j
:
],
"/"
)
for
i
,
v
:=
range
rev_components
{
components
[
len
(
rev_components
)
-
i
-
1
]
=
v
}
fullPath
:=
strings
.
Join
(
components
,
"/"
)
return
fullPath
,
mount
return
fullPath
,
mount
}
}
...
...
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