A generalized Reynolds equation for fluid-film lubrication