aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-05-06 03:31:40 -0700
committerChris Lu <chris.lu@gmail.com>2021-05-06 03:31:40 -0700
commit38f411219a759709b53101d3ecd3ed05c36a6efa (patch)
tree3689968bdd7ad1a24fa0405c3423c4cf84e69a9d /weed/filesys/filehandle.go
parentc899bdf0636488dc55c6788cc41ce2329f58a39f (diff)
downloadseaweedfs-38f411219a759709b53101d3ecd3ed05c36a6efa.tar.xz
seaweedfs-38f411219a759709b53101d3ecd3ed05c36a6efa.zip
mount: skip local chunk cache if opened write only
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 27ffab6e1..8cbaf6fd2 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -32,7 +32,7 @@ type FileHandle struct {
NodeId fuse.NodeID // file or directory the request is about
Uid uint32 // user ID of process making request
Gid uint32 // group ID of process making request
-
+ writeOnly bool
}
func newFileHandle(file *File, uid, gid uint32) *FileHandle {
@@ -42,6 +42,7 @@ func newFileHandle(file *File, uid, gid uint32) *FileHandle {
Uid: uid,
Gid: gid,
}
+ fh.dirtyPages.fh = fh
entry := fh.f.getEntry()
if entry != nil {
entry.Attributes.FileSize = filer.FileSize(entry)
@@ -289,7 +290,7 @@ func (fh *FileHandle) doFlush(ctx context.Context, header fuse.Header) error {
manifestChunks, nonManifestChunks := filer.SeparateManifestChunks(entry.Chunks)
chunks, _ := filer.CompactFileChunks(fh.f.wfs.LookupFn(), nonManifestChunks)
- chunks, manifestErr := filer.MaybeManifestize(fh.f.wfs.saveDataAsChunk(fh.f.fullpath()), chunks)
+ chunks, manifestErr := filer.MaybeManifestize(fh.f.wfs.saveDataAsChunk(fh.f.fullpath(), fh.writeOnly), chunks)
if manifestErr != nil {
// not good, but should be ok
glog.V(0).Infof("MaybeManifestize: %v", manifestErr)