aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2010-08-10 21:03:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:21 -0400
commita6eb9fe105d5de0053b261148cee56c94b4720ca (patch)
tree36e3f324a6a768397ef398674176c0f5f5365bff /include/linux/slub_def.h
parentcd1542c8197fc3c2eb3a8301505d5d9738fab1e4 (diff)
dma-mapping: rename ARCH_KMALLOC_MINALIGN to ARCH_DMA_MINALIGN
Now each architecture has the own dma_get_cache_alignment implementation. dma_get_cache_alignment returns the minimum DMA alignment. Architectures define it as ARCH_KMALLOC_MINALIGN (it's used to make sure that malloc'ed buffer is DMA-safe; the buffer doesn't share a cache with the others). So we can unify dma_get_cache_alignment implementations. This patch: dma_get_cache_alignment() needs to know if an architecture defines ARCH_KMALLOC_MINALIGN or not (needs to know if architecture has DMA alignment restriction). However, slab.h define ARCH_KMALLOC_MINALIGN if architectures doesn't define it. Let's rename ARCH_KMALLOC_MINALIGN to ARCH_DMA_MINALIGN. ARCH_KMALLOC_MINALIGN is used only in the internals of slab/slob/slub (except for crypto). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r--include/linux/slub_def.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 6447a723ecb1..6d14409c4d9a 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -106,15 +106,17 @@ struct kmem_cache {
106/* 106/*
107 * Kmalloc subsystem. 107 * Kmalloc subsystem.
108 */ 108 */
109#if defined(ARCH_KMALLOC_MINALIGN) && ARCH_KMALLOC_MINALIGN > 8 109#if defined(ARCH_DMA_MINALIGN) && ARCH_DMA_MINALIGN > 8
110#define KMALLOC_MIN_SIZE ARCH_KMALLOC_MINALIGN 110#define KMALLOC_MIN_SIZE ARCH_DMA_MINALIGN
111#else 111#else
112#define KMALLOC_MIN_SIZE 8 112#define KMALLOC_MIN_SIZE 8
113#endif 113#endif
114 114
115#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) 115#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
116 116
117#ifndef ARCH_KMALLOC_MINALIGN 117#ifdef ARCH_DMA_MINALIGN
118#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
119#else
118#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) 120#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
119#endif 121#endif
120 122