Fixed hellofs.

geesefs-0-30-9
Aaron Jacobs 2015-06-05 14:23:05 +10:00
parent ea1d0606dc
commit ba71991231
1 changed files with 7 additions and 28 deletions

View File

@ -147,17 +147,11 @@ func (fs *helloFS) patchAttributes(
attr.Crtime = now attr.Crtime = now
} }
func (fs *helloFS) Init(op *fuseops.InitOp) { func (fs *helloFS) Init(op *fuseops.InitOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &err)
return return
} }
func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) { func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &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 {
@ -182,10 +176,7 @@ func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) {
} }
func (fs *helloFS) GetInodeAttributes( func (fs *helloFS) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) { op *fuseops.GetInodeAttributesOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &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 {
@ -203,19 +194,13 @@ func (fs *helloFS) GetInodeAttributes(
} }
func (fs *helloFS) OpenDir( func (fs *helloFS) OpenDir(
op *fuseops.OpenDirOp) { op *fuseops.OpenDirOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &err)
// Allow opening any directory. // Allow opening any directory.
return return
} }
func (fs *helloFS) ReadDir( func (fs *helloFS) ReadDir(
op *fuseops.ReadDirOp) { op *fuseops.ReadDirOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &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 {
@ -251,19 +236,13 @@ func (fs *helloFS) ReadDir(
} }
func (fs *helloFS) OpenFile( func (fs *helloFS) OpenFile(
op *fuseops.OpenFileOp) { op *fuseops.OpenFileOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &err)
// Allow opening any file. // Allow opening any file.
return return
} }
func (fs *helloFS) ReadFile( func (fs *helloFS) ReadFile(
op *fuseops.ReadFileOp) { op *fuseops.ReadFileOp) (err error) {
var err error
defer fuseutil.RespondToOp(op, &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!")