adding empty fsync

less error now. But still:

vi on write: E514: write error (file system full?)
cp: Input/output error
This commit is contained in:
Chris Lu 2018-05-16 00:54:27 -07:00
parent b303a02461
commit 6bf31467c7

View file

@ -17,7 +17,7 @@ import (
var _ = fs.Node(&File{})
// var _ = fs.NodeOpener(&File{})
// var _ = fs.NodeFsyncer(&File{})
var _ = fs.NodeFsyncer(&File{})
var _ = fs.Handle(&File{})
var _ = fs.HandleReadAller(&File{})
// var _ = fs.HandleReader(&File{})
@ -98,10 +98,19 @@ func (file *File) ReadAll(ctx context.Context) (content []byte, err error) {
return content, err
}
func (file *File) Flush(ctx context.Context, req *fuse.FlushRequest) error {
func (file *File) Fsync(ctx context.Context, req *fuse.FsyncRequest) error {
// fsync works at OS level
// write the file chunks to the filer
fmt.Printf("flush file %+v\n", req)
return nil
}
func (file *File) Flush(ctx context.Context, req *fuse.FlushRequest) error {
// fflush works at file level
// send the data to the OS
fmt.Printf("flush file %+v\n", req)
err := file.wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error {
request := &filer_pb.AppendFileChunksRequest{