[patch 4/6] slub: avoid compiling SLAB_CACHE_DMA without DMAsupport

From: David Rientjes
Date: Tue May 24 2011 - 19:54:38 EST


If CONFIG_ZONE_DMA is disabled, SLAB_CACHE_DMA is a no-op. Avoid
compiling support for it on such a configuration.

Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
---
mm/slub.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -162,7 +162,10 @@ static inline int kmem_cache_debug(struct kmem_cache *s)
SLAB_FAILSLAB)

#define SLUB_MERGE_SAME (SLAB_DEBUG_FREE | SLAB_RECLAIM_ACCOUNT | \
- SLAB_CACHE_DMA | SLAB_NOTRACK)
+# ifdef CONFIG_ZONE_DMA
+ SLAB_CACHE_DMA | \
+# endif
+ SLAB_NOTRACK)

#define OO_SHIFT 16
#define OO_MASK ((1 << OO_SHIFT) - 1)
@@ -2544,8 +2547,10 @@ static int calculate_sizes(struct kmem_cache *s, int forced_order)
if (order)
s->allocflags |= __GFP_COMP;

+#ifdef CONFIG_ZONE_DMA
if (s->flags & SLAB_CACHE_DMA)
s->allocflags |= SLUB_DMA;
+#endif

if (s->flags & SLAB_RECLAIM_ACCOUNT)
s->allocflags |= __GFP_RECLAIMABLE;
@@ -4651,8 +4656,10 @@ static char *create_unique_id(struct kmem_cache *s)
* are matched during merging to guarantee that the id is
* unique.
*/
+#ifdef CONFIG_ZONE_DMA
if (s->flags & SLAB_CACHE_DMA)
*p++ = 'd';
+#endif
if (s->flags & SLAB_RECLAIM_ACCOUNT)
*p++ = 'a';
if (s->flags & SLAB_DEBUG_FREE)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/