Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
5cf906e3
Commit
5cf906e3
authored
Mar 16, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Declared a choke point for fixing expiration times.
parent
1d3cb249
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
server.go
server.go
+9
-4
No files found.
server.go
View file @
5cf906e3
...
...
@@ -18,6 +18,7 @@ import (
"fmt"
"io"
"log"
"time"
"github.com/jacobsa/gcsfuse/timeutil"
"golang.org/x/net/context"
...
...
@@ -43,6 +44,10 @@ func newServer(fs FileSystem) (s *server, err error) {
return
}
// Convert an absolute cache expiration time to a relative time from now for
// consumption by fuse.
func
convertExpirationTime
(
t
time
.
Time
)
time
.
Duration
func
convertChildInodeEntry
(
clock
timeutil
.
Clock
,
in
*
ChildInodeEntry
,
...
...
@@ -50,8 +55,8 @@ func convertChildInodeEntry(
out
.
Node
=
bazilfuse
.
NodeID
(
in
.
Child
)
out
.
Generation
=
uint64
(
in
.
Generation
)
out
.
Attr
=
convertAttributes
(
in
.
Child
,
in
.
Attributes
)
out
.
AttrValid
=
in
.
AttributesExpiration
.
Sub
(
clock
.
Now
()
)
out
.
EntryValid
=
in
.
EntryExpiration
.
Sub
(
clock
.
Now
()
)
out
.
AttrValid
=
convertExpirationTime
(
in
.
AttributesExpiration
)
out
.
EntryValid
=
convertExpirationTime
(
in
.
EntryExpiration
)
}
func
convertHeader
(
...
...
@@ -165,7 +170,7 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
// Convert the response.
fuseResp
:=
&
bazilfuse
.
GetattrResponse
{
Attr
:
convertAttributes
(
req
.
Inode
,
resp
.
Attributes
),
AttrValid
:
resp
.
AttributesExpiration
.
Sub
(
s
.
clock
.
Now
()
),
AttrValid
:
convertExpirationTime
(
resp
.
AttributesExpiration
),
}
s
.
logger
.
Println
(
"Responding:"
,
fuseResp
)
...
...
@@ -205,7 +210,7 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
// Convert the response.
fuseResp
:=
&
bazilfuse
.
SetattrResponse
{
Attr
:
convertAttributes
(
req
.
Inode
,
resp
.
Attributes
),
AttrValid
:
resp
.
AttributesExpiration
.
Sub
(
s
.
clock
.
Now
()
),
AttrValid
:
convertExpirationTime
(
resp
.
AttributesExpiration
),
}
s
.
logger
.
Println
(
"Responding:"
,
fuseResp
)
...
...
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