slub: avoid label inside conditional
authorDavid Rientjes <rientjes@google.com>
Thu, 12 May 2011 20:10:49 +0000 (13:10 -0700)
committerPekka Enberg <penberg@kernel.org>
Tue, 17 May 2011 19:19:00 +0000 (22:19 +0300)
Jumping to a label inside a conditional is considered poor style,
especially considering the current organization of __slab_alloc().

This removes the 'load_from_page' label and just duplicates the three
lines of code that it uses:

c->node = page_to_nid(page);
c->page = page;
goto load_freelist;

since it's probably not worth making this a separate helper function.

Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slub.c

index 97bb5b8d935fb0f6a9c029032a73d56076ee7208..9f7bb93e17ecd00f38ad85d9b5a8f3a6c1b50de8 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1845,7 +1845,6 @@ new_slab:
        page = get_partial(s, gfpflags, node);
        if (page) {
                stat(s, ALLOC_FROM_PARTIAL);
-load_from_page:
                c->node = page_to_nid(page);
                c->page = page;
                goto load_freelist;
@@ -1868,8 +1867,9 @@ load_from_page:
 
                slab_lock(page);
                __SetPageSlubFrozen(page);
-
-               goto load_from_page;
+               c->node = page_to_nid(page);
+               c->page = page;
+               goto load_freelist;
        }
        if (!(gfpflags & __GFP_NOWARN) && printk_ratelimit())
                slab_out_of_memory(s, gfpflags, node);