turn off debug mode

This commit is contained in:
chrislu
2022-12-27 15:47:28 -08:00
parent 744a757809
commit b010eceaa7
4 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ import (
type FileHandleId uint64
var IsDebug = true
var IsDebugFileReadWrite = false
type FileHandle struct {
fh FileHandleId
@@ -55,7 +55,7 @@ func newFileHandle(wfs *WFS, handleId FileHandleId, inode uint64, entry *filer_p
fh.SetEntry(entry)
}
if IsDebug {
if IsDebugFileReadWrite {
var err error
fh.mirrorFile, err = os.OpenFile("/tmp/sw/"+entry.Name, os.O_RDWR|os.O_CREATE, 0600)
if err != nil {
@@ -112,7 +112,7 @@ func (fh *FileHandle) Release() {
glog.V(4).Infof("Release %s fh %d", fh.entry.Name, fh.handle)
fh.dirtyPages.Destroy()
if IsDebug {
if IsDebugFileReadWrite {
fh.mirrorFile.Close()
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ func (wfs *WFS) Read(cancel <-chan struct{}, in *fuse.ReadIn, buff []byte) (fuse
return nil, fuse.EIO
}
if IsDebug {
if IsDebugFileReadWrite {
// print(".")
mirrorData := make([]byte, totalRead)
fh.mirrorFile.ReadAt(mirrorData, offset)
+1 -1
View File
@@ -181,7 +181,7 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
return fuse.EIO
}
if IsDebug {
if IsDebugFileReadWrite {
fh.mirrorFile.Sync()
}
+1 -1
View File
@@ -73,7 +73,7 @@ func (wfs *WFS) Write(cancel <-chan struct{}, in *fuse.WriteIn, data []byte) (wr
fh.dirtyMetadata = true
if IsDebug {
if IsDebugFileReadWrite {
// print("+")
fh.mirrorFile.WriteAt(data, offset)
}