[PATCH v3 2/7] uaccess: Tell user_access_begin() if it's for a write or not
Jani Nikula
jani.nikula at linux.intel.com
Thu Jan 23 13:11:05 UTC 2020
On Thu, 23 Jan 2020, Christophe Leroy <christophe.leroy at c-s.fr> wrote:
> On 32 bits powerPC (book3s/32), only write accesses to user are
> protected and there is no point spending time on unlocking for reads.
>
> On 64 bits powerpc (book3s/64 at least), access can be granted
> read only, write only or read/write.
>
> Add an argument to user_access_begin() to tell when it's for write and
> return an opaque key that will be used by user_access_end() to know
> what was done by user_access_begin().
IMHO an opaque key is a prime example of a case where the use of an
opaque typedef is warranted. Nobody needs to know or care it's
specifically an unsigned long.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
More information about the dri-devel
mailing list