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
Kirill Smelkov
go-fuse
Commits
c66fc8b9
Commit
c66fc8b9
authored
Sep 08, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename variable.
parent
4673f8b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
fuse/pathfs.go
fuse/pathfs.go
+24
-24
No files found.
fuse/pathfs.go
View file @
c66fc8b9
...
...
@@ -115,7 +115,7 @@ func NewPathNodeFs(fs FileSystem) *PathNodeFs {
root
:
root
,
clientInodeMap
:
map
[
uint64
][]
*
clientInodePath
{},
}
root
.
if
s
=
me
root
.
pathF
s
=
me
return
me
}
...
...
@@ -127,7 +127,7 @@ func (me *PathNodeFs) Root() FsNode {
// the inode). This structure is used to implement glue for FSes where
// there is a one-to-one mapping of paths and inodes.
type
pathInode
struct
{
if
s
*
PathNodeFs
pathF
s
*
PathNodeFs
fs
FileSystem
Name
string
...
...
@@ -161,11 +161,11 @@ func (me *pathInode) GetPath() (path string) {
for
;
n
.
Parent
!=
nil
;
n
=
n
.
Parent
{
rev_components
=
append
(
rev_components
,
n
.
Name
)
}
if
n
!=
me
.
if
s
.
root
{
if
n
!=
me
.
pathF
s
.
root
{
return
".deleted"
}
p
:=
ReverseJoin
(
rev_components
,
"/"
)
if
me
.
if
s
.
Debug
{
if
me
.
pathF
s
.
Debug
{
log
.
Printf
(
"Inode %d = %q"
,
me
.
Inode
()
.
nodeId
,
p
)
}
...
...
@@ -178,14 +178,14 @@ func (me *pathInode) AddChild(name string, child FsNode) {
ch
.
Name
=
name
if
ch
.
clientInode
>
0
{
me
.
if
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
if
s
.
clientInodeMapMutex
.
Unlock
()
m
:=
me
.
if
s
.
clientInodeMap
[
ch
.
clientInode
]
me
.
pathF
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
pathF
s
.
clientInodeMapMutex
.
Unlock
()
m
:=
me
.
pathF
s
.
clientInodeMap
[
ch
.
clientInode
]
e
:=
&
clientInodePath
{
me
,
name
,
child
.
(
*
pathInode
),
}
m
=
append
(
m
,
e
)
me
.
if
s
.
clientInodeMap
[
ch
.
clientInode
]
=
m
me
.
pathF
s
.
clientInodeMap
[
ch
.
clientInode
]
=
m
}
}
...
...
@@ -193,9 +193,9 @@ func (me *pathInode) RmChild(name string, child FsNode) {
ch
:=
child
.
(
*
pathInode
)
if
ch
.
clientInode
>
0
{
me
.
if
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
if
s
.
clientInodeMapMutex
.
Unlock
()
m
:=
me
.
if
s
.
clientInodeMap
[
ch
.
clientInode
]
me
.
pathF
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
pathF
s
.
clientInodeMapMutex
.
Unlock
()
m
:=
me
.
pathF
s
.
clientInodeMap
[
ch
.
clientInode
]
idx
:=
-
1
for
i
,
v
:=
range
m
{
...
...
@@ -213,7 +213,7 @@ func (me *pathInode) RmChild(name string, child FsNode) {
ch
.
Name
=
m
[
0
]
.
name
return
}
else
{
me
.
if
s
.
clientInodeMap
[
ch
.
clientInode
]
=
nil
,
false
me
.
pathF
s
.
clientInodeMap
[
ch
.
clientInode
]
=
nil
,
false
}
}
...
...
@@ -226,10 +226,10 @@ func (me *pathInode) setClientInode(ino uint64) {
return
}
defer
me
.
Inode
()
.
LockTree
()()
me
.
if
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
if
s
.
clientInodeMapMutex
.
Unlock
()
me
.
pathF
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
pathF
s
.
clientInodeMapMutex
.
Unlock
()
if
me
.
clientInode
!=
0
{
me
.
if
s
.
clientInodeMap
[
me
.
clientInode
]
=
nil
,
false
me
.
pathF
s
.
clientInodeMap
[
me
.
clientInode
]
=
nil
,
false
}
me
.
clientInode
=
ino
...
...
@@ -237,7 +237,7 @@ func (me *pathInode) setClientInode(ino uint64) {
e
:=
&
clientInodePath
{
me
.
Parent
,
me
.
Name
,
me
,
}
me
.
ifs
.
clientInodeMap
[
ino
]
=
append
(
me
.
if
s
.
clientInodeMap
[
ino
],
e
)
me
.
pathFs
.
clientInodeMap
[
ino
]
=
append
(
me
.
pathF
s
.
clientInodeMap
[
ino
],
e
)
}
}
...
...
@@ -245,9 +245,9 @@ func (me *pathInode) OnForget() {
if
me
.
clientInode
==
0
{
return
}
me
.
if
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
if
s
.
clientInodeMapMutex
.
Unlock
()
me
.
if
s
.
clientInodeMap
[
me
.
clientInode
]
=
nil
,
false
me
.
pathF
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
pathF
s
.
clientInodeMapMutex
.
Unlock
()
me
.
pathF
s
.
clientInodeMap
[
me
.
clientInode
]
=
nil
,
false
}
////////////////////////////////////////////////////////////////
...
...
@@ -379,13 +379,13 @@ func (me *pathInode) createChild(name string) *pathInode {
i
.
Parent
=
me
i
.
Name
=
name
i
.
fs
=
me
.
fs
i
.
ifs
=
me
.
if
s
i
.
pathFs
=
me
.
pathF
s
return
i
}
func
(
me
*
pathInode
)
Open
(
flags
uint32
,
context
*
Context
)
(
file
File
,
code
Status
)
{
file
,
code
=
me
.
fs
.
Open
(
me
.
GetPath
(),
flags
,
context
)
if
me
.
if
s
.
Debug
{
if
me
.
pathF
s
.
Debug
{
file
=
&
WithFlags
{
File
:
file
,
Description
:
me
.
GetPath
(),
...
...
@@ -406,9 +406,9 @@ func (me *pathInode) Lookup(name string, context *Context) (fi *os.FileInfo, nod
func
(
me
*
pathInode
)
findChild
(
ino
uint64
,
name
string
)
(
out
*
pathInode
)
{
if
ino
>
0
{
me
.
if
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
if
s
.
clientInodeMapMutex
.
Unlock
()
v
:=
me
.
if
s
.
clientInodeMap
[
ino
]
me
.
pathF
s
.
clientInodeMapMutex
.
Lock
()
defer
me
.
pathF
s
.
clientInodeMapMutex
.
Unlock
()
v
:=
me
.
pathF
s
.
clientInodeMap
[
ino
]
if
len
(
v
)
>
0
{
out
=
v
[
0
]
.
node
}
...
...
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