Fixed hellofs.

geesefs-0-30-9
Aaron Jacobs 2015-03-25 09:55:11 +11:00
parent 6667a7f8f6
commit e96100b5ac
1 changed files with 28 additions and 7 deletions

View File

@ -147,11 +147,17 @@ func (fs *helloFS) patchAttributes(
attr.Crtime = now attr.Crtime = now
} }
func (fs *helloFS) Init(op *fuseops.InitOp) (err error) { func (fs *helloFS) Init(op *fuseops.InitOp) {
var err error
defer func() { op.Respond(err) }()
return return
} }
func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) (err error) { func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) {
var err error
defer func() { op.Respond(err) }()
// Find the info for the parent. // Find the info for the parent.
parentInfo, ok := gInodeInfo[op.Parent] parentInfo, ok := gInodeInfo[op.Parent]
if !ok { if !ok {
@ -176,7 +182,10 @@ func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) (err error) {
} }
func (fs *helloFS) GetInodeAttributes( func (fs *helloFS) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) (err error) { op *fuseops.GetInodeAttributesOp) {
var err error
defer func() { op.Respond(err) }()
// Find the info for this inode. // Find the info for this inode.
info, ok := gInodeInfo[op.Inode] info, ok := gInodeInfo[op.Inode]
if !ok { if !ok {
@ -194,13 +203,19 @@ func (fs *helloFS) GetInodeAttributes(
} }
func (fs *helloFS) OpenDir( func (fs *helloFS) OpenDir(
op *fuseops.OpenDirOp) (err error) { op *fuseops.OpenDirOp) {
var err error
defer func() { op.Respond(err) }()
// Allow opening any directory. // Allow opening any directory.
return return
} }
func (fs *helloFS) ReadDir( func (fs *helloFS) ReadDir(
op *fuseops.ReadDirOp) (err error) { op *fuseops.ReadDirOp) {
var err error
defer func() { op.Respond(err) }()
// Find the info for this inode. // Find the info for this inode.
info, ok := gInodeInfo[op.Inode] info, ok := gInodeInfo[op.Inode]
if !ok { if !ok {
@ -236,13 +251,19 @@ func (fs *helloFS) ReadDir(
} }
func (fs *helloFS) OpenFile( func (fs *helloFS) OpenFile(
op *fuseops.OpenFileOp) (err error) { op *fuseops.OpenFileOp) {
var err error
defer func() { op.Respond(err) }()
// Allow opening any file. // Allow opening any file.
return return
} }
func (fs *helloFS) ReadFile( func (fs *helloFS) ReadFile(
op *fuseops.ReadFileOp) (err error) { op *fuseops.ReadFileOp) {
var err error
defer func() { op.Respond(err) }()
// Let io.ReaderAt deal with the semantics. // Let io.ReaderAt deal with the semantics.
reader := strings.NewReader("Hello, world!") reader := strings.NewReader("Hello, world!")