From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Seth Jennings <sjennings@variantweb.net>,
Dan Streetman <ddstreet@ieee.org>,
Minchan Kim <minchan@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
Sergey SENOZHATSKY <sergey.senozhatsky@gmail.com>
Subject: [PATCH 1/2] mm:zpool: constify struct zpool type
Date: Thu, 10 Sep 2015 20:48:37 +0900 [thread overview]
Message-ID: <1441885718-32580-2-git-send-email-sergey.senozhatsky@gmail.com> (raw)
In-Reply-To: <1441885718-32580-1-git-send-email-sergey.senozhatsky@gmail.com>
From: Sergey SENOZHATSKY <sergey.senozhatsky@gmail.com>
Constify `struct zpool' ->type.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
include/linux/zpool.h | 8 ++++----
mm/zpool.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/linux/zpool.h b/include/linux/zpool.h
index 42f8ec9..2c136f4 100644
--- a/include/linux/zpool.h
+++ b/include/linux/zpool.h
@@ -36,12 +36,12 @@ enum zpool_mapmode {
ZPOOL_MM_DEFAULT = ZPOOL_MM_RW
};
-bool zpool_has_pool(char *type);
+bool zpool_has_pool(const char *type);
-struct zpool *zpool_create_pool(char *type, char *name,
+struct zpool *zpool_create_pool(const char *type, char *name,
gfp_t gfp, const struct zpool_ops *ops);
-char *zpool_get_type(struct zpool *pool);
+const char *zpool_get_type(struct zpool *pool);
void zpool_destroy_pool(struct zpool *pool);
@@ -78,7 +78,7 @@ u64 zpool_get_total_size(struct zpool *pool);
* with zpool.
*/
struct zpool_driver {
- char *type;
+ const char *type;
struct module *owner;
atomic_t refcount;
struct list_head list;
diff --git a/mm/zpool.c b/mm/zpool.c
index 8f670d3..2889d0d 100644
--- a/mm/zpool.c
+++ b/mm/zpool.c
@@ -18,7 +18,7 @@
#include <linux/zpool.h>
struct zpool {
- char *type;
+ const char *type;
struct zpool_driver *driver;
void *pool;
@@ -73,7 +73,7 @@ int zpool_unregister_driver(struct zpool_driver *driver)
}
EXPORT_SYMBOL(zpool_unregister_driver);
-static struct zpool_driver *zpool_get_driver(char *type)
+static struct zpool_driver *zpool_get_driver(const char *type)
{
struct zpool_driver *driver;
@@ -115,7 +115,7 @@ static void zpool_put_driver(struct zpool_driver *driver)
*
* Returns: true if @type pool is available, false if not
*/
-bool zpool_has_pool(char *type)
+bool zpool_has_pool(const char *type)
{
struct zpool_driver *driver = zpool_get_driver(type);
@@ -147,7 +147,7 @@ EXPORT_SYMBOL(zpool_has_pool);
*
* Returns: New zpool on success, NULL on failure.
*/
-struct zpool *zpool_create_pool(char *type, char *name, gfp_t gfp,
+struct zpool *zpool_create_pool(const char *type, char *name, gfp_t gfp,
const struct zpool_ops *ops)
{
struct zpool_driver *driver;
@@ -228,7 +228,7 @@ void zpool_destroy_pool(struct zpool *zpool)
*
* Returns: The type of zpool.
*/
-char *zpool_get_type(struct zpool *zpool)
+const char *zpool_get_type(struct zpool *zpool)
{
return zpool->type;
}
--
2.5.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-10 11:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 11:48 [PATCH 0/2] mm:constify zpool/zs_pool char members Sergey Senozhatsky
2015-09-10 11:48 ` Sergey Senozhatsky [this message]
2015-09-11 22:21 ` [PATCH 1/2] mm:zpool: constify struct zpool type Andrew Morton
2015-09-12 0:29 ` Sergey Senozhatsky
2015-09-10 11:48 ` [PATCH 2/2] mm:zsmalloc: constify struct zs_pool name Sergey Senozhatsky
2015-09-11 12:13 ` [PATCH 0/2] mm:constify zpool/zs_pool char members Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441885718-32580-2-git-send-email-sergey.senozhatsky@gmail.com \
--to=sergey.senozhatsky@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ddstreet@ieee.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
--cc=sjennings@variantweb.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox