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
4e84bba2
Commit
4e84bba2
authored
Sep 19, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop obsolete pre-GetAttr increment of lookupCount.
parent
3eef97bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
14 deletions
+15
-14
fuse/fsconnector.go
fuse/fsconnector.go
+5
-5
fuse/fsops.go
fuse/fsops.go
+2
-8
fuse/inode.go
fuse/inode.go
+2
-1
zipfs/multizip_test.go
zipfs/multizip_test.go
+6
-0
No files found.
fuse/fsconnector.go
View file @
4e84bba2
...
...
@@ -89,11 +89,10 @@ func (me *FileSystemConnector) createChild(parent *Inode, name string, fi *os.Fi
}
else
{
parent
.
addChild
(
name
,
child
)
}
me
.
lookupUpdate
(
child
)
out
=
parent
.
mount
.
fileInfoToEntry
(
fi
)
out
.
Ino
=
child
.
nodeId
out
.
NodeId
=
child
.
nodeId
out
.
Ino
=
me
.
lookupUpdate
(
child
)
out
.
NodeId
=
out
.
Ino
return
out
}
...
...
@@ -115,12 +114,13 @@ func (me *FileSystemConnector) toInode(nodeid uint64) *Inode {
return
i
}
// Must run in treeLock.
func
(
me
*
FileSystemConnector
)
lookupUpdate
(
node
*
Inode
)
{
// Must run in treeLock.
Returns the nodeId.
func
(
me
*
FileSystemConnector
)
lookupUpdate
(
node
*
Inode
)
uint64
{
if
node
.
lookupCount
==
0
{
node
.
nodeId
=
me
.
inodeMap
.
Register
(
&
node
.
handled
,
node
)
}
node
.
lookupCount
+=
1
return
node
.
nodeId
}
// Must run outside treeLock.
...
...
fuse/fsops.go
View file @
4e84bba2
...
...
@@ -32,9 +32,8 @@ func (me *FileSystemConnector) lookupMountUpdate(mount *fileSystemMount) (out *E
mount
.
treeLock
.
Lock
()
defer
mount
.
treeLock
.
Unlock
()
me
.
lookupUpdate
(
mount
.
mountInode
)
out
=
mount
.
fileInfoToEntry
(
fi
)
out
.
NodeId
=
m
ount
.
mountInode
.
nodeId
out
.
NodeId
=
m
e
.
lookupUpdate
(
mount
.
mountInode
)
out
.
Ino
=
out
.
NodeId
// We don't do NFS.
out
.
Generation
=
1
...
...
@@ -67,8 +66,6 @@ func (me *FileSystemConnector) preLookup(parent *Inode, name string) (lookupNode
child
:=
parent
.
children
[
name
]
if
child
!=
nil
{
// Make sure the child doesn't die inbetween.
me
.
lookupUpdate
(
child
)
return
nil
,
child
}
...
...
@@ -85,10 +82,6 @@ func (me *FileSystemConnector) postLookup(fi *os.FileInfo, fsNode FsNode, code S
}
if
!
code
.
Ok
()
{
if
attrNode
!=
nil
{
me
.
forgetUpdate
(
attrNode
,
1
)
}
if
code
==
ENOENT
&&
mount
.
options
.
NegativeTimeout
>
0.0
{
return
mount
.
negativeEntry
(),
OK
}
...
...
@@ -96,6 +89,7 @@ func (me *FileSystemConnector) postLookup(fi *os.FileInfo, fsNode FsNode, code S
}
if
attrNode
!=
nil
{
me
.
lookupUpdate
(
attrNode
)
out
=
attrNode
.
mount
.
fileInfoToEntry
(
fi
)
out
.
Generation
=
1
out
.
NodeId
=
attrNode
.
nodeId
...
...
fuse/inode.go
View file @
4e84bba2
...
...
@@ -42,7 +42,8 @@ type Inode struct {
// The nodeId is only used to communicate to the kernel. If
// it is zero, it means the kernel does not know about this
// Inode. nodeIds are chosen by FileSystemConnector.inodeMap.
// Inode. You should probably never read nodeId, but always
// do lookupUpdate() on the node instead.
nodeId
uint64
// lookupCount registers how often the kernel got this inode
...
...
zipfs/multizip_test.go
View file @
4e84bba2
...
...
@@ -78,6 +78,12 @@ func TestMultiZipFs(t *testing.T) {
t
.
Errorf
(
"expected %v got %v"
,
zipFile
,
val
)
}
fi
,
err
=
os
.
Lstat
(
mountPoint
+
"/zipmount"
)
CheckSuccess
(
err
)
if
!
fi
.
IsDirectory
()
{
t
.
Fatal
(
"expect directory for /zipmount, got %v"
,
fi
)
}
// Check that zipfs itself works.
fi
,
err
=
os
.
Stat
(
mountPoint
+
"/zipmount/subdir"
)
CheckSuccess
(
err
)
...
...
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