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
023a3889
Commit
023a3889
authored
Sep 06, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move NegativeEntry() to fileSystemMount.negativeEntry()
parent
0ea25f6d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
fuse/fsmount.go
fuse/fsmount.go
+9
-0
fuse/fsops.go
fuse/fsops.go
+2
-2
fuse/misc.go
fuse/misc.go
+0
-8
No files found.
fuse/fsmount.go
View file @
023a3889
...
...
@@ -122,3 +122,12 @@ func (me *fileSystemMount) registerFileHandle(node *Inode, dir rawDir, f File, f
handle
:=
me
.
openFiles
.
Register
(
&
b
.
Handled
,
b
)
return
handle
,
b
}
// Creates a return entry for a non-existent path.
func
(
me
*
fileSystemMount
)
negativeEntry
()
*
EntryOut
{
out
:=
new
(
EntryOut
)
out
.
NodeId
=
0
SplitNs
(
me
.
options
.
NegativeTimeout
,
&
out
.
EntryValid
,
&
out
.
EntryValidNsec
)
return
out
}
fuse/fsops.go
View file @
023a3889
...
...
@@ -24,7 +24,7 @@ func (me *FileSystemConnector) Lookup(header *InHeader, name string) (out *Entry
func
(
me
*
FileSystemConnector
)
lookupMountUpdate
(
mount
*
fileSystemMount
)
(
out
*
EntryOut
,
status
Status
)
{
fi
,
err
:=
mount
.
fs
.
Root
()
.
GetAttr
(
nil
,
nil
)
if
err
==
ENOENT
&&
mount
.
options
.
NegativeTimeout
>
0.0
{
return
NegativeEntry
(
mount
.
options
.
NegativeTimeout
),
OK
return
mount
.
negativeEntry
(
),
OK
}
if
!
err
.
Ok
()
{
return
nil
,
err
...
...
@@ -93,7 +93,7 @@ func (me *FileSystemConnector) postLookup(fi *os.FileInfo, fsNode FsNode, code S
}
if
code
==
ENOENT
&&
mount
.
options
.
NegativeTimeout
>
0.0
{
return
NegativeEntry
(
mount
.
options
.
NegativeTimeout
),
OK
return
mount
.
negativeEntry
(
),
OK
}
return
nil
,
code
}
...
...
fuse/misc.go
View file @
023a3889
...
...
@@ -118,14 +118,6 @@ func Writev(fd int, packet [][]byte) (n int, err os.Error) {
return
n
,
err
}
// Creates a return entry for a non-existent path.
func
NegativeEntry
(
time
float64
)
*
EntryOut
{
out
:=
new
(
EntryOut
)
out
.
NodeId
=
0
SplitNs
(
time
,
&
out
.
EntryValid
,
&
out
.
EntryValidNsec
)
return
out
}
func
ModeToType
(
mode
uint32
)
uint32
{
return
(
mode
&
0170000
)
>>
12
}
...
...
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