hardlink works now
This commit is contained in:
@@ -67,6 +67,9 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) error {
|
||||
attr.Uid = file.entry.Attributes.Uid
|
||||
attr.Blocks = attr.Size/blockSize + 1
|
||||
attr.BlockSize = uint32(file.wfs.option.ChunkSizeLimit)
|
||||
if file.entry.HardLinkCounter > 0 {
|
||||
attr.Nlink = uint32(file.entry.HardLinkCounter)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
@@ -250,7 +253,7 @@ func (file *File) Forget() {
|
||||
}
|
||||
|
||||
func (file *File) maybeLoadEntry(ctx context.Context) error {
|
||||
if file.entry == nil && file.isOpen <= 0 {
|
||||
if (file.entry == nil || file.entry.HardLinkId != 0) && file.isOpen <= 0 {
|
||||
entry, err := file.wfs.maybeLoadEntry(file.dir.FullPath(), file.Name)
|
||||
if err != nil {
|
||||
glog.V(3).Infof("maybeLoadEntry file %s/%s: %v", file.dir.FullPath(), file.Name, err)
|
||||
|
||||
Reference in New Issue
Block a user