mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-16 03:20:50 +02:00
turn off debug mode
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user