]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
mm: zpool: constify the zpool_ops
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Tue, 8 Sep 2015 22:05:03 +0000 (15:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Sep 2015 22:35:28 +0000 (15:35 -0700)
The structure zpool_ops is not modified so make the pointer to it a
pointer to const.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/zpool.h
mm/zbud.c
mm/zpool.c
mm/zsmalloc.c
mm/zswap.c

index d30eff3d84d54282656e687313ca6db4ef8c8d90..c924a28d9805010f49f9009e76459ab805de280b 100644 (file)
@@ -37,7 +37,7 @@ enum zpool_mapmode {
 };
 
 struct zpool *zpool_create_pool(char *type, char *name,
-                       gfp_t gfp, struct zpool_ops *ops);
+                       gfp_t gfp, const struct zpool_ops *ops);
 
 char *zpool_get_type(struct zpool *pool);
 
@@ -81,7 +81,7 @@ struct zpool_driver {
        atomic_t refcount;
        struct list_head list;
 
-       void *(*create)(char *name, gfp_t gfp, struct zpool_ops *ops,
+       void *(*create)(char *name, gfp_t gfp, const struct zpool_ops *ops,
                        struct zpool *zpool);
        void (*destroy)(void *pool);
 
index f3bf6f7627d8d103bb674a99ed504092f15499a9..6f8158d6486484a26436853604d2e43489ef98de 100644 (file)
--- a/mm/zbud.c
+++ b/mm/zbud.c
@@ -99,7 +99,7 @@ struct zbud_pool {
        struct zbud_ops *ops;
 #ifdef CONFIG_ZPOOL
        struct zpool *zpool;
-       struct zpool_ops *zpool_ops;
+       const struct zpool_ops *zpool_ops;
 #endif
 };
 
@@ -138,7 +138,7 @@ static struct zbud_ops zbud_zpool_ops = {
 };
 
 static void *zbud_zpool_create(char *name, gfp_t gfp,
-                              struct zpool_ops *zpool_ops,
+                              const struct zpool_ops *zpool_ops,
                               struct zpool *zpool)
 {
        struct zbud_pool *pool;
index 722a4f60e90b29cd3626cdc4acddc1594ab7a0a5..951db32b833f38b3295a9b2ba42e17d54f76d6cc 100644 (file)
@@ -22,7 +22,7 @@ struct zpool {
 
        struct zpool_driver *driver;
        void *pool;
-       struct zpool_ops *ops;
+       const struct zpool_ops *ops;
 
        struct list_head list;
 };
@@ -115,7 +115,7 @@ static void zpool_put_driver(struct zpool_driver *driver)
  * Returns: New zpool on success, NULL on failure.
  */
 struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp,
-               struct zpool_ops *ops)
+               const struct zpool_ops *ops)
 {
        struct zpool_driver *driver;
        struct zpool *zpool;
index 089120429c1836e06c1d561d4fb85fe058d6f33a..f135b1b6fcdcab49aaf0845e078c6fc299b4b28b 100644 (file)
@@ -311,7 +311,8 @@ static void record_obj(unsigned long handle, unsigned long obj)
 
 #ifdef CONFIG_ZPOOL
 
-static void *zs_zpool_create(char *name, gfp_t gfp, struct zpool_ops *zpool_ops,
+static void *zs_zpool_create(char *name, gfp_t gfp,
+                            const struct zpool_ops *zpool_ops,
                             struct zpool *zpool)
 {
        return zs_create_pool(name, gfp);
index 09208c7c86f3e010b91ce9c5f10cd29241c76d41..48a1d081e2a5f1ccba77570b8f7215a8f69c6302 100644 (file)
@@ -755,7 +755,7 @@ static void zswap_frontswap_invalidate_area(unsigned type)
        zswap_trees[type] = NULL;
 }
 
-static struct zpool_ops zswap_zpool_ops = {
+static const struct zpool_ops zswap_zpool_ops = {
        .evict = zswap_writeback_entry
 };