forked from Elara6331/itd
Compare commits
No commits in common. "dc53ead3391800b01dec394326e53f8b28337913" and "b28c386c4ebd36ca5c814e134d15f784b50f2b82" have entirely different histories.
dc53ead339
...
b28c386c4e
1
fuse.go
1
fuse.go
@ -17,6 +17,7 @@ func startFUSE(ctx context.Context, dev *infinitime.Device) error {
|
|||||||
log.Error("Building root node failed").
|
log.Error("Building root node failed").
|
||||||
Err(err).
|
Err(err).
|
||||||
Send()
|
Send()
|
||||||
|
return err
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,6 +298,9 @@ func (fh *bytesFileWriteHandle) Write(ctx context.Context, data []byte, off int6
|
|||||||
|
|
||||||
var _ fs.FileFlusher = (*bytesFileWriteHandle)(nil)
|
var _ fs.FileFlusher = (*bytesFileWriteHandle)(nil)
|
||||||
func (fh *bytesFileWriteHandle) Flush(ctx context.Context) (errno syscall.Errno) {
|
func (fh *bytesFileWriteHandle) Flush(ctx context.Context) (errno syscall.Errno) {
|
||||||
|
if len(fh.content) == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
log.Debug("FUSE Attempting flush").Str("path", fh.path).Send()
|
log.Debug("FUSE Attempting flush").Str("path", fh.path).Send()
|
||||||
fp, err := myfs.Create(fh.path, uint32(len(fh.content)))
|
fp, err := myfs.Create(fh.path, uint32(len(fh.content)))
|
||||||
@ -306,16 +309,6 @@ func (fh *bytesFileWriteHandle) Flush(ctx context.Context) (errno syscall.Errno)
|
|||||||
return syscallErr(err)
|
return syscallErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(fh.content) == 0 {
|
|
||||||
log.Debug("FUSE Flush no data to write").Str("path", fh.path).Send()
|
|
||||||
err = fp.Close()
|
|
||||||
if err != nil {
|
|
||||||
log.Error("FUSE Flush failed during close").Str("path", fh.path).Err(err).Send()
|
|
||||||
return syscallErr(err)
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
// For every progress event
|
// For every progress event
|
||||||
for sent := range fp.Progress() {
|
for sent := range fp.Progress() {
|
||||||
|
Loading…
Reference in New Issue
Block a user