#ifndef _LINUX_MMAP_LOCK_H
#define _LINUX_MMAP_LOCK_H
#include <linux/lockdep.h>
#include <linux/mm_types.h>
#include <linux/mmdebug.h>
#include <linux/rwsem.h>
#include <linux/tracepoint-defs.h>
#include <linux/types.h>
#define MMAP_LOCK_INITIALIZER(name) …
DECLARE_TRACEPOINT(…);
DECLARE_TRACEPOINT(…);
DECLARE_TRACEPOINT(…);
#ifdef CONFIG_TRACING
void __mmap_lock_do_trace_start_locking(struct mm_struct *mm, bool write);
void __mmap_lock_do_trace_acquire_returned(struct mm_struct *mm, bool write,
bool success);
void __mmap_lock_do_trace_released(struct mm_struct *mm, bool write);
static inline void __mmap_lock_trace_start_locking(struct mm_struct *mm,
bool write)
{ … }
static inline void __mmap_lock_trace_acquire_returned(struct mm_struct *mm,
bool write, bool success)
{ … }
static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write)
{ … }
#else
static inline void __mmap_lock_trace_start_locking(struct mm_struct *mm,
bool write)
{
}
static inline void __mmap_lock_trace_acquire_returned(struct mm_struct *mm,
bool write, bool success)
{
}
static inline void __mmap_lock_trace_released(struct mm_struct *mm, bool write)
{
}
#endif
static inline void mmap_assert_locked(const struct mm_struct *mm)
{ … }
static inline void mmap_assert_write_locked(const struct mm_struct *mm)
{ … }
#ifdef CONFIG_PER_VMA_LOCK
static inline void vma_end_write_all(struct mm_struct *mm)
{ … }
#else
static inline void vma_end_write_all(struct mm_struct *mm) {}
#endif
static inline void mmap_init_lock(struct mm_struct *mm)
{ … }
static inline void mmap_write_lock(struct mm_struct *mm)
{ … }
static inline void mmap_write_lock_nested(struct mm_struct *mm, int subclass)
{ … }
static inline int mmap_write_lock_killable(struct mm_struct *mm)
{ … }
static inline void mmap_write_unlock(struct mm_struct *mm)
{ … }
static inline void mmap_write_downgrade(struct mm_struct *mm)
{ … }
static inline void mmap_read_lock(struct mm_struct *mm)
{ … }
static inline int mmap_read_lock_killable(struct mm_struct *mm)
{ … }
static inline bool mmap_read_trylock(struct mm_struct *mm)
{ … }
static inline void mmap_read_unlock(struct mm_struct *mm)
{ … }
static inline void mmap_read_unlock_non_owner(struct mm_struct *mm)
{ … }
static inline int mmap_lock_is_contended(struct mm_struct *mm)
{ … }
#endif