code: func (gdw *NaiveDiffDriver) Diff(id, parent string) (arch io.ReadCloser, err error) {
  	startTime := time.Now()
  	driver := gdw.ProtoDriver
  
  	layerRootFs, err := driver.Get(id, "")
  	if err != nil {
  		return nil, err
  	}
  	layerFs := layerRootFs.Path()
  
  	defer func() {
  		if err != nil {
  			driver.Put(id)
  		}
  	}()
  
  	if parent == "" {
  		archive, err := archive.Tar(layerFs, archive.Uncompressed)
  		if err != nil {
  			return nil, err
  		}
  		return ioutils.NewReadCloserWrapper(archive, func() error {
  			err := archive.Close()
  			driver.Put(id)
  			return err
  		}), nil
  	}
  
  	parentRootFs, err := driver.Get(parent, "")
  	if err != nil {
  		return nil, err
  	}
  	defer driver.Put(parent)
  
  	parentFs := parentRootFs.Path()
  
  	changes, err := archive.ChangesDirs(layerFs, parentFs)
  	if err != nil {
  		return nil, err
  	}
  
  	archive, err := archive.ExportChanges(layerFs, changes, gdw.uidMaps, gdw.gidMaps)
  	if err != nil {
  		return nil, err
  	}
  
  	return ioutils.NewReadCloserWrapper(archive, func() error {
  		err := archive.Close()
  		driver.Put(id)
  
  		// NaiveDiffDriver compares file metadata with parent layers. Parent layers
  		// are extracted from tar's with full second precision on modified time.
  		// We need this hack here to make sure calls within same second receive
  		// correct result.
  		time.Sleep(time.Until(startTime.Truncate(time.Second).Add(time.Second)))
  		return err
  	}), nil
  }
docs: // Diff produces an archive of the changes between the specified
  // layer and its parent layer which may be "".