code: func (s *blockStore) syncBlocks() error {
  	wc := s.writeCursor
  	wc.RLock()
  	defer wc.RUnlock()
  
  	// Nothing to do if there is no current file associated with the write
  	// cursor.
  	wc.curFile.RLock()
  	defer wc.curFile.RUnlock()
  	if wc.curFile.file == nil {
  		return nil
  	}
  
  	// Sync the file to disk.
  	if err := wc.curFile.file.Sync(); err != nil {
  		str := fmt.Sprintf("failed to sync file %d: %v", wc.curFileNum,
  			err)
  		return makeDbErr(database.ErrDriverSpecific, str, err)
  	}
  
  	return nil
  }
docs: // syncBlocks performs a file system sync on the flat file associated with the
  // store's current write cursor.  It is safe to call even when there is not a
  // current write file in which case it will have no effect.
  //
  // This is used when flushing cached metadata updates to disk to ensure all the
  // block data is fully written before updating the metadata.  This ensures the
  // metadata and block data can be properly reconciled in failure scenarios.