Volume functions of linear series