On 10.07.2013, at 12:40, Alexander Graf wrote:
=20
On 10.07.2013, at 12:39, Benjamin Herrenschmidt wrote:
=20
quoted
On Wed, 2013-07-10 at 12:33 +0200, Alexander Graf wrote:
quoted
=20
It's not exactly obvious that you're calling it with writing =3D=3D =
1 :).
quoted
quoted
Can you create a new local variable "is_write" in the calling
function, set that to 1 before the call to get_user_pages_fast and
pass it in instead of the 1? The compiler should easily optimize all
of that away, but it makes the code by far easier to read.
=20
Ugh ?
=20
Nobody else does that .... (look at futex :-)
=20
Yeah, that's fortunately code that I don't have to read :).
The "proper" alternative would be to pass an enum for read/write into =
the function rather than an int. But that'd be a pretty controversial, =
big change that I'd rather not put on Alexey. With a local variable =
we're nicely self-contained readable ;)
Alex