Increment link count in CreateHardlink

Closes #28

PiperOrigin-RevId: 196041391
Change-Id: I5d79f1735b9d72744e8bebc6897002b27df9aa7a
This commit is contained in:
Fabricio Voznika
2018-05-09 15:44:26 -07:00
committed by Shentubot
parent 1bdec86bae
commit 4453b56bd9
+4 -2
View File
@@ -150,8 +150,10 @@ func (i *inodeOperations) CreateHardLink(ctx context.Context, _ *fs.Inode, targe
if err := i.fileState.file.link(ctx, &targetOpts.fileState.file, newName); err != nil {
return err
}
// TODO: Don't increase link count because we can't properly accounts for links
// with gofers.
if i.session().cachePolicy == cacheAll {
// Increase link count.
targetOpts.cachingInodeOps.IncLinks(ctx)
}
i.touchModificationTime(ctx)
return nil
}