From 78fe154ff761bd1dff6db96e90cd4e23185574e2 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 19 Apr 2017 12:29:53 +0530 Subject: gpu: nvgpu: use nvgpu list for page allocator Use nvgpu list APIs instead of linux list APIs for page allocator lists Jira NVGPU-13 Change-Id: I3ee64a5cdc2ced4ca9c4ba7ad6271915a66d90f5 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1462076 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/include/nvgpu/page_allocator.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h index 70ed81c3..9a5ef8d3 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h @@ -17,8 +17,6 @@ #ifndef PAGE_ALLOCATOR_PRIV_H #define PAGE_ALLOCATOR_PRIV_H -#include - #include #include #include @@ -46,9 +44,9 @@ struct nvgpu_allocator; * assumed to be 64k) the allocation is satisfied by one of the buckets. */ struct page_alloc_slab { - struct list_head empty; - struct list_head partial; - struct list_head full; + struct nvgpu_list_node empty; + struct nvgpu_list_node partial; + struct nvgpu_list_node full; int nr_empty; int nr_partial; @@ -75,7 +73,14 @@ struct page_alloc_slab_page { enum slab_page_state state; struct page_alloc_slab *owner; - struct list_head list_entry; + struct nvgpu_list_node list_entry; +}; + +static inline struct page_alloc_slab_page * +page_alloc_slab_page_from_list_entry(struct nvgpu_list_node *node) +{ + return (struct page_alloc_slab_page *) + ((uintptr_t)node - offsetof(struct page_alloc_slab_page, list_entry)); }; struct page_alloc_chunk { -- cgit v1.2.2