Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754950AbbGCJka (ORCPT ); Fri, 3 Jul 2015 05:40:30 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57399 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754728AbbGCJkR (ORCPT ); Fri, 3 Jul 2015 05:40:17 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-02-5596587d55b9 From: Krzysztof Kozlowski To: Seth Jennings , Dan Streetman , Minchan Kim , Nitin Gupta , linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Andrew Morton , Krzysztof Kozlowski Subject: [PATCH 1/2] mm: zpool: Constify the zpool_ops Date: Fri, 03 Jul 2015 18:40:12 +0900 Message-id: <1435916413-6475-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnluLIzCtJLcpLzFFi42I5/e/4Nd3aiGmhBp0XzC3mrF/DZnGhbTeL xesXhhaXd81hs7i35j+rxbKv79ktNrTMYrf4dPQRmwOHx9MJB5k8Nq3qZPPY9GkSu8eJGb9Z PPq2rGL0uP6tyGPnp82sHp83yQVwRHHZpKTmZJalFunbJXBlrG6dz15wWqLi0ZyHjA2MO4S7 GDk5JARMJB5838EKYYtJXLi3nq2LkYtDSGApo0TX9Q0sEM5/RonFzT+ZQarYBIwlNi9fAlYl InCKUWLr/COMIAlmgTiJc00fwUYJC5hJXOo+zQJiswioSvydfYwdxOYVcJNovfSFCWKdnMTJ Y5NZJzByL2BkWMUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kREkxfdjAuPmZ1iFGAg1GJh/fC 6amhQqyJZcWVuYcYJTiYlUR4nwdPCxXiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3fX+xAhgfTE ktTs1NSC1CKYLBMHp1QDo3Kw2iejZ+p3/hw9yLZli49mbQzL/5UpfLc+XTTKNu5fpZocafDP WKl8ecfjWiZ2DT9jfaP6dWU3raOnagrI7jiSz3BUqSbwOjdrdZ+A1nR2s/brkq/fvXwgsmLO i31dW1bmzmBiqDH9y/m/6nhg82eWHPapRyar/L35XP+TY/TMPWYm9y6IK7EUZyQaajEXFScC AIZCG1YiAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3284 Lines: 113 The structure zpool_ops is not modified so make the pointer to it as pointer to const. Signed-off-by: Krzysztof Kozlowski --- include/linux/zpool.h | 4 ++-- mm/zbud.c | 4 ++-- mm/zpool.c | 4 ++-- mm/zsmalloc.c | 3 ++- mm/zswap.c | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/linux/zpool.h b/include/linux/zpool.h index d30eff3d84d5..c924a28d9805 100644 --- a/include/linux/zpool.h +++ b/include/linux/zpool.h @@ -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); diff --git a/mm/zbud.c b/mm/zbud.c index f3bf6f7627d8..6f8158d64864 100644 --- 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; 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 { 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; diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 0a7f81aa2249..6e139d381d80 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -309,7 +309,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); diff --git a/mm/zswap.c b/mm/zswap.c index 2d5727baed59..017a3f50725d 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -816,7 +816,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 }; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/