From 4d55ea811d4f5b832398f4e3b24c4da365956d62 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Fri, 2 Oct 2020 20:44:10 -0400 Subject: Throw const on some strings In C, const indicates to the reader that mutation will not occur. It can also serve as a hint about ownership. Add const in a few places where it makes sense. Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #10997 --- module/zfs/spa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/zfs/spa.c') diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 532f04b91..2c70cf701 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -6225,7 +6225,7 @@ spa_tryimport(nvlist_t *tryconfig) * we don't sync the labels or remove the configuration cache. */ static int -spa_export_common(char *pool, int new_state, nvlist_t **oldconfig, +spa_export_common(const char *pool, int new_state, nvlist_t **oldconfig, boolean_t force, boolean_t hardforce) { spa_t *spa; @@ -6369,7 +6369,7 @@ export_spa: * Destroy a storage pool. */ int -spa_destroy(char *pool) +spa_destroy(const char *pool) { return (spa_export_common(pool, POOL_STATE_DESTROYED, NULL, B_FALSE, B_FALSE)); @@ -6379,7 +6379,7 @@ spa_destroy(char *pool) * Export a storage pool. */ int -spa_export(char *pool, nvlist_t **oldconfig, boolean_t force, +spa_export(const char *pool, nvlist_t **oldconfig, boolean_t force, boolean_t hardforce) { return (spa_export_common(pool, POOL_STATE_EXPORTED, oldconfig, @@ -6391,7 +6391,7 @@ spa_export(char *pool, nvlist_t **oldconfig, boolean_t force, * from the namespace in any way. */ int -spa_reset(char *pool) +spa_reset(const char *pool) { return (spa_export_common(pool, POOL_STATE_UNINITIALIZED, NULL, B_FALSE, B_FALSE)); -- cgit v1.2.3