code: func writeLayer(layerData io.Reader, home string, id string, parentLayerPaths ...string) (size int64, retErr error) {
  	err := winio.EnableProcessPrivileges([]string{winio.SeBackupPrivilege, winio.SeRestorePrivilege})
  	if err != nil {
  		return 0, err
  	}
  	if noreexec {
  		defer func() {
  			if err := winio.DisableProcessPrivileges([]string{winio.SeBackupPrivilege, winio.SeRestorePrivilege}); err != nil {
  				// This should never happen, but just in case when in debugging mode.
  				// See https://github.com/docker/docker/pull/28002#discussion_r86259241 for rationale.
  				panic("Failed to disabled process privileges while in non re-exec mode")
  			}
  		}()
  	}
  
  	info := hcsshim.DriverInfo{
  		Flavour: filterDriver,
  		HomeDir: home,
  	}
  
  	w, err := hcsshim.NewLayerWriter(info, id, parentLayerPaths)
  	if err != nil {
  		return 0, err
  	}
  
  	defer func() {
  		if err := w.Close(); err != nil {
  			// This error should not be discarded as a failure here
  			// could result in an invalid layer on disk
  			if retErr == nil {
  				retErr = err
  			}
  		}
  	}()
  
  	return writeLayerFromTar(layerData, w, filepath.Join(home, id))
  }
docs: // writeLayer writes a layer from a tar file.