The lock ordering bug is a good reason not to use do_truncate()
in either. Once Nick's fixup is in mainline, try the unification
based on that, including his #ifndef CONFIG_MMU which is good for
documentation.
But I don't know how ugly all the #ifdef'ing will end up: at the
time you created mm/tiny-shmem.c, we had a stronger embargo on
#ifdefs in *.c than is fashionable today.
If we're hell-bent on #ifdefs throughout mm/shmem.c, I wouldn't
mind scattering some CONFIG_SWAPs in there too, would cut out
lots of overhead when swap unconfigured. But again, how ugly?
Hugh
--