diff options
author | Anton Blanchard <anton@samba.org> | 2010-02-07 07:30:12 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-02-08 21:56:07 -0500 |
commit | 7317ac87119dfb6fac36af4bcc64a25b62b5898d (patch) | |
tree | b426ba6d983f0eb0eb6273d392349d8f979f95a2 /arch/powerpc/mm | |
parent | 66fcb1059deeae072c1bf1536a8e2613028bce3e (diff) |
powerpc: Convert mmu context allocator from idr to ida
We can use the much more lightweight ida allocator since we don't
need the pointer storage idr provides.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/mmu_context_hash64.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/mm/mmu_context_hash64.c b/arch/powerpc/mm/mmu_context_hash64.c index b910d37aea1a..51622daae09d 100644 --- a/arch/powerpc/mm/mmu_context_hash64.c +++ b/arch/powerpc/mm/mmu_context_hash64.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <asm/mmu_context.h> | 23 | #include <asm/mmu_context.h> |
24 | 24 | ||
25 | static DEFINE_SPINLOCK(mmu_context_lock); | 25 | static DEFINE_SPINLOCK(mmu_context_lock); |
26 | static DEFINE_IDR(mmu_context_idr); | 26 | static DEFINE_IDA(mmu_context_ida); |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * The proto-VSID space has 2^35 - 1 segments available for user mappings. | 29 | * The proto-VSID space has 2^35 - 1 segments available for user mappings. |
@@ -39,11 +39,11 @@ int __init_new_context(void) | |||
39 | int err; | 39 | int err; |
40 | 40 | ||
41 | again: | 41 | again: |
42 | if (!idr_pre_get(&mmu_context_idr, GFP_KERNEL)) | 42 | if (!ida_pre_get(&mmu_context_ida, GFP_KERNEL)) |
43 | return -ENOMEM; | 43 | return -ENOMEM; |
44 | 44 | ||
45 | spin_lock(&mmu_context_lock); | 45 | spin_lock(&mmu_context_lock); |
46 | err = idr_get_new_above(&mmu_context_idr, NULL, 1, &index); | 46 | err = ida_get_new_above(&mmu_context_ida, 1, &index); |
47 | spin_unlock(&mmu_context_lock); | 47 | spin_unlock(&mmu_context_lock); |
48 | 48 | ||
49 | if (err == -EAGAIN) | 49 | if (err == -EAGAIN) |
@@ -53,7 +53,7 @@ again: | |||
53 | 53 | ||
54 | if (index > MAX_CONTEXT) { | 54 | if (index > MAX_CONTEXT) { |
55 | spin_lock(&mmu_context_lock); | 55 | spin_lock(&mmu_context_lock); |
56 | idr_remove(&mmu_context_idr, index); | 56 | ida_remove(&mmu_context_ida, index); |
57 | spin_unlock(&mmu_context_lock); | 57 | spin_unlock(&mmu_context_lock); |
58 | return -ENOMEM; | 58 | return -ENOMEM; |
59 | } | 59 | } |
@@ -85,7 +85,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
85 | void __destroy_context(int context_id) | 85 | void __destroy_context(int context_id) |
86 | { | 86 | { |
87 | spin_lock(&mmu_context_lock); | 87 | spin_lock(&mmu_context_lock); |
88 | idr_remove(&mmu_context_idr, context_id); | 88 | ida_remove(&mmu_context_ida, context_id); |
89 | spin_unlock(&mmu_context_lock); | 89 | spin_unlock(&mmu_context_lock); |
90 | } | 90 | } |
91 | EXPORT_SYMBOL_GPL(__destroy_context); | 91 | EXPORT_SYMBOL_GPL(__destroy_context); |