[PATCH 03/25] powerpc: track allocation status of all pkeys
Aneesh Kumar K.V
aneesh.kumar at linux.vnet.ibm.com
Tue Oct 24 17:28:29 AEDT 2017
Ram Pai <linuxram at us.ibm.com> writes:
+
> +#define mm_set_pkey_is_allocated(mm, pkey) \
> + (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey))
> +
> static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey)
> {
> - return (pkey == 0);
> + /* a reserved key is never considered as 'explicitly allocated' */
> + return ((pkey < arch_max_pkey()) &&
> + !mm_set_pkey_is_reserved(mm, pkey) &&
> + mm_set_pkey_is_allocated(mm, pkey));
> }
>
that is confusing naming. what is mm_set_pkey_is_allocated()? . 'set' in
that name is confusing.
-aneesh
More information about the Linuxppc-dev
mailing list