code: protected BlockInfo listMoveToHead(BlockInfo block, BlockInfo head,
        DatanodeIndex indexes) {
      assert head != null : "Head can not be null";
      if (head == block) {
        return head;
      }
      BlockInfo next = block.getSetNext(indexes.currentIndex, head);
      BlockInfo prev = block.getSetPrevious(indexes.currentIndex, null);
  
      head.setPrevious(indexes.headIndex, block);
      indexes.headIndex = indexes.currentIndex;
      prev.setNext(prev.findDatanode(this), next);
      if (next != null)
        next.setPrevious(next.findDatanode(this), prev);
      return block;
    }
docs: Remove block from the list and insert
  into the head of the list of blocks
  related to the specified DatanodeDescriptor.
  If the head is null then form a new list.
  @return current block as the new head of the list.