* GPL HEADER END
*/
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Author: liang@whamcloud.com
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
#define DEBUG_SUBSYSTEM S_LNET
#include <libcfs/libcfs.h>
cfs_percpt_lock_alloc(struct cfs_cpt_table *cptab)
{
struct cfs_percpt_lock *pcl;
- cfs_spinlock_t *lock;
+ spinlock_t *lock;
int i;
/* NB: cptab can be NULL, pcl will be for HW CPUs on that case */
}
cfs_percpt_for_each(lock, i, pcl->pcl_locks)
- cfs_spin_lock_init(lock);
+ spin_lock_init(lock);
return pcl;
}
}
if (likely(index != CFS_PERCPT_LOCK_EX)) {
- cfs_spin_lock(pcl->pcl_locks[index]);
+ spin_lock(pcl->pcl_locks[index]);
return;
}
/* exclusive lock request */
for (i = 0; i < ncpt; i++) {
- cfs_spin_lock(pcl->pcl_locks[i]);
+ spin_lock(pcl->pcl_locks[i]);
if (i == 0) {
LASSERT(!pcl->pcl_locked);
/* nobody should take private lock after this
index = ncpt == 1 ? 0 : index;
if (likely(index != CFS_PERCPT_LOCK_EX)) {
- cfs_spin_unlock(pcl->pcl_locks[index]);
+ spin_unlock(pcl->pcl_locks[index]);
return;
}
LASSERT(pcl->pcl_locked);
pcl->pcl_locked = 0;
}
- cfs_spin_unlock(pcl->pcl_locks[i]);
+ spin_unlock(pcl->pcl_locks[i]);
}
}
CFS_EXPORT_SYMBOL(cfs_percpt_unlock);
struct cfs_percpt_lock *
cfs_percpt_lock_alloc(struct cfs_cpt_table *cptab)
{
- return (struct cfs_percpt_lock *)CFS_PERCPT_LOCK_MAGIC;
+ return ((struct cfs_percpt_lock *) &CFS_PERCPT_LOCK_MAGIC);
}
void
cfs_percpt_lock_free(struct cfs_percpt_lock *pcl)
{
- LASSERT(pcl == (struct cfs_percpt_lock *)CFS_PERCPT_LOCK_MAGIC);
+ LASSERT(pcl == (struct cfs_percpt_lock *) &CFS_PERCPT_LOCK_MAGIC);
}
void
cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
{
- LASSERT(pcl == (struct cfs_percpt_lock *)CFS_PERCPT_LOCK_MAGIC);
+ LASSERT(pcl == (struct cfs_percpt_lock *) &CFS_PERCPT_LOCK_MAGIC);
}
void
cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index)
{
- LASSERT(pcl == (struct cfs_percpt_lock *)CFS_PERCPT_LOCK_MAGIC);
+ LASSERT(pcl == (struct cfs_percpt_lock *) &CFS_PERCPT_LOCK_MAGIC);
}
# endif /* HAVE_LIBPTHREAD */