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
20b55cbf
Commit
20b55cbf
authored
Mar 03, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored LookupResponse conversion.
parent
d88873bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
server.go
server.go
+13
-8
No files found.
server.go
View file @
20b55cbf
...
@@ -32,6 +32,17 @@ func newServer(fs FileSystem) (s *server, err error) {
...
@@ -32,6 +32,17 @@ func newServer(fs FileSystem) (s *server, err error) {
return
return
}
}
func
convertChildInodeEntry
(
clock
timeutil
.
Clock
,
in
*
ChildInodeEntry
,
out
*
bazilfuse
.
LookupResponse
)
{
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
())
}
// Serve the fuse connection by repeatedly reading requests from the supplied
// Serve the fuse connection by repeatedly reading requests from the supplied
// FUSE connection, responding as dictated by the file system. Return when the
// FUSE connection, responding as dictated by the file system. Return when the
// connection is closed or an unexpected error occurs.
// connection is closed or an unexpected error occurs.
...
@@ -112,14 +123,8 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
...
@@ -112,14 +123,8 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
}
}
// Convert the response.
// Convert the response.
e
:=
&
resp
.
Entry
fuseResp
:=
&
bazilfuse
.
LookupResponse
{}
fuseResp
:=
&
bazilfuse
.
LookupResponse
{
convertChildInodeEntry
(
s
.
clock
,
&
resp
.
Entry
,
fuseResp
)
Node
:
bazilfuse
.
NodeID
(
e
.
Child
),
Generation
:
uint64
(
e
.
Generation
),
Attr
:
convertAttributes
(
e
.
Child
,
e
.
Attributes
),
AttrValid
:
e
.
AttributesExpiration
.
Sub
(
s
.
clock
.
Now
()),
EntryValid
:
e
.
EntryExpiration
.
Sub
(
s
.
clock
.
Now
()),
}
s
.
logger
.
Print
(
"Responding:"
,
fuseResp
)
s
.
logger
.
Print
(
"Responding:"
,
fuseResp
)
typed
.
Respond
(
fuseResp
)
typed
.
Respond
(
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