aboutsummaryrefslogtreecommitdiff
path: root/weed/mount
diff options
context:
space:
mode:
Diffstat (limited to 'weed/mount')
-rw-r--r--weed/mount/dirty_pages_chunked.go8
-rw-r--r--weed/mount/filehandle.go6
-rw-r--r--weed/mount/filehandle_read.go18
-rw-r--r--weed/mount/filer_conf.go4
-rw-r--r--weed/mount/inode_to_path.go10
-rw-r--r--weed/mount/meta_cache/meta_cache.go12
-rw-r--r--weed/mount/meta_cache/meta_cache_init.go6
-rw-r--r--weed/mount/meta_cache/meta_cache_subscribe.go8
-rw-r--r--weed/mount/page_writer.go6
-rw-r--r--weed/mount/page_writer/page_chunk_swapfile.go8
-rw-r--r--weed/mount/page_writer/upload_pipeline.go12
-rw-r--r--weed/mount/weedfs.go2
-rw-r--r--weed/mount/weedfs_attr.go12
-rw-r--r--weed/mount/weedfs_dir_lookup.go12
-rw-r--r--weed/mount/weedfs_dir_mkrm.go12
-rw-r--r--weed/mount/weedfs_dir_read.go8
-rw-r--r--weed/mount/weedfs_file_copy_range.go6
-rw-r--r--weed/mount/weedfs_file_io.go4
-rw-r--r--weed/mount/weedfs_file_lseek.go4
-rw-r--r--weed/mount/weedfs_file_mkrm.go14
-rw-r--r--weed/mount/weedfs_file_read.go4
-rw-r--r--weed/mount/weedfs_file_sync.go16
-rw-r--r--weed/mount/weedfs_file_write.go2
-rw-r--r--weed/mount/weedfs_grpc_server.go4
-rw-r--r--weed/mount/weedfs_link.go4
-rw-r--r--weed/mount/weedfs_quota.go12
-rw-r--r--weed/mount/weedfs_rename.go10
-rw-r--r--weed/mount/weedfs_stats.go12
-rw-r--r--weed/mount/weedfs_symlink.go4
-rw-r--r--weed/mount/weedfs_write.go6
-rw-r--r--weed/mount/wfs_filer_client.go4
-rw-r--r--weed/mount/wfs_save.go6
32 files changed, 128 insertions, 128 deletions
diff --git a/weed/mount/dirty_pages_chunked.go b/weed/mount/dirty_pages_chunked.go
index 25b071e7d..f178023ce 100644
--- a/weed/mount/dirty_pages_chunked.go
+++ b/weed/mount/dirty_pages_chunked.go
@@ -5,7 +5,7 @@ import (
"io"
"sync"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/mount/page_writer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -41,7 +41,7 @@ func newMemoryChunkPages(fh *FileHandle, chunkSize int64) *ChunkedDirtyPages {
func (pages *ChunkedDirtyPages) AddPage(offset int64, data []byte, isSequential bool, tsNs int64) {
pages.hasWrites = true
- glog.V(4).Infof("%v memory AddPage [%d, %d)", pages.fh.fh, offset, offset+int64(len(data)))
+ log.V(-1).Infof("%v memory AddPage [%d, %d)", pages.fh.fh, offset, offset+int64(len(data)))
pages.uploadPipeline.SaveDataAt(data, offset, isSequential, tsNs)
return
@@ -73,13 +73,13 @@ func (pages *ChunkedDirtyPages) saveChunkedFileIntervalToStorage(reader io.Reade
fileName := fileFullPath.Name()
chunk, err := pages.fh.wfs.saveDataAsChunk(fileFullPath)(reader, fileName, offset, modifiedTsNs)
if err != nil {
- glog.V(0).Infof("%v saveToStorage [%d,%d): %v", fileFullPath, offset, offset+size, err)
+ log.V(3).Infof("%v saveToStorage [%d,%d): %v", fileFullPath, offset, offset+size, err)
pages.lastErr = err
return
}
pages.fh.AddChunks([]*filer_pb.FileChunk{chunk})
pages.fh.entryChunkGroup.AddChunk(chunk)
- glog.V(3).Infof("%v saveToStorage %s [%d,%d)", fileFullPath, chunk.FileId, offset, offset+size)
+ log.V(0).Infof("%v saveToStorage %s [%d,%d)", fileFullPath, chunk.FileId, offset, offset+size)
}
diff --git a/weed/mount/filehandle.go b/weed/mount/filehandle.go
index f47d4a877..ba4703665 100644
--- a/weed/mount/filehandle.go
+++ b/weed/mount/filehandle.go
@@ -2,7 +2,7 @@ package mount
import (
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
"os"
@@ -77,10 +77,10 @@ func (fh *FileHandle) SetEntry(entry *filer_pb.Entry) {
var resolveManifestErr error
fh.entryChunkGroup, resolveManifestErr = filer.NewChunkGroup(fh.wfs.LookupFn(), fh.wfs.chunkCache, entry.Chunks)
if resolveManifestErr != nil {
- glog.Warningf("failed to resolve manifest chunks in %+v", entry)
+ log.Warningf("failed to resolve manifest chunks in %+v", entry)
}
} else {
- glog.Fatalf("setting file handle entry to nil")
+ log.Fatalf("setting file handle entry to nil")
}
fh.entry.SetEntry(entry)
}
diff --git a/weed/mount/filehandle_read.go b/weed/mount/filehandle_read.go
index ce5f96341..c455b3624 100644
--- a/weed/mount/filehandle_read.go
+++ b/weed/mount/filehandle_read.go
@@ -6,7 +6,7 @@ import (
"io"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -31,10 +31,10 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, int64, e
entry := fh.GetEntry()
if entry.IsInRemoteOnly() {
- glog.V(4).Infof("download remote entry %s", fileFullPath)
+ log.V(-1).Infof("download remote entry %s", fileFullPath)
err := fh.downloadRemoteEntry(entry)
if err != nil {
- glog.V(1).Infof("download remote entry %s: %v", fileFullPath, err)
+ log.V(2).Infof("download remote entry %s: %v", fileFullPath, err)
return 0, 0, err
}
}
@@ -45,28 +45,28 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, int64, e
}
if fileSize == 0 {
- glog.V(1).Infof("empty fh %v", fileFullPath)
+ log.V(2).Infof("empty fh %v", fileFullPath)
return 0, 0, io.EOF
} else if offset == fileSize {
return 0, 0, io.EOF
} else if offset >= fileSize {
- glog.V(1).Infof("invalid read, fileSize %d, offset %d for %s", fileSize, offset, fileFullPath)
+ log.V(2).Infof("invalid read, fileSize %d, offset %d for %s", fileSize, offset, fileFullPath)
return 0, 0, io.EOF
}
if offset < int64(len(entry.Content)) {
totalRead := copy(buff, entry.Content[offset:])
- glog.V(4).Infof("file handle read cached %s [%d,%d] %d", fileFullPath, offset, offset+int64(totalRead), totalRead)
+ log.V(-1).Infof("file handle read cached %s [%d,%d] %d", fileFullPath, offset, offset+int64(totalRead), totalRead)
return int64(totalRead), 0, nil
}
totalRead, ts, err := fh.entryChunkGroup.ReadDataAt(fileSize, buff, offset)
if err != nil && err != io.EOF {
- glog.Errorf("file handle read %s: %v", fileFullPath, err)
+ log.Errorf("file handle read %s: %v", fileFullPath, err)
}
- // glog.V(4).Infof("file handle read %s [%d,%d] %d : %v", fileFullPath, offset, offset+int64(totalRead), totalRead, err)
+ // log.V(-1).Infof("file handle read %s [%d,%d] %d : %v", fileFullPath, offset, offset+int64(totalRead), totalRead, err)
return int64(totalRead), ts, err
}
@@ -83,7 +83,7 @@ func (fh *FileHandle) downloadRemoteEntry(entry *LockedEntry) error {
Name: entry.Name,
}
- glog.V(4).Infof("download entry: %v", request)
+ log.V(-1).Infof("download entry: %v", request)
resp, err := client.CacheRemoteObjectToLocalCluster(context.Background(), request)
if err != nil {
return fmt.Errorf("CacheRemoteObjectToLocalCluster file %s: %v", fileFullPath, err)
diff --git a/weed/mount/filer_conf.go b/weed/mount/filer_conf.go
index 3c71bb9ce..de383e660 100644
--- a/weed/mount/filer_conf.go
+++ b/weed/mount/filer_conf.go
@@ -7,7 +7,7 @@ import (
"time"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
@@ -38,7 +38,7 @@ func (wfs *WFS) subscribeFilerConfEvents() (*meta_cache.MetadataFollower, error)
})
if err != nil {
if errors.Is(err, filer_pb.ErrNotFound) {
- glog.V(0).Infof("fuse filer conf %s not found", confFullName)
+ log.V(3).Infof("fuse filer conf %s not found", confFullName)
} else {
return nil, err
}
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index da38750d1..a21dd331c 100644
--- a/weed/mount/inode_to_path.go
+++ b/weed/mount/inode_to_path.go
@@ -2,7 +2,7 @@ package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/util"
"sync"
"time"
@@ -126,7 +126,7 @@ func (i *InodeToPath) GetInode(path util.FullPath) (uint64, bool) {
defer i.Unlock()
inode, found := i.path2inode[path]
if !found {
- // glog.Fatalf("GetInode unknown inode for %s", path)
+ // log.Fatalf("GetInode unknown inode for %s", path)
// this could be the parent for mount point
}
return inode, found
@@ -155,8 +155,8 @@ func (i *InodeToPath) MarkChildrenCached(fullpath util.FullPath) {
inode, found := i.path2inode[fullpath]
if !found {
// https://github.com/seaweedfs/seaweedfs/issues/4968
- // glog.Fatalf("MarkChildrenCached not found inode %v", fullpath)
- glog.Warningf("MarkChildrenCached not found inode %v", fullpath)
+ // log.Fatalf("MarkChildrenCached not found inode %v", fullpath)
+ log.Warningf("MarkChildrenCached not found inode %v", fullpath)
return
}
path, found := i.inode2path[inode]
@@ -263,7 +263,7 @@ func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (sourceInod
entry.nlookup++
}
} else {
- glog.Errorf("MovePath %s to %s: sourceInode %d not found", sourcePath, targetPath, sourceInode)
+ log.Errorf("MovePath %s to %s: sourceInode %d not found", sourcePath, targetPath, sourceInode)
}
return
}
diff --git a/weed/mount/meta_cache/meta_cache.go b/weed/mount/meta_cache/meta_cache.go
index 0f0b1de30..99f6546fb 100644
--- a/weed/mount/meta_cache/meta_cache.go
+++ b/weed/mount/meta_cache/meta_cache.go
@@ -8,7 +8,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/filer/leveldb"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@@ -51,7 +51,7 @@ func openMetaStore(dbFolder string) filer.VirtualFilerStore {
}
if err := store.Initialize(config, ""); err != nil {
- glog.Fatalf("Failed to initialize metadata cache store for %s: %+v", store.GetName(), err)
+ log.Fatalf("Failed to initialize metadata cache store for %s: %+v", store.GetName(), err)
}
return filer.NewFilerStoreWrapper(store)
@@ -74,7 +74,7 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti
entry, err := mc.localStore.FindEntry(ctx, oldPath)
if err != nil && err != filer_pb.ErrNotFound {
- glog.Errorf("Metacache: find entry error: %v", err)
+ log.Errorf("Metacache: find entry error: %v", err)
return err
}
if entry != nil {
@@ -84,7 +84,7 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti
// leave the update to the following InsertEntry operation
} else {
ctx = context.WithValue(ctx, "OP", "MV")
- glog.V(3).Infof("DeleteEntry %s", oldPath)
+ log.V(0).Infof("DeleteEntry %s", oldPath)
if err := mc.localStore.DeleteEntry(ctx, oldPath); err != nil {
return err
}
@@ -97,7 +97,7 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti
if newEntry != nil {
newDir, _ := newEntry.DirAndName()
if mc.isCachedFn(util.FullPath(newDir)) {
- glog.V(3).Infof("InsertEntry %s/%s", newDir, newEntry.Name())
+ log.V(0).Infof("InsertEntry %s/%s", newDir, newEntry.Name())
if err := mc.localStore.InsertEntry(ctx, newEntry); err != nil {
return err
}
@@ -143,7 +143,7 @@ func (mc *MetaCache) ListDirectoryEntries(ctx context.Context, dirPath util.Full
if !mc.isCachedFn(dirPath) {
// if this request comes after renaming, it should be fine
- glog.Warningf("unsynchronized dir: %v", dirPath)
+ log.Warningf("unsynchronized dir: %v", dirPath)
}
_, err := mc.localStore.ListDirectoryEntries(ctx, dirPath, startFileName, includeStartFile, limit, func(entry *filer.Entry) bool {
diff --git a/weed/mount/meta_cache/meta_cache_init.go b/weed/mount/meta_cache/meta_cache_init.go
index 1cab499e0..01953af8d 100644
--- a/weed/mount/meta_cache/meta_cache_init.go
+++ b/weed/mount/meta_cache/meta_cache_init.go
@@ -5,7 +5,7 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@@ -41,7 +41,7 @@ func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.Full
func doEnsureVisited(mc *MetaCache, client filer_pb.FilerClient, path util.FullPath) error {
- glog.V(4).Infof("ReadDirAllEntries %s ...", path)
+ log.V(-1).Infof("ReadDirAllEntries %s ...", path)
err := util.Retry("ReadDirAllEntries", func() error {
return filer_pb.ReadDirAllEntries(client, path, "", func(pbEntry *filer_pb.Entry, isLast bool) error {
@@ -50,7 +50,7 @@ func doEnsureVisited(mc *MetaCache, client filer_pb.FilerClient, path util.FullP
return nil
}
if err := mc.doInsertEntry(context.Background(), entry); err != nil {
- glog.V(0).Infof("read %s: %v", entry.FullPath, err)
+ log.V(3).Infof("read %s: %v", entry.FullPath, err)
return err
}
return nil
diff --git a/weed/mount/meta_cache/meta_cache_subscribe.go b/weed/mount/meta_cache/meta_cache_subscribe.go
index 9a4553013..4e37a4753 100644
--- a/weed/mount/meta_cache/meta_cache_subscribe.go
+++ b/weed/mount/meta_cache/meta_cache_subscribe.go
@@ -3,7 +3,7 @@ package meta_cache
import (
"context"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
@@ -63,7 +63,7 @@ func SubscribeMetaEvents(mc *MetaCache, selfSignature int32, client filer_pb.Fil
var newEntry *filer.Entry
if message.OldEntry != nil {
oldPath = util.NewFullPath(dir, message.OldEntry.Name)
- glog.V(4).Infof("deleting %v", oldPath)
+ log.V(-1).Infof("deleting %v", oldPath)
}
if message.NewEntry != nil {
@@ -71,7 +71,7 @@ func SubscribeMetaEvents(mc *MetaCache, selfSignature int32, client filer_pb.Fil
dir = message.NewParentPath
}
key := util.NewFullPath(dir, message.NewEntry.Name)
- glog.V(4).Infof("creating %v", key)
+ log.V(-1).Infof("creating %v", key)
newEntry = filer.FromPbEntry(dir, message.NewEntry)
}
err := mc.AtomicUpdateEntryFromFiler(context.Background(), oldPath, newEntry)
@@ -116,7 +116,7 @@ func SubscribeMetaEvents(mc *MetaCache, selfSignature int32, client filer_pb.Fil
metadataFollowOption.ClientEpoch++
return pb.WithFilerClientFollowMetadata(client, metadataFollowOption, mergeProcessors(processEventFn, followers...))
}, func(err error) bool {
- glog.Errorf("follow metadata updates: %v", err)
+ log.Errorf("follow metadata updates: %v", err)
return true
})
diff --git a/weed/mount/page_writer.go b/weed/mount/page_writer.go
index 58ae03cda..0af6b5a6e 100644
--- a/weed/mount/page_writer.go
+++ b/weed/mount/page_writer.go
@@ -1,7 +1,7 @@
package mount
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/mount/page_writer"
)
@@ -31,7 +31,7 @@ func newPageWriter(fh *FileHandle, chunkSize int64) *PageWriter {
func (pw *PageWriter) AddPage(offset int64, data []byte, isSequential bool, tsNs int64) {
- glog.V(4).Infof("%v AddPage [%d, %d)", pw.fh.fh, offset, offset+int64(len(data)))
+ log.V(-1).Infof("%v AddPage [%d, %d)", pw.fh.fh, offset, offset+int64(len(data)))
chunkIndex := offset / pw.chunkSize
for i := chunkIndex; len(data) > 0; i++ {
@@ -51,7 +51,7 @@ func (pw *PageWriter) FlushData() error {
}
func (pw *PageWriter) ReadDirtyDataAt(data []byte, offset int64, tsNs int64) (maxStop int64) {
- glog.V(4).Infof("ReadDirtyDataAt %v [%d, %d)", pw.fh.inode, offset, offset+int64(len(data)))
+ log.V(-1).Infof("ReadDirtyDataAt %v [%d, %d)", pw.fh.inode, offset, offset+int64(len(data)))
chunkIndex := offset / pw.chunkSize
for i := chunkIndex; len(data) > 0; i++ {
diff --git a/weed/mount/page_writer/page_chunk_swapfile.go b/weed/mount/page_writer/page_chunk_swapfile.go
index dd9781b68..bd31d9221 100644
--- a/weed/mount/page_writer/page_chunk_swapfile.go
+++ b/weed/mount/page_writer/page_chunk_swapfile.go
@@ -1,7 +1,7 @@
package page_writer
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/mem"
"io"
@@ -53,7 +53,7 @@ func (sf *SwapFile) NewSwapFileChunk(logicChunkIndex LogicChunkIndex) (tc *SwapF
var err error
sf.file, err = os.CreateTemp(sf.dir, "")
if err != nil {
- glog.Errorf("create swap file: %v", err)
+ log.Errorf("create swap file: %v", err)
return nil
}
}
@@ -108,7 +108,7 @@ func (sc *SwapFileChunk) WriteDataAt(src []byte, offset int64, tsNs int64) (n in
n, err = sc.swapfile.file.WriteAt(src, int64(sc.actualChunkIndex)*sc.swapfile.chunkSize+innerOffset)
sc.usage.MarkWritten(innerOffset, innerOffset+int64(n), tsNs)
if err != nil {
- glog.Errorf("failed to write swap file %s: %v", sc.swapfile.file.Name(), err)
+ log.Errorf("failed to write swap file %s: %v", sc.swapfile.file.Name(), err)
}
//sc.memChunk.WriteDataAt(src, offset, tsNs)
sc.activityScore.MarkWrite()
@@ -135,7 +135,7 @@ func (sc *SwapFileChunk) ReadDataAt(p []byte, off int64, tsNs int64) (maxStop in
if err == io.EOF && n == int(logicStop-logicStart) {
err = nil
}
- glog.Errorf("failed to reading swap file %s: %v", sc.swapfile.file.Name(), err)
+ log.Errorf("failed to reading swap file %s: %v", sc.swapfile.file.Name(), err)
break
}
maxStop = max(maxStop, logicStop)
diff --git a/weed/mount/page_writer/upload_pipeline.go b/weed/mount/page_writer/upload_pipeline.go
index bd7fc99dd..acbee2802 100644
--- a/weed/mount/page_writer/upload_pipeline.go
+++ b/weed/mount/page_writer/upload_pipeline.go
@@ -2,7 +2,7 @@ package page_writer
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/util"
"sync"
"sync/atomic"
@@ -34,7 +34,7 @@ type SealedChunk struct {
func (sc *SealedChunk) FreeReference(messageOnFree string) {
sc.referenceCounter--
if sc.referenceCounter == 0 {
- glog.V(4).Infof("Free sealed chunk: %s", messageOnFree)
+ log.V(-1).Infof("Free sealed chunk: %s", messageOnFree)
sc.chunk.FreeResource()
}
}
@@ -131,7 +131,7 @@ func (up *UploadPipeline) MaybeReadDataAt(p []byte, off int64, tsNs int64) (maxS
sealedChunk, found := up.sealedChunks[logicChunkIndex]
if found {
maxStop = sealedChunk.chunk.ReadDataAt(p, off, tsNs)
- glog.V(4).Infof("%s read sealed memchunk [%d,%d)", up.filepath, off, maxStop)
+ log.V(-1).Infof("%s read sealed memchunk [%d,%d)", up.filepath, off, maxStop)
}
// read from writable chunks last
@@ -140,7 +140,7 @@ func (up *UploadPipeline) MaybeReadDataAt(p []byte, off int64, tsNs int64) (maxS
return
}
writableMaxStop := writableChunk.ReadDataAt(p, off, tsNs)
- glog.V(4).Infof("%s read writable memchunk [%d,%d)", up.filepath, off, writableMaxStop)
+ log.V(-1).Infof("%s read writable memchunk [%d,%d)", up.filepath, off, writableMaxStop)
maxStop = max(maxStop, writableMaxStop)
return
@@ -168,7 +168,7 @@ func (up *UploadPipeline) maybeMoveToSealed(memChunk PageChunk, logicChunkIndex
func (up *UploadPipeline) moveToSealed(memChunk PageChunk, logicChunkIndex LogicChunkIndex) {
atomic.AddInt32(&up.uploaderCount, 1)
- glog.V(4).Infof("%s uploaderCount %d ++> %d", up.filepath, up.uploaderCount-1, up.uploaderCount)
+ log.V(-1).Infof("%s uploaderCount %d ++> %d", up.filepath, up.uploaderCount-1, up.uploaderCount)
if oldMemChunk, found := up.sealedChunks[logicChunkIndex]; found {
oldMemChunk.FreeReference(fmt.Sprintf("%s replace chunk %d", up.filepath, logicChunkIndex))
@@ -188,7 +188,7 @@ func (up *UploadPipeline) moveToSealed(memChunk PageChunk, logicChunkIndex Logic
// notify waiting process
atomic.AddInt32(&up.uploaderCount, -1)
- glog.V(4).Infof("%s uploaderCount %d --> %d", up.filepath, up.uploaderCount+1, up.uploaderCount)
+ log.V(-1).Infof("%s uploaderCount %d --> %d", up.filepath, up.uploaderCount+1, up.uploaderCount)
// Lock and Unlock are not required,
// but it may signal multiple times during one wakeup,
// and the waiting goroutine may miss some of them!
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index 77ffb7e77..89a9c0617 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -183,7 +183,7 @@ func (wfs *WFS) maybeReadEntry(inode uint64) (path util.FullPath, fh *FileHandle
func (wfs *WFS) maybeLoadEntry(fullpath util.FullPath) (*filer_pb.Entry, fuse.Status) {
- // glog.V(3).Infof("read entry cache miss %s", fullpath)
+ // log.V(0).Infof("read entry cache miss %s", fullpath)
dir, name := fullpath.DirAndName()
// return a valid entry for the mount root
diff --git a/weed/mount/weedfs_attr.go b/weed/mount/weedfs_attr.go
index 0bd5771cd..92bf8c3af 100644
--- a/weed/mount/weedfs_attr.go
+++ b/weed/mount/weedfs_attr.go
@@ -7,12 +7,12 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
func (wfs *WFS) GetAttr(cancel <-chan struct{}, input *fuse.GetAttrIn, out *fuse.AttrOut) (code fuse.Status) {
- glog.V(4).Infof("GetAttr %v", input.NodeId)
+ log.V(-1).Infof("GetAttr %v", input.NodeId)
if input.NodeId == 1 {
wfs.setRootAttr(out)
return fuse.OK
@@ -57,7 +57,7 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
}
if size, ok := input.GetSize(); ok {
- glog.V(4).Infof("%v setattr set size=%v chunks=%d", path, size, len(entry.GetChunks()))
+ log.V(-1).Infof("%v setattr set size=%v chunks=%d", path, size, len(entry.GetChunks()))
if size < filer.FileSize(entry) {
// fmt.Printf("truncate %v \n", fullPath)
var chunks []*filer_pb.FileChunk
@@ -69,10 +69,10 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
int64Size = int64(size) - chunk.Offset
if int64Size > 0 {
chunks = append(chunks, chunk)
- glog.V(4).Infof("truncated chunk %+v from %d to %d\n", chunk.GetFileIdString(), chunk.Size, int64Size)
+ log.V(-1).Infof("truncated chunk %+v from %d to %d\n", chunk.GetFileIdString(), chunk.Size, int64Size)
chunk.Size = uint64(int64Size)
} else {
- glog.V(4).Infof("truncated whole chunk %+v\n", chunk.GetFileIdString())
+ log.V(-1).Infof("truncated whole chunk %+v\n", chunk.GetFileIdString())
truncatedChunks = append(truncatedChunks, chunk)
}
} else {
@@ -96,7 +96,7 @@ func (wfs *WFS) SetAttr(cancel <-chan struct{}, input *fuse.SetAttrIn, out *fuse
entry.WormEnforcedAtTsNs = time.Now().UnixNano()
}
- // glog.V(4).Infof("setAttr mode %o", mode)
+ // log.V(-1).Infof("setAttr mode %o", mode)
entry.Attributes.FileMode = chmod(entry.Attributes.FileMode, mode)
if input.NodeId == 1 {
wfs.option.MountMode = os.FileMode(chmod(uint32(wfs.option.MountMode), mode))
diff --git a/weed/mount/weedfs_dir_lookup.go b/weed/mount/weedfs_dir_lookup.go
index 7fc10ef28..55750d409 100644
--- a/weed/mount/weedfs_dir_lookup.go
+++ b/weed/mount/weedfs_dir_lookup.go
@@ -6,7 +6,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -31,7 +31,7 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
visitErr := meta_cache.EnsureVisited(wfs.metaCache, wfs, dirPath)
if visitErr != nil {
- glog.Errorf("dir Lookup %s: %v", dirPath, visitErr)
+ log.Errorf("dir Lookup %s: %v", dirPath, visitErr)
return fuse.EIO
}
localEntry, cacheErr := wfs.metaCache.FindEntry(context.Background(), fullFilePath)
@@ -40,15 +40,15 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
}
if localEntry == nil {
- // glog.V(3).Infof("dir Lookup cache miss %s", fullFilePath)
+ // log.V(0).Infof("dir Lookup cache miss %s", fullFilePath)
entry, err := filer_pb.GetEntry(wfs, fullFilePath)
if err != nil {
- glog.V(1).Infof("dir GetEntry %s: %v", fullFilePath, err)
+ log.V(2).Infof("dir GetEntry %s: %v", fullFilePath, err)
return fuse.ENOENT
}
localEntry = filer.FromPbEntry(string(dirPath), entry)
} else {
- glog.V(4).Infof("dir Lookup cache hit %s", fullFilePath)
+ log.V(-1).Infof("dir Lookup cache hit %s", fullFilePath)
}
if localEntry == nil {
@@ -60,7 +60,7 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
if fh, found := wfs.fhMap.FindFileHandle(inode); found {
fh.entryLock.RLock()
if entry := fh.GetEntry().GetEntry(); entry != nil {
- glog.V(4).Infof("lookup opened file %s size %d", dirPath.Child(localEntry.Name()), filer.FileSize(entry))
+ log.V(-1).Infof("lookup opened file %s size %d", dirPath.Child(localEntry.Name()), filer.FileSize(entry))
localEntry = filer.FromPbEntry(string(dirPath), entry)
}
fh.entryLock.RUnlock()
diff --git a/weed/mount/weedfs_dir_mkrm.go b/weed/mount/weedfs_dir_mkrm.go
index e69c9796e..612ea97a0 100644
--- a/weed/mount/weedfs_dir_mkrm.go
+++ b/weed/mount/weedfs_dir_mkrm.go
@@ -11,7 +11,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -62,9 +62,9 @@ func (wfs *WFS) Mkdir(cancel <-chan struct{}, in *fuse.MkdirIn, name string, out
SkipCheckParentDirectory: true,
}
- glog.V(1).Infof("mkdir: %v", request)
+ log.V(2).Infof("mkdir: %v", request)
if err := filer_pb.CreateEntry(client, request); err != nil {
- glog.V(0).Infof("mkdir %s: %v", entryFullPath, err)
+ log.V(3).Infof("mkdir %s: %v", entryFullPath, err)
return err
}
@@ -75,7 +75,7 @@ func (wfs *WFS) Mkdir(cancel <-chan struct{}, in *fuse.MkdirIn, name string, out
return nil
})
- glog.V(3).Infof("mkdir %s: %v", entryFullPath, err)
+ log.V(0).Infof("mkdir %s: %v", entryFullPath, err)
if err != nil {
return fuse.EIO
@@ -105,11 +105,11 @@ func (wfs *WFS) Rmdir(cancel <-chan struct{}, header *fuse.InHeader, name string
}
entryFullPath := dirFullPath.Child(name)
- glog.V(3).Infof("remove directory: %v", entryFullPath)
+ log.V(0).Infof("remove directory: %v", entryFullPath)
ignoreRecursiveErr := true // ignore recursion error since the OS should manage it
err := filer_pb.Remove(wfs, string(dirFullPath), name, true, false, ignoreRecursiveErr, false, []int32{wfs.signature})
if err != nil {
- glog.V(0).Infof("remove %s: %v", entryFullPath, err)
+ log.V(3).Infof("remove %s: %v", entryFullPath, err)
if strings.Contains(err.Error(), filer.MsgFailDelNonEmptyFolder) {
return fuse.Status(syscall.ENOTEMPTY)
}
diff --git a/weed/mount/weedfs_dir_read.go b/weed/mount/weedfs_dir_read.go
index 6e18b50e8..cada1ecac 100644
--- a/weed/mount/weedfs_dir_read.go
+++ b/weed/mount/weedfs_dir_read.go
@@ -4,7 +4,7 @@ import (
"context"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/mount/meta_cache"
"github.com/seaweedfs/seaweedfs/weed/util"
"math"
@@ -170,7 +170,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
return false
}
if fh, found := wfs.fhMap.FindFileHandle(inode); found {
- glog.V(4).Infof("readdir opened file %s", dirPath.Child(dirEntry.Name))
+ log.V(-1).Infof("readdir opened file %s", dirPath.Child(dirEntry.Name))
entry = filer.FromPbEntry(string(dirPath), fh.GetEntry().GetEntry())
}
wfs.outputFilerEntry(entryOut, inode, entry)
@@ -218,7 +218,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
var err error
if err = meta_cache.EnsureVisited(wfs.metaCache, wfs, dirPath); err != nil {
- glog.Errorf("dir ReadDirAll %s: %v", dirPath, err)
+ log.Errorf("dir ReadDirAll %s: %v", dirPath, err)
return fuse.EIO
}
listErr := wfs.metaCache.ListDirectoryEntries(context.Background(), dirPath, lastEntryName, false, int64(math.MaxInt32), func(entry *filer.Entry) bool {
@@ -226,7 +226,7 @@ func (wfs *WFS) doReadDirectory(input *fuse.ReadIn, out *fuse.DirEntryList, isPl
return processEachEntryFn(entry)
})
if listErr != nil {
- glog.Errorf("list meta cache: %v", listErr)
+ log.Errorf("list meta cache: %v", listErr)
return fuse.EIO
}
diff --git a/weed/mount/weedfs_file_copy_range.go b/weed/mount/weedfs_file_copy_range.go
index 43ec289ab..5bb5f4136 100644
--- a/weed/mount/weedfs_file_copy_range.go
+++ b/weed/mount/weedfs_file_copy_range.go
@@ -7,7 +7,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
)
// CopyFileRange copies data from one file to another from and to specified offsets.
@@ -62,7 +62,7 @@ func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn)
return 0, fuse.EISDIR
}
- glog.V(4).Infof(
+ log.V(-1).Infof(
"CopyFileRange %s fhIn %d -> %s fhOut %d, [%d,%d) -> [%d,%d)",
fhIn.FullPath(), fhIn.fh,
fhOut.FullPath(), fhOut.fh,
@@ -73,7 +73,7 @@ func (wfs *WFS) CopyFileRange(cancel <-chan struct{}, in *fuse.CopyFileRangeIn)
data := make([]byte, in.Len)
totalRead, err := readDataByFileHandle(data, fhIn, int64(in.OffIn))
if err != nil {
- glog.Warningf("file handle read %s %d: %v", fhIn.FullPath(), totalRead, err)
+ log.Warningf("file handle read %s %d: %v", fhIn.FullPath(), totalRead, err)
return 0, fuse.EIO
}
data = data[:totalRead]
diff --git a/weed/mount/weedfs_file_io.go b/weed/mount/weedfs_file_io.go
index 04fe7f21c..e641ab5a4 100644
--- a/weed/mount/weedfs_file_io.go
+++ b/weed/mount/weedfs_file_io.go
@@ -2,7 +2,7 @@ package mount
import (
"github.com/hanwen/go-fuse/v2/fuse"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
)
/**
@@ -71,7 +71,7 @@ func (wfs *WFS) Open(cancel <-chan struct{}, in *fuse.OpenIn, out *fuse.OpenOut)
// remove the direct_io flag, as it is not well-supported on macOS
// https://code.google.com/archive/p/macfuse/wikis/OPTIONS.wiki recommended to avoid the direct_io flag
if in.Flags&fuse.FOPEN_DIRECT_IO != 0 {
- glog.V(4).Infof("macfuse direct_io mode %v => false\n", in.Flags&fuse.FOPEN_DIRECT_IO != 0)
+ log.V(-1).Infof("macfuse direct_io mode %v => false\n", in.Flags&fuse.FOPEN_DIRECT_IO != 0)
out.OpenFlags &^= fuse.FOPEN_DIRECT_IO
}
}
diff --git a/weed/mount/weedfs_file_lseek.go b/weed/mount/weedfs_file_lseek.go
index 0cf7ef43b..275545f72 100644
--- a/weed/mount/weedfs_file_lseek.go
+++ b/weed/mount/weedfs_file_lseek.go
@@ -7,7 +7,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
)
// These are non-POSIX extensions
@@ -42,7 +42,7 @@ func (wfs *WFS) Lseek(cancel <-chan struct{}, in *fuse.LseekIn, out *fuse.LseekO
fileSize := int64(filer.FileSize(fh.GetEntry().GetEntry()))
offset := max(int64(in.Offset), 0)
- glog.V(4).Infof(
+ log.V(-1).Infof(
"Lseek %s fh %d in [%d,%d], whence %d",
fh.FullPath(), fh.fh, offset, fileSize, in.Whence,
)
diff --git a/weed/mount/weedfs_file_mkrm.go b/weed/mount/weedfs_file_mkrm.go
index e6139e88e..e6430c452 100644
--- a/weed/mount/weedfs_file_mkrm.go
+++ b/weed/mount/weedfs_file_mkrm.go
@@ -8,7 +8,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -82,9 +82,9 @@ func (wfs *WFS) Mknod(cancel <-chan struct{}, in *fuse.MknodIn, name string, out
SkipCheckParentDirectory: true,
}
- glog.V(1).Infof("mknod: %v", request)
+ log.V(2).Infof("mknod: %v", request)
if err := filer_pb.CreateEntry(client, request); err != nil {
- glog.V(0).Infof("mknod %s: %v", entryFullPath, err)
+ log.V(3).Infof("mknod %s: %v", entryFullPath, err)
return err
}
@@ -95,7 +95,7 @@ func (wfs *WFS) Mknod(cancel <-chan struct{}, in *fuse.MknodIn, name string, out
return nil
})
- glog.V(3).Infof("mknod %s: %v", entryFullPath, err)
+ log.V(0).Infof("mknod %s: %v", entryFullPath, err)
if err != nil {
return fuse.EIO
@@ -135,17 +135,17 @@ func (wfs *WFS) Unlink(cancel <-chan struct{}, header *fuse.InHeader, name strin
}
// first, ensure the filer store can correctly delete
- glog.V(3).Infof("remove file: %v", entryFullPath)
+ log.V(0).Infof("remove file: %v", entryFullPath)
isDeleteData := entry != nil && entry.HardLinkCounter <= 1
err := filer_pb.Remove(wfs, string(dirFullPath), name, isDeleteData, false, false, false, []int32{wfs.signature})
if err != nil {
- glog.V(0).Infof("remove %s: %v", entryFullPath, err)
+ log.V(3).Infof("remove %s: %v", entryFullPath, err)
return fuse.OK
}
// then, delete meta cache
if err = wfs.metaCache.DeleteEntry(context.Background(), entryFullPath); err != nil {
- glog.V(3).Infof("local DeleteEntry %s: %v", entryFullPath, err)
+ log.V(0).Infof("local DeleteEntry %s: %v", entryFullPath, err)
return fuse.EIO
}
diff --git a/weed/mount/weedfs_file_read.go b/weed/mount/weedfs_file_read.go
index bf9c89071..8b39d1fc9 100644
--- a/weed/mount/weedfs_file_read.go
+++ b/weed/mount/weedfs_file_read.go
@@ -8,7 +8,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
)
/**
@@ -48,7 +48,7 @@ func (wfs *WFS) Read(cancel <-chan struct{}, in *fuse.ReadIn, buff []byte) (fuse
offset := int64(in.Offset)
totalRead, err := readDataByFileHandle(buff, fh, offset)
if err != nil {
- glog.Warningf("file handle read %s %d: %v", fh.FullPath(), totalRead, err)
+ log.Warningf("file handle read %s %d: %v", fh.FullPath(), totalRead, err)
return nil, fuse.EIO
}
diff --git a/weed/mount/weedfs_file_sync.go b/weed/mount/weedfs_file_sync.go
index e13ab198d..0eabe3216 100644
--- a/weed/mount/weedfs_file_sync.go
+++ b/weed/mount/weedfs_file_sync.go
@@ -8,7 +8,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@@ -98,11 +98,11 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
fileFullPath := fh.FullPath()
dir, name := fileFullPath.DirAndName()
// send the data to the OS
- glog.V(4).Infof("doFlush %s fh %d", fileFullPath, fh.fh)
+ log.V(-1).Infof("doFlush %s fh %d", fileFullPath, fh.fh)
if !wfs.IsOverQuota {
if err := fh.dirtyPages.FlushData(); err != nil {
- glog.Errorf("%v doFlush: %v", fileFullPath, err)
+ log.Errorf("%v doFlush: %v", fileFullPath, err)
return fuse.EIO
}
}
@@ -141,9 +141,9 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
SkipCheckParentDirectory: true,
}
- glog.V(4).Infof("%s set chunks: %v", fileFullPath, len(entry.GetChunks()))
+ log.V(-1).Infof("%s set chunks: %v", fileFullPath, len(entry.GetChunks()))
//for i, chunk := range entry.GetChunks() {
- // glog.V(4).Infof("%s chunks %d: %v [%d,%d)", fileFullPath, i, chunk.GetFileIdString(), chunk.Offset, chunk.Offset+int64(chunk.Size))
+ // log.V(-1).Infof("%s chunks %d: %v [%d,%d)", fileFullPath, i, chunk.GetFileIdString(), chunk.Offset, chunk.Offset+int64(chunk.Size))
//}
manifestChunks, nonManifestChunks := filer.SeparateManifestChunks(entry.GetChunks())
@@ -152,7 +152,7 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
chunks, manifestErr := filer.MaybeManifestize(wfs.saveDataAsChunk(fileFullPath), chunks)
if manifestErr != nil {
// not good, but should be ok
- glog.V(0).Infof("MaybeManifestize: %v", manifestErr)
+ log.V(3).Infof("MaybeManifestize: %v", manifestErr)
}
entry.Chunks = append(chunks, manifestChunks...)
@@ -160,7 +160,7 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
defer wfs.mapPbIdFromFilerToLocal(request.Entry)
if err := filer_pb.CreateEntry(client, request); err != nil {
- glog.Errorf("fh flush create %s: %v", fileFullPath, err)
+ log.Errorf("fh flush create %s: %v", fileFullPath, err)
return fmt.Errorf("fh flush create %s: %v", fileFullPath, err)
}
@@ -174,7 +174,7 @@ func (wfs *WFS) doFlush(fh *FileHandle, uid, gid uint32) fuse.Status {
}
if err != nil {
- glog.Errorf("%v fh %d flush: %v", fileFullPath, fh.fh, err)
+ log.Errorf("%v fh %d flush: %v", fileFullPath, fh.fh, err)
return fuse.EIO
}
diff --git a/weed/mount/weedfs_file_write.go b/weed/mount/weedfs_file_write.go
index 1ec20c294..0e72420da 100644
--- a/weed/mount/weedfs_file_write.go
+++ b/weed/mount/weedfs_file_write.go
@@ -60,7 +60,7 @@ func (wfs *WFS) Write(cancel <-chan struct{}, in *fuse.WriteIn, data []byte) (wr
entry.Content = nil
offset := int64(in.Offset)
entry.Attributes.FileSize = uint64(max(offset+int64(len(data)), int64(entry.Attributes.FileSize)))
- // glog.V(4).Infof("%v write [%d,%d) %d", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data)), len(req.Data))
+ // log.V(-1).Infof("%v write [%d,%d) %d", fh.f.fullpath(), req.Offset, req.Offset+int64(len(req.Data)), len(req.Data))
fh.dirtyPages.AddPage(offset, data, fh.dirtyPages.writerPattern.IsSequentialMode(), tsNs)
diff --git a/weed/mount/weedfs_grpc_server.go b/weed/mount/weedfs_grpc_server.go
index f867f2d80..245f8c70a 100644
--- a/weed/mount/weedfs_grpc_server.go
+++ b/weed/mount/weedfs_grpc_server.go
@@ -3,7 +3,7 @@ package mount
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/mount_pb"
)
@@ -11,7 +11,7 @@ func (wfs *WFS) Configure(ctx context.Context, request *mount_pb.ConfigureReques
if wfs.option.Collection == "" {
return nil, fmt.Errorf("mount quota only works when mounted to a new folder with a collection")
}
- glog.V(0).Infof("quota changed from %d to %d", wfs.option.Quota, request.CollectionCapacity)
+ log.V(3).Infof("quota changed from %d to %d", wfs.option.Quota, request.CollectionCapacity)
wfs.option.Quota = request.GetCollectionCapacity()
return &mount_pb.ConfigureResponse{}, nil
}
diff --git a/weed/mount/weedfs_link.go b/weed/mount/weedfs_link.go
index 8c5b67ce2..a1786ea76 100644
--- a/weed/mount/weedfs_link.go
+++ b/weed/mount/weedfs_link.go
@@ -8,7 +8,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -105,7 +105,7 @@ func (wfs *WFS) Link(cancel <-chan struct{}, in *fuse.LinkIn, name string, out *
newEntryPath := newParentPath.Child(name)
if err != nil {
- glog.V(0).Infof("Link %v -> %s: %v", oldEntryPath, newEntryPath, err)
+ log.V(3).Infof("Link %v -> %s: %v", oldEntryPath, newEntryPath, err)
return fuse.EIO
}
diff --git a/weed/mount/weedfs_quota.go b/weed/mount/weedfs_quota.go
index 23f487549..b8a902db2 100644
--- a/weed/mount/weedfs_quota.go
+++ b/weed/mount/weedfs_quota.go
@@ -3,7 +3,7 @@ package mount
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"time"
)
@@ -29,16 +29,16 @@ func (wfs *WFS) loopCheckQuota() {
resp, err := client.Statistics(context.Background(), request)
if err != nil {
- glog.V(0).Infof("reading quota usage %v: %v", request, err)
+ log.V(3).Infof("reading quota usage %v: %v", request, err)
return err
}
- glog.V(4).Infof("read quota usage: %+v", resp)
+ log.V(-1).Infof("read quota usage: %+v", resp)
isOverQuota := int64(resp.UsedSize) > wfs.option.Quota
if isOverQuota && !wfs.IsOverQuota {
- glog.Warningf("Quota Exceeded! quota:%d used:%d", wfs.option.Quota, resp.UsedSize)
+ log.Warningf("Quota Exceeded! quota:%d used:%d", wfs.option.Quota, resp.UsedSize)
} else if !isOverQuota && wfs.IsOverQuota {
- glog.Warningf("Within quota limit! quota:%d used:%d", wfs.option.Quota, resp.UsedSize)
+ log.Warningf("Within quota limit! quota:%d used:%d", wfs.option.Quota, resp.UsedSize)
}
wfs.IsOverQuota = isOverQuota
@@ -46,7 +46,7 @@ func (wfs *WFS) loopCheckQuota() {
})
if err != nil {
- glog.Warningf("read quota usage: %v", err)
+ log.Warningf("read quota usage: %v", err)
}
}
diff --git a/weed/mount/weedfs_rename.go b/weed/mount/weedfs_rename.go
index e567b12e1..b9d1999ac 100644
--- a/weed/mount/weedfs_rename.go
+++ b/weed/mount/weedfs_rename.go
@@ -10,7 +10,7 @@ import (
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
@@ -170,7 +170,7 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
return fuse.EPERM
}
- glog.V(4).Infof("dir Rename %s => %s", oldPath, newPath)
+ log.V(-1).Infof("dir Rename %s => %s", oldPath, newPath)
// update remote filer
err := wfs.WithFilerClient(true, func(client filer_pb.SeaweedFilerClient) error {
@@ -207,7 +207,7 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
}
if err = wfs.handleRenameResponse(ctx, resp); err != nil {
- glog.V(0).Infof("dir Rename %s => %s : %v", oldPath, newPath, err)
+ log.V(3).Infof("dir Rename %s => %s : %v", oldPath, newPath, err)
return err
}
@@ -217,7 +217,7 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
})
if err != nil {
- glog.V(0).Infof("Link: %v", err)
+ log.V(3).Infof("Link: %v", err)
return
}
@@ -228,7 +228,7 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
func (wfs *WFS) handleRenameResponse(ctx context.Context, resp *filer_pb.StreamRenameEntryResponse) error {
// comes from filer StreamRenameEntry, can only be create or delete entry
- glog.V(4).Infof("dir Rename %+v", resp.EventNotification)
+ log.V(-1).Infof("dir Rename %+v", resp.EventNotification)
if resp.EventNotification.NewEntry != nil {
// with new entry, the old entry name also exists. This is the first step to create new entry
diff --git a/weed/mount/weedfs_stats.go b/weed/mount/weedfs_stats.go
index 28e992158..1ba5eef0b 100644
--- a/weed/mount/weedfs_stats.go
+++ b/weed/mount/weedfs_stats.go
@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"github.com/hanwen/go-fuse/v2/fuse"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"math"
"time"
@@ -19,7 +19,7 @@ type statsCache struct {
func (wfs *WFS) StatFs(cancel <-chan struct{}, in *fuse.InHeader, out *fuse.StatfsOut) (code fuse.Status) {
- // glog.V(4).Infof("reading fs stats")
+ // log.V(-1).Infof("reading fs stats")
if wfs.stats.lastChecked < time.Now().Unix()-20 {
@@ -32,13 +32,13 @@ func (wfs *WFS) StatFs(cancel <-chan struct{}, in *fuse.InHeader, out *fuse.Stat
DiskType: string(wfs.option.DiskType),
}
- glog.V(4).Infof("reading filer stats: %+v", request)
+ log.V(-1).Infof("reading filer stats: %+v", request)
resp, err := client.Statistics(context.Background(), request)
if err != nil {
- glog.V(0).Infof("reading filer stats %v: %v", request, err)
+ log.V(3).Infof("reading filer stats %v: %v", request, err)
return err
}
- glog.V(4).Infof("read filer stats: %+v", resp)
+ log.V(-1).Infof("read filer stats: %+v", resp)
wfs.stats.TotalSize = resp.TotalSize
wfs.stats.UsedSize = resp.UsedSize
@@ -48,7 +48,7 @@ func (wfs *WFS) StatFs(cancel <-chan struct{}, in *fuse.InHeader, out *fuse.Stat
return nil
})
if err != nil {
- glog.V(0).Infof("filer Statistics: %v", err)
+ log.V(3).Infof("filer Statistics: %v", err)
return fuse.OK
}
}
diff --git a/weed/mount/weedfs_symlink.go b/weed/mount/weedfs_symlink.go
index 8842ec3e6..eaf2559a2 100644
--- a/weed/mount/weedfs_symlink.go
+++ b/weed/mount/weedfs_symlink.go
@@ -10,7 +10,7 @@ import (
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
@@ -62,7 +62,7 @@ func (wfs *WFS) Symlink(cancel <-chan struct{}, header *fuse.InHeader, target st
return nil
})
if err != nil {
- glog.V(0).Infof("Symlink %s => %s: %v", entryFullPath, target, err)
+ log.V(3).Infof("Symlink %s => %s: %v", entryFullPath, target, err)
return fuse.EIO
}
diff --git a/weed/mount/weedfs_write.go b/weed/mount/weedfs_write.go
index 77ad01b89..938947781 100644
--- a/weed/mount/weedfs_write.go
+++ b/weed/mount/weedfs_write.go
@@ -5,7 +5,7 @@ import (
"io"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
@@ -48,11 +48,11 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun
)
if err != nil {
- glog.V(0).Infof("upload data %v: %v", filename, err)
+ log.V(3).Infof("upload data %v: %v", filename, err)
return nil, fmt.Errorf("upload data: %v", err)
}
if uploadResult.Error != "" {
- glog.V(0).Infof("upload failure %v: %v", filename, err)
+ log.V(3).Infof("upload failure %v: %v", filename, err)
return nil, fmt.Errorf("upload result: %v", uploadResult.Error)
}
diff --git a/weed/mount/wfs_filer_client.go b/weed/mount/wfs_filer_client.go
index 5dd09363f..a6803a253 100644
--- a/weed/mount/wfs_filer_client.go
+++ b/weed/mount/wfs_filer_client.go
@@ -5,7 +5,7 @@ import (
"google.golang.org/grpc"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
@@ -28,7 +28,7 @@ func (wfs *WFS) WithFilerClient(streamingMode bool, fn func(filer_pb.SeaweedFile
}, filerGrpcAddress, false, wfs.option.GrpcDialOption)
if err != nil {
- glog.V(0).Infof("WithFilerClient %d %v: %v", x, filerGrpcAddress, err)
+ log.V(3).Infof("WithFilerClient %d %v: %v", x, filerGrpcAddress, err)
} else {
atomic.StoreInt32(&wfs.option.filerIndex, i)
return nil
diff --git a/weed/mount/wfs_save.go b/weed/mount/wfs_save.go
index 56ad47011..02cc24aa4 100644
--- a/weed/mount/wfs_save.go
+++ b/weed/mount/wfs_save.go
@@ -5,7 +5,7 @@ import (
"fmt"
"github.com/hanwen/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util/log"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
"syscall"
@@ -26,7 +26,7 @@ func (wfs *WFS) saveEntry(path util.FullPath, entry *filer_pb.Entry) (code fuse.
Signatures: []int32{wfs.signature},
}
- glog.V(1).Infof("save entry: %v", request)
+ log.V(2).Infof("save entry: %v", request)
_, err := client.UpdateEntry(context.Background(), request)
if err != nil {
return fmt.Errorf("UpdateEntry dir %s: %v", path, err)
@@ -39,7 +39,7 @@ func (wfs *WFS) saveEntry(path util.FullPath, entry *filer_pb.Entry) (code fuse.
return nil
})
if err != nil {
- glog.Errorf("saveEntry %s: %v", path, err)
+ log.Errorf("saveEntry %s: %v", path, err)
return fuse.EIO
}