]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/slab: abstract slabobj_ext access via new slab_obj_ext() helper
authorHarry Yoo <harry.yoo@oracle.com>
Tue, 13 Jan 2026 06:18:40 +0000 (15:18 +0900)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 4 Feb 2026 09:05:35 +0000 (10:05 +0100)
commit52f1ca8a459a73cf423a0b71b59f0b950e522cab
tree8f3525397d799a0207aa4c1447f531e2780f15d0
parent43d9bb4236fd1dd2e4646bee7f556542eefa422a
mm/slab: abstract slabobj_ext access via new slab_obj_ext() helper

Currently, the slab allocator assumes that slab->obj_exts is a pointer
to an array of struct slabobj_ext objects. However, to support storage
methods where struct slabobj_ext is embedded within objects, the slab
allocator should not make this assumption. Instead of directly
dereferencing the slabobj_exts array, abstract access to
struct slabobj_ext via helper functions.

Introduce a new API slabobj_ext metadata access:

  slab_obj_ext(slab, obj_exts, index) - returns the pointer to
  struct slabobj_ext element at the given index.

Directly dereferencing the return value of slab_obj_exts() is no longer
allowed. Instead, slab_obj_ext() must always be used to access
individual struct slabobj_ext objects.

Convert all users to use these APIs.
No functional changes intended.

Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Link: https://patch.msgid.link/20260113061845.159790-5-harry.yoo@oracle.com
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/memcontrol.c
mm/slab.h
mm/slub.c