From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: xen-devel@lists.xenproject.org, jbeulich@suse.com
Cc: Bob Liu <lliubbo@gmail.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: [PATCH v2.1 14/15] tmem: remove useless parameter from client and pool flush
Date: Wed, 9 Apr 2014 09:26:18 -0400 [thread overview]
Message-ID: <1397049979-3479-15-git-send-email-konrad.wilk@oracle.com> (raw)
In-Reply-To: <1397049979-3479-1-git-send-email-konrad.wilk@oracle.com>
From: Bob Liu <lliubbo@gmail.com>
Parameter "destroy" in function client_flush() and pool_flush() is unneeded
because it was always set to 1.
Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
xen/common/tmem.c | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)
diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index 27164cc..66870a0 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1108,7 +1108,7 @@ static int shared_pool_quit(struct tmem_pool *pool, domid_t cli_id)
}
/* flush all data (owned by cli_id) from a pool and, optionally, free it */
-static void pool_flush(struct tmem_pool *pool, domid_t cli_id, bool_t destroy)
+static void pool_flush(struct tmem_pool *pool, domid_t cli_id)
{
ASSERT(pool != NULL);
if ( (is_shared(pool)) && (shared_pool_quit(pool,cli_id) > 0) )
@@ -1117,23 +1117,19 @@ static void pool_flush(struct tmem_pool *pool, domid_t cli_id, bool_t destroy)
tmem_cli_id_str, cli_id, pool->pool_id, tmem_cli_id_str,pool->client->cli_id);
return;
}
- tmem_client_info("%s %s-%s tmem pool %s=%d pool_id=%d\n",
- destroy ? "destroying" : "flushing",
+ tmem_client_info("Destroying %s-%s tmem pool %s=%d pool_id=%d\n",
is_persistent(pool) ? "persistent" : "ephemeral" ,
is_shared(pool) ? "shared" : "private",
tmem_cli_id_str, pool->client->cli_id, pool->pool_id);
if ( pool->client->live_migrating )
{
- tmem_client_warn("can't %s pool while %s is live-migrating\n",
- destroy?"destroy":"flush", tmem_client_str);
+ tmem_client_warn("can't destroy pool while %s is live-migrating\n",
+ tmem_client_str);
return;
}
pool_destroy_objs(pool, TMEM_CLI_ID_NULL);
- if ( destroy )
- {
- pool->client->pools[pool->pool_id] = NULL;
- pool_free(pool);
- }
+ pool->client->pools[pool->pool_id] = NULL;
+ pool_free(pool);
}
/************ CLIENT MANIPULATION OPERATIONS **************************/
@@ -1201,7 +1197,7 @@ static void client_free(struct client *client)
}
/* flush all data from a client and, optionally, free it */
-static void client_flush(struct client *client, bool_t destroy)
+static void client_flush(struct client *client)
{
int i;
struct tmem_pool *pool;
@@ -1210,12 +1206,10 @@ static void client_flush(struct client *client, bool_t destroy)
{
if ( (pool = client->pools[i]) == NULL )
continue;
- pool_flush(pool,client->cli_id,destroy);
- if ( destroy )
- client->pools[i] = NULL;
+ pool_flush(pool, client->cli_id);
+ client->pools[i] = NULL;
}
- if ( destroy )
- client_free(client);
+ client_free(client);
}
static bool_t client_over_quota(struct client *client)
@@ -1832,7 +1826,7 @@ static int do_tmem_destroy_pool(uint32_t pool_id)
if ( (pool = client->pools[pool_id]) == NULL )
return 0;
client->pools[pool_id] = NULL;
- pool_flush(pool,client->cli_id,1);
+ pool_flush(pool, client->cli_id);
return 1;
}
@@ -2775,7 +2769,7 @@ void tmem_destroy(void *v)
printk("tmem: flushing tmem pools for %s=%d\n",
tmem_cli_id_str, client->cli_id);
- client_flush(client, 1);
+ client_flush(client);
write_unlock(&tmem_rwlock);
}
--
1.8.5.3
next prev parent reply other threads:[~2014-04-09 13:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 13:26 [PATCH/GIT PULL] Cleanups and bug-fix in tmem for v4.5 (v2.1) Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 01/15] tmem: refactor function do_tmem_op() Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 02/15] tmem: remove pageshift from struct tmem_pool Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 03/15] tmem: cleanup: drop unneeded client/pool initialization Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 04/15] tmem: bugfix in obj allocate path Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 05/15] tmem: cleanup: remove unneed parameter from pgp_delist() Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 06/15] tmem: cleanup: remove unneed parameter from pgp_free() Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 07/15] tmem: cleanup the pgp free path Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 08/15] tmem: drop oneline function client_freeze() Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 09/15] tmem: cleanup: drop global_pool_list Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 10/15] tmem: fix the return value of tmemc_set_var() Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 11/15] tmem: remove unneeded parameters from obj destroy path Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 12/15] tmem: cleanup: refactor function tmemc_shared_pool_auth() Konrad Rzeszutek Wilk
2014-04-09 13:26 ` [PATCH v2.1 13/15] tmem: reorg the shared pool allocate path Konrad Rzeszutek Wilk
2014-04-09 13:26 ` Konrad Rzeszutek Wilk [this message]
2014-04-09 13:26 ` [PATCH v2.1 15/15] xen: tmem: tmem_try_to_evict_pgp: fix a lock issue Konrad Rzeszutek Wilk
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=1397049979-3479-15-git-send-email-konrad.wilk@oracle.com \
--to=konrad.wilk@oracle.com \
--cc=jbeulich@suse.com \
--cc=lliubbo@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/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;
as well as URLs for NNTP newsgroup(s).