diff options
author | Krzysztof Kozlowski <k.kozlowski@samsung.com> | 2015-09-08 18:05:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 18:35:28 -0400 |
commit | 786727799a85aeabc20cab5ecfb72771bcbd6b85 (patch) | |
tree | 706c7ffbadf27ddfe5a633bd3032c35428a1e8ec /mm | |
parent | 5b999aadbae65696a148f55250d94b6f3d74071e (diff) |
mm: zpool: constify the zpool_ops
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>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/zbud.c | 4 | ||||
-rw-r--r-- | mm/zpool.c | 4 | ||||
-rw-r--r-- | mm/zsmalloc.c | 3 | ||||
-rw-r--r-- | mm/zswap.c | 2 |
4 files changed, 7 insertions, 6 deletions
@@ -99,7 +99,7 @@ struct zbud_pool { | |||
99 | struct zbud_ops *ops; | 99 | struct zbud_ops *ops; |
100 | #ifdef CONFIG_ZPOOL | 100 | #ifdef CONFIG_ZPOOL |
101 | struct zpool *zpool; | 101 | struct zpool *zpool; |
102 | struct zpool_ops *zpool_ops; | 102 | const struct zpool_ops *zpool_ops; |
103 | #endif | 103 | #endif |
104 | }; | 104 | }; |
105 | 105 | ||
@@ -138,7 +138,7 @@ static struct zbud_ops zbud_zpool_ops = { | |||
138 | }; | 138 | }; |
139 | 139 | ||
140 | static void *zbud_zpool_create(char *name, gfp_t gfp, | 140 | static void *zbud_zpool_create(char *name, gfp_t gfp, |
141 | struct zpool_ops *zpool_ops, | 141 | const struct zpool_ops *zpool_ops, |
142 | struct zpool *zpool) | 142 | struct zpool *zpool) |
143 | { | 143 | { |
144 | struct zbud_pool *pool; | 144 | struct zbud_pool *pool; |
diff --git a/mm/zpool.c b/mm/zpool.c index 722a4f60e90b..951db32b833f 100644 --- a/mm/zpool.c +++ b/mm/zpool.c | |||
@@ -22,7 +22,7 @@ struct zpool { | |||
22 | 22 | ||
23 | struct zpool_driver *driver; | 23 | struct zpool_driver *driver; |
24 | void *pool; | 24 | void *pool; |
25 | struct zpool_ops *ops; | 25 | const struct zpool_ops *ops; |
26 | 26 | ||
27 | struct list_head list; | 27 | struct list_head list; |
28 | }; | 28 | }; |
@@ -115,7 +115,7 @@ static void zpool_put_driver(struct zpool_driver *driver) | |||
115 | * Returns: New zpool on success, NULL on failure. | 115 | * Returns: New zpool on success, NULL on failure. |
116 | */ | 116 | */ |
117 | struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp, | 117 | struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp, |
118 | struct zpool_ops *ops) | 118 | const struct zpool_ops *ops) |
119 | { | 119 | { |
120 | struct zpool_driver *driver; | 120 | struct zpool_driver *driver; |
121 | struct zpool *zpool; | 121 | struct zpool *zpool; |
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 089120429c18..f135b1b6fcdc 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c | |||
@@ -311,7 +311,8 @@ static void record_obj(unsigned long handle, unsigned long obj) | |||
311 | 311 | ||
312 | #ifdef CONFIG_ZPOOL | 312 | #ifdef CONFIG_ZPOOL |
313 | 313 | ||
314 | static void *zs_zpool_create(char *name, gfp_t gfp, struct zpool_ops *zpool_ops, | 314 | static void *zs_zpool_create(char *name, gfp_t gfp, |
315 | const struct zpool_ops *zpool_ops, | ||
315 | struct zpool *zpool) | 316 | struct zpool *zpool) |
316 | { | 317 | { |
317 | return zs_create_pool(name, gfp); | 318 | return zs_create_pool(name, gfp); |
diff --git a/mm/zswap.c b/mm/zswap.c index 09208c7c86f3..48a1d081e2a5 100644 --- a/mm/zswap.c +++ b/mm/zswap.c | |||
@@ -755,7 +755,7 @@ static void zswap_frontswap_invalidate_area(unsigned type) | |||
755 | zswap_trees[type] = NULL; | 755 | zswap_trees[type] = NULL; |
756 | } | 756 | } |
757 | 757 | ||
758 | static struct zpool_ops zswap_zpool_ops = { | 758 | static const struct zpool_ops zswap_zpool_ops = { |
759 | .evict = zswap_writeback_entry | 759 | .evict = zswap_writeback_entry |
760 | }; | 760 | }; |
761 | 761 | ||