diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/bitmap_allocator_priv.h')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/bitmap_allocator_priv.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/bitmap_allocator_priv.h b/drivers/gpu/nvgpu/common/mm/bitmap_allocator_priv.h index 95780202..4f0b3012 100644 --- a/drivers/gpu/nvgpu/common/mm/bitmap_allocator_priv.h +++ b/drivers/gpu/nvgpu/common/mm/bitmap_allocator_priv.h | |||
@@ -17,8 +17,8 @@ | |||
17 | #ifndef BITMAP_ALLOCATOR_PRIV_H | 17 | #ifndef BITMAP_ALLOCATOR_PRIV_H |
18 | #define BITMAP_ALLOCATOR_PRIV_H | 18 | #define BITMAP_ALLOCATOR_PRIV_H |
19 | 19 | ||
20 | #include <linux/rbtree.h> | ||
21 | 20 | ||
21 | #include <nvgpu/rbtree.h> | ||
22 | #include <nvgpu/kmem.h> | 22 | #include <nvgpu/kmem.h> |
23 | 23 | ||
24 | struct nvgpu_allocator; | 24 | struct nvgpu_allocator; |
@@ -43,7 +43,7 @@ struct nvgpu_bitmap_allocator { | |||
43 | u64 next_blk; | 43 | u64 next_blk; |
44 | 44 | ||
45 | unsigned long *bitmap; /* The actual bitmap! */ | 45 | unsigned long *bitmap; /* The actual bitmap! */ |
46 | struct rb_root allocs; /* Tree of outstanding allocations. */ | 46 | struct nvgpu_rbtree_node *allocs; /* Tree of outstanding allocations */ |
47 | 47 | ||
48 | struct nvgpu_kmem_cache *meta_data_cache; | 48 | struct nvgpu_kmem_cache *meta_data_cache; |
49 | 49 | ||
@@ -61,7 +61,14 @@ struct nvgpu_bitmap_allocator { | |||
61 | struct nvgpu_bitmap_alloc { | 61 | struct nvgpu_bitmap_alloc { |
62 | u64 base; | 62 | u64 base; |
63 | u64 length; | 63 | u64 length; |
64 | struct rb_node alloc_entry; /* RB tree of allocations. */ | 64 | struct nvgpu_rbtree_node alloc_entry; /* RB tree of allocations. */ |
65 | }; | ||
66 | |||
67 | static inline struct nvgpu_bitmap_alloc * | ||
68 | nvgpu_bitmap_alloc_from_rbtree_node(struct nvgpu_rbtree_node *node) | ||
69 | { | ||
70 | return (struct nvgpu_bitmap_alloc *) | ||
71 | ((uintptr_t)node - offsetof(struct nvgpu_bitmap_alloc, alloc_entry)); | ||
65 | }; | 72 | }; |
66 | 73 | ||
67 | static inline struct nvgpu_bitmap_allocator *bitmap_allocator( | 74 | static inline struct nvgpu_bitmap_allocator *bitmap_allocator( |