From b010eceaa7b07e9507bc9b3ad37540ab0540a2a8 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 27 Dec 2022 15:47:28 -0800 Subject: [PATCH] turn off debug mode --- weed/mount/filehandle.go | 6 +++--- weed/mount/weedfs_file_read.go | 2 +- weed/mount/weedfs_file_sync.go | 2 +- weed/mount/weedfs_file_write.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/weed/mount/filehandle.go b/weed/mount/filehandle.go index 7709a6921..8fee21bb0 100644 --- a/weed/mount/filehandle.go +++ b/weed/mount/filehandle.go @@ -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() } } diff --git a/weed/mount/weedfs_file_read.go b/weed/mount/weedfs_file_read.go index d098b6883..cf54b31e9 100644 --- a/weed/mount/weedfs_file_read.go +++ b/weed/mount/weedfs_file_read.go @@ -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) diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go index 2022f88a6..7964b378f 100644 --- a/weed/mount/weedfs_file_sync.go +++ b/weed/mount/weedfs_file_sync.go @@ -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() } diff --git a/weed/mount/weedfs_file_write.go b/weed/mount/weedfs_file_write.go index 5e2e14f25..76ab3a39f 100644 --- a/weed/mount/weedfs_file_write.go +++ b/weed/mount/weedfs_file_write.go @@ -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) }