  We generalise the equations governing relativistic fluid dynamics given by
Ehlers and Ellis for general relativity, and by Maartens and Taylor for
quadratic theories, to generalised $f(R)$ theories of gravity. In view of the
usefulness of this alternative framework to general relativity, its
generalisation can be of potential importance for deriving analogous results to
those obtained in general relativity. We generalise, as an example, the results
of Maartens and Taylor to show that within the framework of general $f(R)$
theories, a perfect fluid spacetime with vanishing vorticity, shear and
acceleration is Friedmann--Lema\^{\i}tre--Robertson--Walker only if the fluid
has in addition a barotropic equation of state. It then follows that the
Ehlers--Geren--Sachs theorem and its ``almost'' extension also hold for $f(R)$
theories of gravity.
