aboutsummaryrefslogtreecommitdiff
path: root/include/linux/slub_def.h
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-04-27 09:52:15 +0800
committerAlex Shi <alex.shi@linaro.org>2016-04-27 09:52:15 +0800
commite0ac66e00b01f6ff4e8274a4b5c008a26583c1b9 (patch)
treec845d5e80991f0eef3a38381036c8261baffb08a /include/linux/slub_def.h
parente9cd0f1ce300f433a478bd1973dea112b5fbb800 (diff)
parent7b44c3df0b89d05c80e15eb0522a21d033d1314f (diff)
Merge branch 'v3.18/topic/KASAN' into linux-linaro-lsk-v3.18lsk-v3.18-16.04
Diffstat (limited to 'include/linux/slub_def.h')
-rw-r--r--include/linux/slub_def.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index d82abd40a3c0..e565d7c10c9c 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -110,4 +110,23 @@ static inline void sysfs_slab_remove(struct kmem_cache *s)
}
#endif
+
+/**
+ * virt_to_obj - returns address of the beginning of object.
+ * @s: object's kmem_cache
+ * @slab_page: address of slab page
+ * @x: address within object memory range
+ *
+ * Returns address of the beginning of object
+ */
+static inline void *virt_to_obj(struct kmem_cache *s,
+ const void *slab_page,
+ const void *x)
+{
+ return (void *)x - ((x - slab_page) % s->size);
+}
+
+void object_err(struct kmem_cache *s, struct page *page,
+ u8 *object, char *reason);
+
#endif /* _LINUX_SLUB_DEF_H */