Fix cstyle issues in spl-tsd.c

This patch only addresses the issues identified by the style checker
in spl-tsd.c.  It contains no functional changes.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf 2015-04-24 14:22:27 -07:00
parent 3d39d0afab
commit 62e2eb2329

View File

@ -1,4 +1,4 @@
/*****************************************************************************\
/*
* Copyright (C) 2010 Lawrence Livermore National Security, LLC.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Brian Behlendorf <behlendorf1@llnl.gov>.
@ -19,7 +19,8 @@
*
* You should have received a copy of the GNU General Public License along
* with the SPL. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************
*
*
* Solaris Porting Layer (SPL) Thread Specific Data Implementation.
*
* Thread specific data has implemented using a hash table, this avoids
@ -56,7 +57,7 @@
* so if your using the Solaris thread API you should not need to call
* tsd_exit() directly.
*
\*****************************************************************************/
*/
#include <sys/kmem.h>
#include <sys/thread.h>
@ -136,7 +137,7 @@ tsd_hash_dtor(struct hlist_head *work)
if (entry->he_dtor && entry->he_pid != DTOR_PID)
entry->he_dtor(entry->he_value);
kmem_free(entry, sizeof(tsd_hash_entry_t));
kmem_free(entry, sizeof (tsd_hash_entry_t));
}
}
@ -163,7 +164,7 @@ tsd_hash_add(tsd_hash_table_t *table, uint_t key, pid_t pid, void *value)
ASSERT3P(tsd_hash_search(table, key, pid), ==, NULL);
/* New entry allocate structure, set value, and add to hash */
entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE);
entry = kmem_alloc(sizeof (tsd_hash_entry_t), KM_PUSHPAGE);
if (entry == NULL)
return (ENOMEM);
@ -222,7 +223,7 @@ tsd_hash_add_key(tsd_hash_table_t *table, uint_t *keyp, dtor_func_t dtor)
ASSERT3P(table, !=, NULL);
/* Allocate entry to be used as a destructor for this key */
entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE);
entry = kmem_alloc(sizeof (tsd_hash_entry_t), KM_PUSHPAGE);
if (entry == NULL)
return (ENOMEM);
@ -280,7 +281,7 @@ tsd_hash_add_pid(tsd_hash_table_t *table, pid_t pid)
ulong_t hash;
/* Allocate entry to be used as the process reference */
entry = kmem_alloc(sizeof(tsd_hash_entry_t), KM_PUSHPAGE);
entry = kmem_alloc(sizeof (tsd_hash_entry_t), KM_PUSHPAGE);
if (entry == NULL)
return (ENOMEM);
@ -333,13 +334,13 @@ tsd_hash_table_init(uint_t bits)
tsd_hash_table_t *table;
int hash, size = (1 << bits);
table = kmem_zalloc(sizeof(tsd_hash_table_t), KM_SLEEP);
table = kmem_zalloc(sizeof (tsd_hash_table_t), KM_SLEEP);
if (table == NULL)
return (NULL);
table->ht_bins = kmem_zalloc(sizeof(tsd_hash_bin_t) * size, KM_SLEEP);
table->ht_bins = kmem_zalloc(sizeof (tsd_hash_bin_t) * size, KM_SLEEP);
if (table->ht_bins == NULL) {
kmem_free(table, sizeof(tsd_hash_table_t));
kmem_free(table, sizeof (tsd_hash_table_t));
return (NULL);
}
@ -387,8 +388,8 @@ tsd_hash_table_fini(tsd_hash_table_t *table)
spin_unlock(&table->ht_lock);
tsd_hash_dtor(&work);
kmem_free(table->ht_bins, sizeof(tsd_hash_bin_t)*(1<<table->ht_bits));
kmem_free(table, sizeof(tsd_hash_table_t));
kmem_free(table->ht_bins, sizeof (tsd_hash_bin_t)*(1<<table->ht_bits));
kmem_free(table, sizeof (tsd_hash_table_t));
}
/*
@ -545,7 +546,7 @@ tsd_create(uint_t *keyp, dtor_func_t dtor)
if (*keyp)
return;
(void)tsd_hash_add_key(tsd_hash_table, keyp, dtor);
(void) tsd_hash_add_key(tsd_hash_table, keyp, dtor);
}
EXPORT_SYMBOL(tsd_create);