code: func (bw *blobWriter) Commit(ctx context.Context, desc distribution.Descriptor) (distribution.Descriptor, error) {
  	dcontext.GetLogger(ctx).Debug("(*blobWriter).Commit")
  
  	if err := bw.fileWriter.Commit(); err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	bw.Close()
  	desc.Size = bw.Size()
  
  	canonical, err := bw.validateBlob(ctx, desc)
  	if err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	if err := bw.moveBlob(ctx, canonical); err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	if err := bw.blobStore.linkBlob(ctx, canonical, desc.Digest); err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	if err := bw.removeResources(ctx); err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	err = bw.blobStore.blobAccessController.SetDescriptor(ctx, canonical.Digest, canonical)
  	if err != nil {
  		return distribution.Descriptor{}, err
  	}
  
  	bw.committed = true
  	return canonical, nil
  }
docs: // Commit marks the upload as completed, returning a valid descriptor. The
  // final size and digest are checked against the first descriptor provided.