diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2021-02-18 13:57:34 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-18 13:57:34 +0800 |
| commit | c8f56f5712c1efffc46de95a8057ed09c21da2db (patch) | |
| tree | bc3330e274901d782395b7396cb54d7cc42608b1 /weed/filesys | |
| parent | 12a78335860c4b1e220748e4adc4097050af5272 (diff) | |
| parent | 3575d41009e4367658e75e6ae780c6260b80daf9 (diff) | |
| download | seaweedfs-c8f56f5712c1efffc46de95a8057ed09c21da2db.tar.xz seaweedfs-c8f56f5712c1efffc46de95a8057ed09c21da2db.zip | |
Merge pull request #2 from chrislusf/master
Diffstat (limited to 'weed/filesys')
| -rw-r--r-- | weed/filesys/filehandle.go | 9 | ||||
| -rw-r--r-- | weed/filesys/wfs.go | 3 | ||||
| -rw-r--r-- | weed/filesys/wfs_write.go | 1 |
3 files changed, 7 insertions, 6 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 85f64d292..fb073c9cd 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -192,16 +192,13 @@ func (fh *FileHandle) Release(ctx context.Context, req *fuse.ReleaseRequest) err if fh.f.isOpen == 1 { - if err := fh.doFlush(ctx, req.Header); err != nil { - glog.Errorf("Release doFlush %s: %v", fh.f.Name, err) - return err - } - fh.f.isOpen-- fh.f.wfs.ReleaseHandle(fh.f.fullpath(), fuse.HandleID(fh.handle)) if closer, ok := fh.f.reader.(io.Closer); ok { - closer.Close() + if closer != nil { + closer.Close() + } } fh.f.reader = nil } diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go index f4e5ac38a..c6d9080a1 100644 --- a/weed/filesys/wfs.go +++ b/weed/filesys/wfs.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "github.com/chrislusf/seaweedfs/weed/filer" + "github.com/chrislusf/seaweedfs/weed/storage/types" "github.com/chrislusf/seaweedfs/weed/wdclient" "math" "os" @@ -34,6 +35,7 @@ type Option struct { Collection string Replication string TtlSec int32 + DiskType types.DiskType ChunkSizeLimit int64 ConcurrentWriters int CacheDir string @@ -194,6 +196,7 @@ func (wfs *WFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse. Collection: wfs.option.Collection, Replication: wfs.option.Replication, Ttl: fmt.Sprintf("%ds", wfs.option.TtlSec), + DiskType: string(wfs.option.DiskType), } glog.V(4).Infof("reading filer stats: %+v", request) diff --git a/weed/filesys/wfs_write.go b/weed/filesys/wfs_write.go index 4e1e71672..dbec3bebc 100644 --- a/weed/filesys/wfs_write.go +++ b/weed/filesys/wfs_write.go @@ -26,6 +26,7 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun Replication: wfs.option.Replication, Collection: wfs.option.Collection, TtlSec: wfs.option.TtlSec, + DiskType: string(wfs.option.DiskType), DataCenter: wfs.option.DataCenter, Path: string(fullPath), } |
