diff --git a/dxfuse.go b/dxfuse.go index 58e0583..29172f3 100644 --- a/dxfuse.go +++ b/dxfuse.go @@ -1260,15 +1260,14 @@ func (fsys *Filesys) openRegularFile( if f.dirtyData { fh := &FileHandle{ - accessMode: AM_AO_Remote, - inode: f.Inode, - size: f.Size, - Id: f.Id, - url: nil, - Tgid: tgid, - lastPartId: 0, - nextWriteOffset: 0, - // 16MB slice capacity + accessMode: AM_AO_Remote, + inode: f.Inode, + size: f.Size, + Id: f.Id, + url: nil, + Tgid: tgid, + lastPartId: 0, + nextWriteOffset: 0, writeBuffer: nil, writeBufferOffset: 0, mutex: &sync.Mutex{}, @@ -1609,8 +1608,10 @@ func (fsys *Filesys) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) err return nil } if fh.accessMode != AM_AO_Remote { - // This isn't a writeable file, there is no dirty data to flush - fsys.log("Ignoring flush of inode %d, file is not writeable", op.Inode) + // This isn't a writeable file + if fsys.ops.options.VerboseLevel > 1 { + fsys.log("Ignoring flush of inode %d, file is not writeable", op.Inode) + } return nil } @@ -1633,7 +1634,9 @@ func (fsys *Filesys) FlushFile(ctx context.Context, op *fuseops.FlushFileOp) err // Empty files are handled by ReleaseFileHandle if len(fh.writeBuffer) == 0 && fh.size == 0 { - fsys.log("Ignoring FlushFile: file is empty") + if fsys.ops.options.VerboseLevel > 1 { + fsys.log("Ignoring FlushFile: file is empty") + } return nil } diff --git a/prefetch.go b/prefetch.go index d6b0c59..bcd8774 100644 --- a/prefetch.go +++ b/prefetch.go @@ -260,9 +260,9 @@ func NewPrefetchGlobalState(verboseLevel int, dxEnv dxda.DXEnvironment) *Prefetc totalMemoryBytes := 2 * maxNumEntriesInTable * prefetchMaxIoSize totalMemoryBytes += int64(maxNumChunksReadAhead) * prefetchMaxIoSize - log.Printf("maximal memory usage: %dMiB", totalMemoryBytes/MiB) - log.Printf("number of prefetch worker threads: %d", numPrefetchThreads) - log.Printf("maximal number of read-ahead chunks: %d", maxNumChunksReadAhead) + log.Printf("Maximum prefetch memory usage: %dMiB", totalMemoryBytes/MiB) + log.Printf("Number of prefetch worker threads: %d", numPrefetchThreads) + log.Printf("Maximum number of read-ahead chunks: %d", maxNumChunksReadAhead) pgs := &PrefetchGlobalState{ verbose: verboseLevel >= 1, diff --git a/upload.go b/upload.go index f64f2cb..2389953 100644 --- a/upload.go +++ b/upload.go @@ -41,7 +41,7 @@ type FileUploader struct { uploadQueue chan UploadRequest wg sync.WaitGroup numUploadRoutines int - // Max write buffers being written to reduce memory consumption + // Max concurrent write buffers to reduce memory consumption writeBufferChan chan struct{} // API to dx ops *DxOps @@ -58,9 +58,8 @@ func NewFileUploader(verboseLevel int, options Options, dxEnv dxda.DXEnvironment concurrentWriteBufferLimit = runtime.NumCPU() * 3 } uploader := &FileUploader{ - verbose: verboseLevel >= 1, - uploadQueue: make(chan UploadRequest), - // Limit of 15 concurrent file handle write buffers + verbose: verboseLevel >= 1, + uploadQueue: make(chan UploadRequest), writeBufferChan: make(chan struct{}, concurrentWriteBufferLimit), numUploadRoutines: maxUploadRoutines, ops: NewDxOps(dxEnv, options), diff --git a/util.go b/util.go index 370c7f6..a87a29f 100644 --- a/util.go +++ b/util.go @@ -30,7 +30,7 @@ const ( NumRetriesDefault = 10 InitialPartSize = 16 * MiB MaxPartSize = 700 * MiB - Version = "v1.0.0-rc.2" + Version = "v1.0.0-rc.3" ) const ( InodeInvalid = 0