Barcelona have reached an agreement with Sporting Gijon for the permanent transfer of defender Alberto Botia.