summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/mmu_rb.h
diff options
context:
space:
mode:
authorDean Luick <dean.luick@intel.com>2016-07-28 15:21:20 -0400
committerDoug Ledford <dledford@redhat.com>2016-08-02 22:46:21 -0400
commite0b09ac55d51bb9bf6a4a320bf4029e40bdabd6c (patch)
tree8b8b30212e63a544584aa45af49bc3c62bf94c6b /drivers/infiniband/hw/hfi1/mmu_rb.h
parent3faa3d9a308e539cc48355b1f419a5ed9f8274a2 (diff)
downloadlinux-e0b09ac55d51bb9bf6a4a320bf4029e40bdabd6c.tar.bz2
IB/hfi1: Make the cache handler own its rb tree root
The objects which use cache handling should reference their own handler object not the internal data structure it uses to track the nodes. Have the "users" of the mmu notifier code pass opaque objects which can then be properly used in the mmu callbacks depending on the owners needs. This patch has the additional benefit that operations no longer require a look up in a list to find the handlers. Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/mmu_rb.h')
-rw-r--r--drivers/infiniband/hw/hfi1/mmu_rb.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/hfi1/mmu_rb.h b/drivers/infiniband/hw/hfi1/mmu_rb.h
index 489a691856e5..2cedfbe2189e 100644
--- a/drivers/infiniband/hw/hfi1/mmu_rb.h
+++ b/drivers/infiniband/hw/hfi1/mmu_rb.h
@@ -59,18 +59,21 @@ struct mmu_rb_node {
struct mmu_rb_ops {
bool (*filter)(struct mmu_rb_node *node, unsigned long addr,
unsigned long len);
- int (*insert)(struct rb_root *root, struct mmu_rb_node *mnode);
- void (*remove)(struct rb_root *root, struct mmu_rb_node *mnode,
+ int (*insert)(void *ops_arg, struct mmu_rb_node *mnode);
+ void (*remove)(void *ops_arg, struct mmu_rb_node *mnode,
struct mm_struct *mm);
- int (*invalidate)(struct rb_root *root, struct mmu_rb_node *node);
+ int (*invalidate)(void *ops_arg, struct mmu_rb_node *node);
};
-int hfi1_mmu_rb_register(struct mm_struct *mm, struct rb_root *root,
- struct mmu_rb_ops *ops);
-void hfi1_mmu_rb_unregister(struct rb_root *);
-int hfi1_mmu_rb_insert(struct rb_root *, struct mmu_rb_node *);
-void hfi1_mmu_rb_remove(struct rb_root *, struct mmu_rb_node *);
-struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *, unsigned long,
- unsigned long);
+int hfi1_mmu_rb_register(void *ops_arg, struct mm_struct *mm,
+ struct mmu_rb_ops *ops,
+ struct mmu_rb_handler **handler);
+void hfi1_mmu_rb_unregister(struct mmu_rb_handler *handler);
+int hfi1_mmu_rb_insert(struct mmu_rb_handler *handler,
+ struct mmu_rb_node *mnode);
+void hfi1_mmu_rb_remove(struct mmu_rb_handler *handler,
+ struct mmu_rb_node *mnode);
+struct mmu_rb_node *hfi1_mmu_rb_extract(struct mmu_rb_handler *handler,
+ unsigned long addr, unsigned long len);
#endif /* _HFI1_MMU_RB_H */