Fixed hellofs.
parent
6667a7f8f6
commit
e96100b5ac
|
@ -147,11 +147,17 @@ func (fs *helloFS) patchAttributes(
|
|||
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
|
||||
}
|
||||
|
||||
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.
|
||||
parentInfo, ok := gInodeInfo[op.Parent]
|
||||
if !ok {
|
||||
|
@ -176,7 +182,10 @@ func (fs *helloFS) LookUpInode(op *fuseops.LookUpInodeOp) (err error) {
|
|||
}
|
||||
|
||||
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.
|
||||
info, ok := gInodeInfo[op.Inode]
|
||||
if !ok {
|
||||
|
@ -194,13 +203,19 @@ func (fs *helloFS) GetInodeAttributes(
|
|||
}
|
||||
|
||||
func (fs *helloFS) OpenDir(
|
||||
op *fuseops.OpenDirOp) (err error) {
|
||||
op *fuseops.OpenDirOp) {
|
||||
var err error
|
||||
defer func() { op.Respond(err) }()
|
||||
|
||||
// Allow opening any directory.
|
||||
return
|
||||
}
|
||||
|
||||
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.
|
||||
info, ok := gInodeInfo[op.Inode]
|
||||
if !ok {
|
||||
|
@ -236,13 +251,19 @@ func (fs *helloFS) ReadDir(
|
|||
}
|
||||
|
||||
func (fs *helloFS) OpenFile(
|
||||
op *fuseops.OpenFileOp) (err error) {
|
||||
op *fuseops.OpenFileOp) {
|
||||
var err error
|
||||
defer func() { op.Respond(err) }()
|
||||
|
||||
// Allow opening any file.
|
||||
return
|
||||
}
|
||||
|
||||
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.
|
||||
reader := strings.NewReader("Hello, world!")
|
||||
|
||||
|
|
Loading…
Reference in New Issue