--- mm/slub.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2008-03-06 23:58:24.532831094 -0800 +++ linux-2.6/mm/slub.c 2008-03-06 23:58:40.617126516 -0800 @@ -326,7 +324,7 @@ static inline void set_freepointer(struc /* Scan freelist */ #define for_each_free_object(__p, __s, __free) \ - for (__p = (__free); (__p) != END; __p = get_freepointer((__s),\ + for (__p = (__free); !is_end(__p); __p = get_freepointer((__s),\ __p)) /* Determine object index from a given position */ @@ -760,7 +758,7 @@ static int on_freelist(struct kmem_cache void *object = NULL; int objects = slab_objects(s, page); - while (fp != END && nr <= objects) { + while (!is_end(fp) && nr <= objects) { if (fp == search) return 1; if (!check_valid_pointer(s, page, fp)) { @@ -917,7 +915,7 @@ static int free_debug_processing(struct } /* Special debug activities for freeing objects */ - if (!SlabFrozen(page) && page->freelist == END) + if (!SlabFrozen(page) && is_end(page->freelist)) remove_full(s, page); if (s->flags & SLAB_STORE_USER) set_track(s, object, TRACK_FREE, addr); @@ -1358,7 +1356,7 @@ static void unfreeze_slab(struct kmem_ca ClearSlabFrozen(page); if (page->inuse) { - if (page->freelist != END) { + if (!is_end(page->freelist)) { add_partial(n, page, tail); stat(c, tail ? DEACTIVATE_TO_TAIL : DEACTIVATE_TO_HEAD); } else { @@ -1585,7 +1583,7 @@ static __always_inline void *slab_alloc( local_irq_save(flags); c = get_cpu_slab(s, smp_processor_id()); - if (unlikely(c->freelist == END) || !node_match(c, node)) + if (unlikely(is_end(c->freelist)) || !node_match(c, node)) object = __slab_alloc(s, gfpflags, node, addr, c); @@ -1655,7 +1653,7 @@ checks_ok: * Objects left in the slab. If it was not on the partial list before * then add it. */ - if (unlikely(prior == END)) { + if (unlikely(is_end(prior))) { add_partial(get_node(s, page_to_nid(page)), page, 1); stat(c, FREE_ADD_PARTIAL); } @@ -1665,7 +1663,7 @@ out_unlock: return; slab_empty: - if (prior != END) { + if (!is_end(prior)) { /* * Slab still on the partial list. */