@@ -275,25 +275,6 @@ static const struct mmu_notifier_ops gru_mmuops = {
.release = gru_release,
};
-/* Move this to the basic mmu_notifier file. But for now... */
-static struct mmu_notifier *mmu_find_ops(struct mm_struct *mm,
- const struct mmu_notifier_ops *ops)
-{
- struct mmu_notifier *mn, *gru_mn = NULL;
-
- if (mm->mmu_notifier_mm) {
- rcu_read_lock();
- hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list,
- hlist)
- if (mn->ops == ops) {
- gru_mn = mn;
- break;
- }
- rcu_read_unlock();
- }
- return gru_mn;
-}
-
struct gru_mm_struct *gru_register_mmu_notifier(void)
{
struct gru_mm_struct *gms;
@@ -215,6 +215,8 @@ extern void __mmu_notifier_invalidate_range_end(struct mm_struct *mm,
unsigned long start, unsigned long end);
extern void __mmu_notifier_invalidate_range(struct mm_struct *mm,
unsigned long start, unsigned long end);
+extern struct mmu_notifier *mmu_find_ops(struct mm_struct *mm,
+ const struct mmu_notifier_ops *ops);
static inline void mmu_notifier_release(struct mm_struct *mm)
{
@@ -425,6 +427,12 @@ static inline void mmu_notifier_mm_destroy(struct mm_struct *mm)
{
}
+static inline struct mmu_notifier *mmu_find_ops(struct mm_struct *mm,
+ struct mmu_notifier_ops *ops)
+{
+ return NULL;
+}
+
#define ptep_clear_flush_young_notify ptep_clear_flush_young
#define pmdp_clear_flush_young_notify pmdp_clear_flush_young
#define ptep_clear_flush_notify ptep_clear_flush
@@ -389,6 +389,25 @@ void mmu_notifier_unregister_no_release(struct mmu_notifier *mn,
}
EXPORT_SYMBOL_GPL(mmu_notifier_unregister_no_release);
+struct mmu_notifier *mmu_find_ops(struct mm_struct *mm,
+ const struct mmu_notifier_ops *ops)
+{
+ struct mmu_notifier *mn, *tmp_mn = NULL;
+
+ if (mm->mmu_notifier_mm) {
+ rcu_read_lock();
+ hlist_for_each_entry_rcu(mn, &mm->mmu_notifier_mm->list,
+ hlist)
+ if (mn->ops == ops) {
+ tmp_mn = mn;
+ break;
+ }
+ rcu_read_unlock();
+ }
+ return tmp_mn;
+}
+EXPORT_SYMBOL_GPL(mmu_find_ops);
+
static int __init mmu_notifier_init(void)
{
return init_srcu_struct(&srcu);
For use by other modules. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> --- drivers/misc/sgi-gru/grutlbpurge.c | 19 ------------------- include/linux/mmu_notifier.h | 8 ++++++++ mm/mmu_notifier.c | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 19 deletions(-)