Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd07d87f authored by David Rientjes's avatar David Rientjes Committed by Pekka Enberg
Browse files

slub: avoid label inside conditional



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: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarDavid Rientjes <rientjes@google.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 1393d9a1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1845,7 +1845,6 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
	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 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,

		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);