mmu_notifier.c (4f2c0a4acffbec01079c28f839422e64ddeff004) mmu_notifier.c (7d4a8be0c4b2b7ffb367929d2b352651f083806b)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/mmu_notifier.c
4 *
5 * Copyright (C) 2008 Qumranet, Inc.
6 * Copyright (C) 2008 SGI
7 * Christoph Lameter <cl@linux.com>
8 */

--- 1106 unchanged lines hidden (view full) ---

1115 * Modules using the mmu_notifier_put() API should call this in their __exit
1116 * function to avoid module unloading races.
1117 */
1118void mmu_notifier_synchronize(void)
1119{
1120 synchronize_srcu(&srcu);
1121}
1122EXPORT_SYMBOL_GPL(mmu_notifier_synchronize);
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * linux/mm/mmu_notifier.c
4 *
5 * Copyright (C) 2008 Qumranet, Inc.
6 * Copyright (C) 2008 SGI
7 * Christoph Lameter <cl@linux.com>
8 */

--- 1106 unchanged lines hidden (view full) ---

1115 * Modules using the mmu_notifier_put() API should call this in their __exit
1116 * function to avoid module unloading races.
1117 */
1118void mmu_notifier_synchronize(void)
1119{
1120 synchronize_srcu(&srcu);
1121}
1122EXPORT_SYMBOL_GPL(mmu_notifier_synchronize);
1123
1124bool
1125mmu_notifier_range_update_to_read_only(const struct mmu_notifier_range *range)
1126{
1127 if (!range->vma || range->event != MMU_NOTIFY_PROTECTION_VMA)
1128 return false;
1129 /* Return true if the vma still have the read flag set. */
1130 return range->vma->vm_flags & VM_READ;
1131}
1132EXPORT_SYMBOL_GPL(mmu_notifier_range_update_to_read_only);