Particle balance and wall pumping in tokamaks