FROMLIST: mmap locking API: mmap_lock_is_contended returns a bool

Change mmap_lock_is_contended to return a bool value, rather than an
int which the callers are then supposed to interpret as a bool. This
is to ensure consistency with other mmap lock API functions (such as
the trylock functions).

Signed-off-by: Michel Lespinasse <michel@lespinasse.org>
Link: https://lore.kernel.org/all/20220128131006.67712-3-michel@lespinasse.org/
Bug: 161210518
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I7a11ff25a493adc58480b1fe8e3f14e44ad46fb3
This commit is contained in:
Michel Lespinasse
2022-01-24 17:43:53 -08:00
committed by Todd Kjos
parent 80169a2fe4
commit 2c3bf019fb

View File

@@ -162,9 +162,9 @@ static inline void mmap_assert_write_locked(struct mm_struct *mm)
VM_BUG_ON_MM(!rwsem_is_locked(&mm->mmap_lock), mm);
}
static inline int mmap_lock_is_contended(struct mm_struct *mm)
static inline bool mmap_lock_is_contended(struct mm_struct *mm)
{
return rwsem_is_contended(&mm->mmap_lock);
return rwsem_is_contended(&mm->mmap_lock) != 0;
}
#endif /* _LINUX_MMAP_LOCK_H */