zsmalloc: drop unused member 'mapping_area->huge'
authorYiPing Xu <xuyiping@huawei.com>
Thu, 17 Mar 2016 21:20:39 +0000 (14:20 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Mar 2016 22:09:34 +0000 (15:09 -0700)
When unmapping a huge class page in zs_unmap_object, the page will be
unmapped by kmap_atomic.  the "!area->huge" branch in __zs_unmap_object
is alway true, and no code set "area->huge" now, so we can drop it.

Signed-off-by: YiPing Xu <xuyiping@huawei.com>
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/zsmalloc.c

index 2d7c4c11fc635d3822d64e8b2d796414945305f7..43e4cbcce5af303b42f5ed8d099ebc34389e7f26 100644 (file)
@@ -281,7 +281,6 @@ struct mapping_area {
 #endif
        char *vm_addr; /* address of kmap_atomic()'ed pages */
        enum zs_mapmode vm_mm; /* mapping mode */
-       bool huge;
 };
 
 static int create_handle_cache(struct zs_pool *pool)
@@ -1127,11 +1126,9 @@ static void __zs_unmap_object(struct mapping_area *area,
                goto out;
 
        buf = area->vm_buf;
-       if (!area->huge) {
-               buf = buf + ZS_HANDLE_SIZE;
-               size -= ZS_HANDLE_SIZE;
-               off += ZS_HANDLE_SIZE;
-       }
+       buf = buf + ZS_HANDLE_SIZE;
+       size -= ZS_HANDLE_SIZE;
+       off += ZS_HANDLE_SIZE;
 
        sizes[0] = PAGE_SIZE - off;
        sizes[1] = size - sizes[0];