code: func (s *fs) SetMetadata(dgst digest.Digest, key string, data []byte) error {
  	s.Lock()
  	defer s.Unlock()
  	if _, err := s.get(dgst); err != nil {
  		return err
  	}
  
  	baseDir := filepath.Join(s.metadataDir(dgst))
  	if err := os.MkdirAll(baseDir, 0700); err != nil {
  		return err
  	}
  	return ioutils.AtomicWriteFile(filepath.Join(s.metadataDir(dgst), key), data, 0600)
  }
docs: // SetMetadata sets metadata for a given ID. It fails if there's no base file.