mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 00:47:24 +08:00
hardlink deletion factors in hardlink counter
This commit is contained in:
@@ -331,7 +331,8 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
||||
|
||||
// first, ensure the filer store can correctly delete
|
||||
glog.V(3).Infof("remove file: %v", req)
|
||||
err = filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, false, false, false, false, []int32{dir.wfs.signature})
|
||||
isDeleteData := entry.HardLinkCounter <= 1
|
||||
err = filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, isDeleteData, false, false, false, []int32{dir.wfs.signature})
|
||||
if err != nil {
|
||||
glog.V(3).Infof("not found remove file %s/%s: %v", dir.FullPath(), req.Name, err)
|
||||
return fuse.ENOENT
|
||||
@@ -342,7 +343,9 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
||||
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
|
||||
|
||||
// delete the chunks last
|
||||
dir.wfs.deleteFileChunks(entry.Chunks)
|
||||
if isDeleteData {
|
||||
dir.wfs.deleteFileChunks(entry.Chunks)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
|
Reference in New Issue
Block a user