summaryrefslogtreecommitdiffstats
path: root/lib/libzpool
diff options
context:
space:
mode:
authorMichael Kjorling <[email protected]>2013-11-01 20:26:11 +0100
committerBrian Behlendorf <[email protected]>2013-12-18 16:46:35 -0800
commitd1d7e2689db9e03f11c069ebc9f1ba12829e5dac (patch)
tree75b9a2b23334d5f673fb31f142f74146d351865c /lib/libzpool
parent8ffef572ed2ba97e0c2d6a8aa2240012e611dc6f (diff)
cstyle: Resolve C style issues
The vast majority of these changes are in Linux specific code. They are the result of not having an automated style checker to validate the code when it was originally written. Others were caused when the common code was slightly adjusted for Linux. This patch contains no functional changes. It only refreshes the code to conform to style guide. Everyone submitting patches for inclusion upstream should now run 'make checkstyle' and resolve any warning prior to opening a pull request. The automated builders have been updated to fail a build if when 'make checkstyle' detects an issue. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1821
Diffstat (limited to 'lib/libzpool')
-rw-r--r--lib/libzpool/kernel.c18
-rw-r--r--lib/libzpool/taskq.c5
2 files changed, 12 insertions, 11 deletions
diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c
index f994f8ee3..05bbd06cc 100644
--- a/lib/libzpool/kernel.c
+++ b/lib/libzpool/kernel.c
@@ -74,7 +74,7 @@ thread_init(void)
VERIFY3S(pthread_key_create(&kthread_key, NULL), ==, 0);
/* Create entry for primary kthread */
- kt = umem_zalloc(sizeof(kthread_t), UMEM_NOFAIL);
+ kt = umem_zalloc(sizeof (kthread_t), UMEM_NOFAIL);
kt->t_tid = pthread_self();
kt->t_func = NULL;
@@ -93,7 +93,7 @@ thread_fini(void)
ASSERT(pthread_equal(kt->t_tid, pthread_self()));
ASSERT3P(kt->t_func, ==, NULL);
- umem_free(kt, sizeof(kthread_t));
+ umem_free(kt, sizeof (kthread_t));
/* Wait for all threads to exit via thread_exit() */
VERIFY3S(pthread_mutex_lock(&kthread_lock), ==, 0);
@@ -117,7 +117,7 @@ zk_thread_current(void)
ASSERT3P(kt, !=, NULL);
- return kt;
+ return (kt);
}
void *
@@ -137,12 +137,12 @@ zk_thread_helper(void *arg)
/* Unreachable, thread must exit with thread_exit() */
abort();
- return NULL;
+ return (NULL);
}
kthread_t *
zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg,
- size_t len, proc_t *pp, int state, pri_t pri, int detachstate)
+ size_t len, proc_t *pp, int state, pri_t pri, int detachstate)
{
kthread_t *kt;
pthread_attr_t attr;
@@ -150,7 +150,7 @@ zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg,
ASSERT3S(state & ~TS_RUN, ==, 0);
- kt = umem_zalloc(sizeof(kthread_t), UMEM_NOFAIL);
+ kt = umem_zalloc(sizeof (kthread_t), UMEM_NOFAIL);
kt->t_func = func;
kt->t_arg = arg;
@@ -188,7 +188,7 @@ zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg,
VERIFY3S(pthread_attr_destroy(&attr), ==, 0);
- return kt;
+ return (kt);
}
void
@@ -198,7 +198,7 @@ zk_thread_exit(void)
ASSERT(pthread_equal(kt->t_tid, pthread_self()));
- umem_free(kt, sizeof(kthread_t));
+ umem_free(kt, sizeof (kthread_t));
pthread_mutex_lock(&kthread_lock);
kthread_nr--;
@@ -737,7 +737,7 @@ vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset,
* (memory or disk) due to O_DIRECT, so we abort() in order to
* catch the offender.
*/
- abort();
+ abort();
}
#endif
if (rc == -1)
diff --git a/lib/libzpool/taskq.c b/lib/libzpool/taskq.c
index 96c0d5c2b..72807f6a3 100644
--- a/lib/libzpool/taskq.c
+++ b/lib/libzpool/taskq.c
@@ -157,7 +157,7 @@ taskq_dispatch_delay(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags,
int
taskq_empty_ent(taskq_ent_t *t)
{
- return t->tqent_next == NULL;
+ return (t->tqent_next == NULL);
}
void
@@ -287,7 +287,8 @@ taskq_create(const char *name, int nthreads, pri_t pri,
tq->tq_maxalloc = maxalloc;
tq->tq_task.tqent_next = &tq->tq_task;
tq->tq_task.tqent_prev = &tq->tq_task;
- tq->tq_threadlist = kmem_alloc(nthreads*sizeof(kthread_t *), KM_SLEEP);
+ tq->tq_threadlist = kmem_alloc(nthreads * sizeof (kthread_t *),
+ KM_SLEEP);
if (flags & TASKQ_PREPOPULATE) {
mutex_enter(&tq->tq_lock);