Thermodynamic volume and the extended Smarr relation