  The superfluid fraction $f$ of a quantum fluid is defined in terms of the
response of the system to a weak and constant drag. Notably, Leggett long ago
derived two simple expressions providing a rigorous upper bound and a heuristic
lower bound for $f$. Here we study the superfluid fraction of bosonic gases in
various two-dimensional potentials, such as regular optical lattices and
disordered speckles, by solving the Gross-Pitaevskii equation and performing
Diffusion Monte Carlo simulations. We show that under conditions relevant for
most ultracold experiments the bounds proposed by Leggett provide a
surprisingly narrow bracketing of the exact value of the superfluid fraction.
