We generalise the equations governing relativistic fluid dynamics give
n by Ehlers and Ellis for general relativity, and by Maartens and Tayl
or for quadratic theories, to generalised f(R) theories of gravity. In
view of the usefulness of this alternative framework to general relat
ivity, its generalisation can be of potential importance for deriving
analogous results to those obtained in general relativity. We generali
se, as an example, the results of Maartens and Taylor to show that wit
hin the framework of general f(R) theories, a perfect fluid spacetime
with vanishing vorticity, shear and acceleration is Friedmann-Lemaitre
-Robertson-Walker only if the fluid has in addition a barotropic equat
ion of state. It then follows that the Ehlers-Geren-Sachs theorem and
its ''almost'' extension also hold for f(R) theories of gravity.