Fixed some brokenness.

geesefs-0-30-9
Aaron Jacobs 2015-02-27 13:41:04 +11:00
parent 4bf575151c
commit 70479d63bd
1 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import (
"io"
"log"
"github.com/jacobsa/gcsfuse/timeutil"
"golang.org/x/net/context"
bazilfuse "bazil.org/fuse"
@ -16,6 +17,7 @@ import (
// An object that terminates one end of the userspace <-> FUSE VFS connection.
type server struct {
logger *log.Logger
clock timeutil.Clock
fs FileSystem
}
@ -23,6 +25,7 @@ type server struct {
func newServer(fs FileSystem) (s *server, err error) {
s = &server{
logger: getLogger(),
clock: timeutil.RealClock(),
fs: fs,
}
@ -99,7 +102,7 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
// Convert the response.
fuseResp := &bazilfuse.GetattrResponse{
Attr: resp.Attributes,
Attr: convertAttributes(req.Inode, resp.Attributes),
AttrValid: resp.AttributesExpiration.Sub(s.clock.Now()),
}
@ -173,3 +176,10 @@ func (s *server) handleFuseRequest(fuseReq bazilfuse.Request) {
typed.RespondError(ENOSYS)
}
}
func convertAttributes(inode InodeID, attr InodeAttributes) bazilfuse.Attr {
return bazilfuse.Attr{
Inode: uint64(inode),
Size: attr.Size,
}
}