On 18.07.22 13:47, Nadav Amit wrote: > From: Nadav Amit <namit@xxxxxxxxxx> > > As the next patches are going to introduce more information that needs > to be propagated regarding handled user requests, introduce uffd_flags > that would be used to propagate this information. > > Remove the unused UFFD_FLAGS_SET to avoid confusion in the constant > names. > > Introducing uffd flags also allows to avoid mm/userfaultfd from being > using uapi (e.g., UFFDIO_COPY_MODE_WP). > > Cc: Mike Kravetz <mike.kravetz@xxxxxxxxxx> > Cc: Hugh Dickins <hughd@xxxxxxxxxx> > Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> > Cc: Axel Rasmussen <axelrasmussen@xxxxxxxxxx> > Cc: Peter Xu <peterx@xxxxxxxxxx> > Cc: Mike Rapoport <rppt@xxxxxxxxxxxxx> > Acked-by: David Hildenbrand <david@xxxxxxxxxx> > Signed-off-by: Nadav Amit <namit@xxxxxxxxxx> [...] > > int mwriteprotect_range(struct mm_struct *dst_mm, unsigned long start, > - unsigned long len, bool enable_wp, > - atomic_t *mmap_changing) > + unsigned long len, > + atomic_t *mmap_changing, uffd_flags_t uffd_flags) > { > + bool enable_wp = uffd_flags & UFFD_FLAGS_WP; Could be that this will trigger a sparse warnings, but I haven't fully understood yet when/how sparse will start to complain. If so, this would have to be bool enable_wp = !!(uffd_flags & UFFD_FLAGS_WP); I stumbled into something like that in https://lore.kernel.org/lkml/202202252038.ij1YGn0d-lkp@xxxxxxxxx/T/ Reviewed-by: David Hildenbrand <david@xxxxxxxxxx> -- Thanks, David / dhildenb