code: func (d *Driver) ApplyDiff(id string, parent string, diff io.Reader) (size int64, err error) {
  	if !d.isParent(id, parent) {
  		return d.naiveDiff.ApplyDiff(id, parent, diff)
  	}
  
  	applyDir := d.getDiffPath(id)
  
  	logger.Debugf("Applying tar in %s", applyDir)
  	// Overlay doesn't need the parent id to apply the diff
  	if err := untar(diff, applyDir, &archive.TarOptions{
  		UIDMaps:        d.uidMaps,
  		GIDMaps:        d.gidMaps,
  		WhiteoutFormat: archive.OverlayWhiteoutFormat,
  		InUserNS:       rsystem.RunningInUserNS(),
  	}); err != nil {
  		return 0, err
  	}
  
  	return directory.Size(context.TODO(), applyDir)
  }
docs: // ApplyDiff applies the new layer into a root