Using the exact same code path that has been used by glTexImage and glTexSubImage since time immemorial.
Um, you are aware that ignoring the problem of swizzling/etc makes mapping, in virtually all cases (since virtually all textures are swizzled), no better than just using a Pixel Buffer Object with the implementation-preferred pixel transfer parameters (which, thanks to internalformat_query2, we can now ask for).
You’re basically saying that you want a feature that might give you performance, but you can’t rely on it in any real-world circumstances. Plus, without the ability to explicitly ask for unswizzled/etc textures, you can’t do anything to improve your chances of actually mapping the texture (rather than just a lame PBO).
Yes, there are times when mapping a buffer object means that you don’t actually get GPU memory. But you can do things to improve your chances, like double-buffering or using [var]GL_INVALIDATE_RANGE_BIT[/var] or [var]GL_UNSYNCHRONIZED_BIT[/var] or whatever. None of these make guarantees, but they do help; not using these techniques leads to degraded performance.
What you’re suggesting would, in virtually all reasonable scenarios, never give you an actual mapped pointer. And there is nothing you can do to affect that in any way whatsoever.
In short, if “mapping a texture” can’t give you a reasonable shot at getting a pointer to honest-to-God GPU memory, what’s the point? How is it any better than using a PBO?
It should be noted that the only actual OpenGL extension to provide this functionality does in fact have a parameter for asking for linear textures, which enforces a specific order. And it even forbids mapping at all if you don’t use it.
Or to put it another way, actual IHVs, people’s who job it is to make hardware go fast (theoretically at least; they are Intel;) ), who considered the problem decided that the swizzle issue was important to making mapping useful.