private BlockInfo removeBlockFromMap(Block b) {
    if (b == null) {
      return null;
    }
     ns.decrementSafeBlockCountForBlockRemoval(b);
    return blocks.remove(b);
  }
private BlockInfo removeBlockFromMap ( Block b ) { if ( b == null ) { return null ; } ns . decrementSafeBlockCountForBlockRemoval ( b ) ; return blocks . remove ( b ) ; }
All removals from the blocks map goes through this function.

@param b
block to be removed
@param decrementSafeBlockCount
whether need to decrement safe block count when needed
@return the {@link BlockInfo} for the removed block