code: public boolean detachBlock(int namespaceId, Block block, int numLinks) throws IOException {
      DatanodeBlockInfo info = null;
  
      lock.readLock().lock();
      try {
        info = volumeMap.get(namespaceId, block);
      } finally {
        lock.readLock().unlock();
      }
      
      return info.detachBlock(namespaceId, block, numLinks);
    }
docs: Make a copy of the block if this block is linked to an existing
  snapshot. This ensures that modifying this block does not modify
  data in any existing snapshots.
  @param block Block
  @param numLinks Detach if the number of links exceed this value
  @throws IOException
  @return - true if the specified block was detached