crypto: scatterwalk - Avoid flush_dcache_page on slab pages
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 9 Feb 2009 03:22:14 +0000 (14:22 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 9 Feb 2009 03:30:25 +0000 (14:30 +1100)
It's illegal to call flush_dcache_page on slab pages on a number
of architectures.  So this patch avoids doing so if PageSlab is
true.

In future we can move the flush_dcache_page call to those page
cache users that actually need it.

Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/scatterwalk.c

index 9aeeb52004a5399d0a9b7a3484044b5de1e3083c..3de89a424401c1918818145a3d27df627c99f7ef 100644 (file)
@@ -54,7 +54,8 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
                struct page *page;
 
                page = sg_page(walk->sg) + ((walk->offset - 1) >> PAGE_SHIFT);
-               flush_dcache_page(page);
+               if (!PageSlab(page))
+                       flush_dcache_page(page);
        }
 
        if (more) {