hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/infiniband/hw/hfi1/mmu_rb.h
....@@ -1,4 +1,5 @@
11 /*
2
+ * Copyright(c) 2020 Cornelis Networks, Inc.
23 * Copyright(c) 2016 Intel Corporation.
34 *
45 * This file is provided under a dual BSD/GPLv2 license. When using or
....@@ -54,6 +55,7 @@
5455 unsigned long len;
5556 unsigned long __last;
5657 struct rb_node node;
58
+ struct mmu_rb_handler *handler;
5759 struct list_head list;
5860 };
5961
....@@ -71,7 +73,19 @@
7173 void *evict_arg, bool *stop);
7274 };
7375
74
-int hfi1_mmu_rb_register(void *ops_arg, struct mm_struct *mm,
76
+struct mmu_rb_handler {
77
+ struct mmu_notifier mn;
78
+ struct rb_root_cached root;
79
+ void *ops_arg;
80
+ spinlock_t lock; /* protect the RB tree */
81
+ struct mmu_rb_ops *ops;
82
+ struct list_head lru_list;
83
+ struct work_struct del_work;
84
+ struct list_head del_list;
85
+ struct workqueue_struct *wq;
86
+};
87
+
88
+int hfi1_mmu_rb_register(void *ops_arg,
7589 struct mmu_rb_ops *ops,
7690 struct workqueue_struct *wq,
7791 struct mmu_rb_handler **handler);