]> www.infradead.org Git - users/willy/linux.git/commitdiff
mm/slub: Convert freelist_corrupted() to struct slab
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Fri, 1 Oct 2021 22:06:50 +0000 (18:06 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 4 Oct 2021 13:18:00 +0000 (09:18 -0400)
Move slab_page() call down a level.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
mm/slub.c

index 16ce9aeccdc896aa03f864e35893b6e34525ec3d..6d81e54e61dfaea81c017a289bedf47903d6ecd2 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -799,12 +799,12 @@ static void slab_fix(struct kmem_cache *s, char *fmt, ...)
        va_end(args);
 }
 
-static bool freelist_corrupted(struct kmem_cache *s, struct page *page,
+static bool freelist_corrupted(struct kmem_cache *s, struct slab *slab,
                               void **freelist, void *nextfree)
 {
        if ((s->flags & SLAB_CONSISTENCY_CHECKS) &&
-           !check_valid_pointer(s, page, nextfree) && freelist) {
-               object_err(s, page, *freelist, "Freechain corrupt");
+           !check_valid_pointer(s, slab_page(slab), nextfree) && freelist) {
+               object_err(s, slab_page(slab), *freelist, "Freechain corrupt");
                *freelist = NULL;
                slab_fix(s, "Isolate corrupted freechain");
                return true;
@@ -1637,7 +1637,7 @@ static inline void inc_slabs_node(struct kmem_cache *s, int node,
 static inline void dec_slabs_node(struct kmem_cache *s, int node,
                                                        int objects) {}
 
-static bool freelist_corrupted(struct kmem_cache *s, struct page *page,
+static bool freelist_corrupted(struct kmem_cache *s, struct slab *slab,
                               void **freelist, void *nextfree)
 {
        return false;
@@ -2330,7 +2330,7 @@ static void deactivate_slab(struct kmem_cache *s, struct slab *slab,
                 * 'freelist_iter' is already corrupted.  So isolate all objects
                 * starting at 'freelist_iter' by skipping them.
                 */
-               if (freelist_corrupted(s, slab_page(slab), &freelist_iter, nextfree))
+               if (freelist_corrupted(s, slab, &freelist_iter, nextfree))
                        break;
 
                freelist_tail = freelist_iter;