atomic_dec(&pool->pgp_count);
ASSERT(_atomic_read(pool->pgp_count) >= 0);
pgp->size = -1;
- if ( is_persistent(pool) && pool->client->live_migrating )
+ if ( is_persistent(pool) && pool->client->info.flags.u.migrating )
{
pgp->inv_oid = pgp->us.obj->oid;
pgp->pool_id = pool->pool_id;
}
else
{
- if ( client->live_migrating )
+ if ( client->info.flags.u.migrating )
{
spin_lock(&pers_lists_spinlock);
list_add_tail(&pgp->client_inv_pages,
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 )
+ if ( pool->client->info.flags.u.migrating )
{
tmem_client_warn("can't destroy pool while %s is live-migrating\n",
tmem_client_str);
rcu_unlock_domain(d);
client->cli_id = cli_id;
- client->compress = tmem_compression_enabled();
+ client->info.flags.u.compress = tmem_compression_enabled();
client->shared_auth_required = tmem_shared_auth();
for ( i = 0; i < MAX_GLOBAL_SHARED_POOLS; i++)
client->shared_auth_uuid[i][0] =
int total = _atomic_read(tmem_global.client_weight_total);
ASSERT(client != NULL);
- if ( (total == 0) || (client->weight == 0) ||
+ if ( (total == 0) || (client->info.weight == 0) ||
(client->eph_count == 0) )
return 0;
return ( ((tmem_global.eph_count*100L) / client->eph_count ) >
- ((total*100L) / client->weight) );
+ ((total*100L) / client->info.weight) );
}
/************ MEMORY REVOCATION ROUTINES *******************************/
pool = obj->pool;
ASSERT(pool != NULL);
client = pool->client;
- if ( client->live_migrating )
+ if ( client->info.flags.u.migrating )
goto failed_dup; /* No dups allowed when migrating. */
/* Can we successfully manipulate pgp to change out the data? */
- if ( client->compress && pgp->size != 0 )
+ if ( client->info.flags.u.compress && pgp->size != 0 )
{
ret = do_tmem_put_compress(pgp, cmfn, clibuf);
if ( ret == 1 )
ASSERT(pool != NULL);
client = pool->client;
ASSERT(client != NULL);
- ret = client->frozen ? -EFROZEN : -ENOMEM;
+ ret = client->info.flags.u.frozen ? -EFROZEN : -ENOMEM;
pool->puts++;
refind:
else
{
/* No puts allowed into a frozen pool (except dup puts). */
- if ( client->frozen )
+ if ( client->info.flags.u.frozen )
goto unlock_obj;
}
}
else
{
/* No puts allowed into a frozen pool (except dup puts). */
- if ( client->frozen )
+ if ( client->info.flags.u.frozen )
return ret;
if ( (obj = obj_alloc(pool, oidp)) == NULL )
return -ENOMEM;
pgp->index = index;
pgp->size = 0;
- if ( client->compress )
+ if ( client->info.flags.u.compress )
{
ASSERT(pgp->pfp == NULL);
ret = do_tmem_put_compress(pgp, cmfn, clibuf);
pool->flushs_found++;
out:
- if ( pool->client->frozen )
+ if ( pool->client->info.flags.u.frozen )
return -EFROZEN;
else
return 1;
write_unlock(&pool->pool_rwlock);
out:
- if ( pool->client->frozen )
+ if ( pool->client->info.flags.u.frozen )
return -EFROZEN;
else
return 1;
rc = 0;
break;
}
- client->was_frozen = client->frozen;
- client->frozen = 1;
+ client->was_frozen = client->info.flags.u.frozen;
+ client->info.flags.u.frozen = 1;
if ( arg1 != 0 )
- client->live_migrating = 1;
+ client->info.flags.u.migrating = 1;
rc = 1;
break;
case XEN_SYSCTL_TMEM_OP_RESTORE_BEGIN:
case XEN_SYSCTL_TMEM_OP_SAVE_END:
if ( client == NULL )
break;
- client->live_migrating = 0;
+ client->info.flags.u.migrating = 0;
if ( !list_empty(&client->persistent_invalidated_list) )
list_for_each_entry_safe(pgp,pgp2,
&client->persistent_invalidated_list, client_inv_pages)
__pgp_free(pgp, client->pools[pgp->pool_id]);
- client->frozen = client->was_frozen;
+ client->info.flags.u.frozen = client->was_frozen;
rc = 0;
break;
}
if ( cli_id == TMEM_CLI_ID_NULL )
{
list_for_each_entry(client,&tmem_global.client_list,client_list)
- client->frozen = freeze;
+ client->info.flags.u.frozen = freeze;
tmem_client_info("tmem: all pools %s for all %ss\n", s, tmem_client_str);
}
else
{
if ( (client = tmem_client_from_cli_id(cli_id)) == NULL)
return -1;
- client->frozen = freeze;
+ client->info.flags.u.frozen = freeze;
tmem_client_info("tmem: all pools %s for %s=%d\n",
s, tmem_cli_id_str, cli_id);
}
n = scnprintf(info,BSIZE,"C=CI:%d,ww:%d,co:%d,fr:%d,"
"Tc:%"PRIu64",Ge:%ld,Pp:%ld,Gp:%ld%c",
- c->cli_id, c->weight, c->compress, c->frozen,
+ c->cli_id, c->info.weight, c->info.flags.u.compress, c->info.flags.u.frozen,
c->total_cycles, c->succ_eph_gets, c->succ_pers_puts, c->succ_pers_gets,
use_long ? ',' : '\n');
if (use_long)
switch (subop)
{
case XEN_SYSCTL_TMEM_OP_SET_WEIGHT:
- old_weight = client->weight;
- client->weight = arg1;
+ old_weight = client->info.weight;
+ client->info.weight = arg1;
tmem_client_info("tmem: weight set to %d for %s=%d\n",
arg1, tmem_cli_id_str, cli_id);
atomic_sub(old_weight,&tmem_global.client_weight_total);
- atomic_add(client->weight,&tmem_global.client_weight_total);
+ atomic_add(client->info.weight,&tmem_global.client_weight_total);
break;
case XEN_SYSCTL_TMEM_OP_SET_COMPRESS:
- client->compress = arg1 ? 1 : 0;
+ client->info.flags.u.compress = arg1 ? 1 : 0;
tmem_client_info("tmem: compression %s for %s=%d\n",
arg1 ? "enabled" : "disabled",tmem_cli_id_str,cli_id);
break;
case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_WEIGHT:
if ( client == NULL )
break;
- rc = client->weight == -1 ? -2 : client->weight;
+ rc = client->info.weight == -1 ? -2 : client->info.weight;
break;
case XEN_SYSCTL_TMEM_OP_SAVE_GET_CLIENT_FLAGS:
if ( client == NULL )
break;
- rc = (client->compress ? TMEM_CLIENT_COMPRESS : 0 ) |
+ rc = (client->info.flags.u.compress ? TMEM_CLIENT_COMPRESS : 0 ) |
(client->was_frozen ? TMEM_CLIENT_FROZEN : 0 );
break;
case XEN_SYSCTL_TMEM_OP_SAVE_GET_POOL_FLAGS: