code: func (lbs *linkedBlobStore) linkBlob(ctx context.Context, canonical distribution.Descriptor, aliases ...digest.Digest) error {
  	dgsts := append([]digest.Digest{canonical.Digest}, aliases...)
  
  	// TODO(stevvooe): Need to write out mediatype for only canonical hash
  	// since we don't care about the aliases. They are generally unused except
  	// for tarsum but those versions don't care about mediatype.
  
  	// Don't make duplicate links.
  	seenDigests := make(map[digest.Digest]struct{}, len(dgsts))
  
  	// only use the first link
  	linkPathFn := lbs.linkPathFns[0]
  
  	for _, dgst := range dgsts {
  		if _, seen := seenDigests[dgst]; seen {
  			continue
  		}
  		seenDigests[dgst] = struct{}{}
  
  		blobLinkPath, err := linkPathFn(lbs.repository.Named().Name(), dgst)
  		if err != nil {
  			return err
  		}
  
  		if err := lbs.blobStore.link(ctx, blobLinkPath, canonical.Digest); err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // linkBlob links a valid, written blob into the registry under the named
  // repository for the upload controller.