Commit b2f005f7 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: remove white space in hash.c

Cleanup all the unneeded white space in hash.c.
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 12550e0c
...@@ -665,7 +665,8 @@ cfs_hash_bd_lookup_intent(struct cfs_hash *hs, struct cfs_hash_bd *bd, ...@@ -665,7 +665,8 @@ cfs_hash_bd_lookup_intent(struct cfs_hash *hs, struct cfs_hash_bd *bd,
} }
struct hlist_node * struct hlist_node *
cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const void *key) cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
const void *key)
{ {
return cfs_hash_bd_lookup_intent(hs, bd, key, NULL, return cfs_hash_bd_lookup_intent(hs, bd, key, NULL,
CFS_HS_LOOKUP_IT_FIND); CFS_HS_LOOKUP_IT_FIND);
...@@ -673,7 +674,8 @@ cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const voi ...@@ -673,7 +674,8 @@ cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const voi
EXPORT_SYMBOL(cfs_hash_bd_lookup_locked); EXPORT_SYMBOL(cfs_hash_bd_lookup_locked);
struct hlist_node * struct hlist_node *
cfs_hash_bd_peek_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const void *key) cfs_hash_bd_peek_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
const void *key)
{ {
return cfs_hash_bd_lookup_intent(hs, bd, key, NULL, return cfs_hash_bd_lookup_intent(hs, bd, key, NULL,
CFS_HS_LOOKUP_IT_PEEK); CFS_HS_LOOKUP_IT_PEEK);
...@@ -756,8 +758,8 @@ cfs_hash_multi_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, ...@@ -756,8 +758,8 @@ cfs_hash_multi_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds,
} }
static struct hlist_node * static struct hlist_node *
cfs_hash_multi_bd_findadd_locked(struct cfs_hash *hs, cfs_hash_multi_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds,
struct cfs_hash_bd *bds, unsigned n, const void *key, unsigned n, const void *key,
struct hlist_node *hnode, int noref) struct hlist_node *hnode, int noref)
{ {
struct hlist_node *ehnode; struct hlist_node *ehnode;
...@@ -792,7 +794,7 @@ cfs_hash_multi_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, ...@@ -792,7 +794,7 @@ cfs_hash_multi_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds,
struct hlist_node *hnode) struct hlist_node *hnode)
{ {
struct hlist_node *ehnode; struct hlist_node *ehnode;
unsigned i; unsigned int i;
cfs_hash_for_each_bd(bds, n, i) { cfs_hash_for_each_bd(bds, n, i) {
ehnode = cfs_hash_bd_lookup_intent(hs, &bds[i], key, hnode, ehnode = cfs_hash_bd_lookup_intent(hs, &bds[i], key, hnode,
...@@ -831,7 +833,8 @@ cfs_hash_bd_order(struct cfs_hash_bd *bd1, struct cfs_hash_bd *bd2) ...@@ -831,7 +833,8 @@ cfs_hash_bd_order(struct cfs_hash_bd *bd1, struct cfs_hash_bd *bd2)
} }
void void
cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key, struct cfs_hash_bd *bds) cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key,
struct cfs_hash_bd *bds)
{ {
/* NB: caller should hold hs_lock.rw if REHASH is set */ /* NB: caller should hold hs_lock.rw if REHASH is set */
cfs_hash_bd_from_key(hs, hs->hs_buckets, cfs_hash_bd_from_key(hs, hs->hs_buckets,
...@@ -1276,7 +1279,8 @@ cfs_hash_find_or_add(struct cfs_hash *hs, const void *key, ...@@ -1276,7 +1279,8 @@ cfs_hash_find_or_add(struct cfs_hash *hs, const void *key,
* Returns 0 on success or -EALREADY on key collisions. * Returns 0 on success or -EALREADY on key collisions.
*/ */
int int
cfs_hash_add_unique(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) cfs_hash_add_unique(struct cfs_hash *hs, const void *key,
struct hlist_node *hnode)
{ {
return cfs_hash_find_or_add(hs, key, hnode, 1) != hnode ? return cfs_hash_find_or_add(hs, key, hnode, 1) != hnode ?
-EALREADY : 0; -EALREADY : 0;
...@@ -1383,7 +1387,8 @@ cfs_hash_lookup(struct cfs_hash *hs, const void *key) ...@@ -1383,7 +1387,8 @@ cfs_hash_lookup(struct cfs_hash *hs, const void *key)
EXPORT_SYMBOL(cfs_hash_lookup); EXPORT_SYMBOL(cfs_hash_lookup);
static void static void
cfs_hash_for_each_enter(struct cfs_hash *hs) { cfs_hash_for_each_enter(struct cfs_hash *hs)
{
LASSERT(!cfs_hash_is_exiting(hs)); LASSERT(!cfs_hash_is_exiting(hs));
if (!cfs_hash_with_rehash(hs)) if (!cfs_hash_with_rehash(hs))
...@@ -1408,7 +1413,8 @@ cfs_hash_for_each_enter(struct cfs_hash *hs) { ...@@ -1408,7 +1413,8 @@ cfs_hash_for_each_enter(struct cfs_hash *hs) {
} }
static void static void
cfs_hash_for_each_exit(struct cfs_hash *hs) { cfs_hash_for_each_exit(struct cfs_hash *hs)
{
int remained; int remained;
int bits; int bits;
...@@ -1439,7 +1445,8 @@ cfs_hash_for_each_exit(struct cfs_hash *hs) { ...@@ -1439,7 +1445,8 @@ cfs_hash_for_each_exit(struct cfs_hash *hs) {
*/ */
static __u64 static __u64
cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
void *data, int remove_safe) { void *data, int remove_safe)
{
struct hlist_node *hnode; struct hlist_node *hnode;
struct hlist_node *pos; struct hlist_node *pos;
struct cfs_hash_bd bd; struct cfs_hash_bd bd;
...@@ -1523,16 +1530,17 @@ cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data) ...@@ -1523,16 +1530,17 @@ cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data)
EXPORT_SYMBOL(cfs_hash_cond_del); EXPORT_SYMBOL(cfs_hash_cond_del);
void void
cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
cfs_hash_for_each_cb_t func, void *data) void *data)
{ {
cfs_hash_for_each_tight(hs, func, data, 0); cfs_hash_for_each_tight(hs, func, data, 0);
} }
EXPORT_SYMBOL(cfs_hash_for_each); EXPORT_SYMBOL(cfs_hash_for_each);
void void
cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
cfs_hash_for_each_cb_t func, void *data) { void *data)
{
cfs_hash_for_each_tight(hs, func, data, 1); cfs_hash_for_each_tight(hs, func, data, 1);
} }
EXPORT_SYMBOL(cfs_hash_for_each_safe); EXPORT_SYMBOL(cfs_hash_for_each_safe);
...@@ -1581,7 +1589,8 @@ EXPORT_SYMBOL(cfs_hash_size_get); ...@@ -1581,7 +1589,8 @@ EXPORT_SYMBOL(cfs_hash_size_get);
*/ */
static int static int
cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
void *data) { void *data)
{
struct hlist_node *hnode; struct hlist_node *hnode;
struct hlist_node *tmp; struct hlist_node *tmp;
struct cfs_hash_bd bd; struct cfs_hash_bd bd;
...@@ -1645,8 +1654,9 @@ cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, ...@@ -1645,8 +1654,9 @@ cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
} }
int int
cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
cfs_hash_for_each_cb_t func, void *data) { void *data)
{
if (cfs_hash_with_no_lock(hs) || if (cfs_hash_with_no_lock(hs) ||
cfs_hash_with_rehash_key(hs) || cfs_hash_with_rehash_key(hs) ||
!cfs_hash_with_no_itemref(hs)) !cfs_hash_with_no_itemref(hs))
...@@ -1677,8 +1687,9 @@ EXPORT_SYMBOL(cfs_hash_for_each_nolock); ...@@ -1677,8 +1687,9 @@ EXPORT_SYMBOL(cfs_hash_for_each_nolock);
* the required locking is in place to prevent concurrent insertions. * the required locking is in place to prevent concurrent insertions.
*/ */
int int
cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
cfs_hash_for_each_cb_t func, void *data) { void *data)
{
unsigned i = 0; unsigned i = 0;
if (cfs_hash_with_no_lock(hs)) if (cfs_hash_with_no_lock(hs))
...@@ -1721,7 +1732,7 @@ cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned hindex, ...@@ -1721,7 +1732,7 @@ cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned hindex,
break; break;
} }
cfs_hash_bd_unlock(hs, &bd, 0); cfs_hash_bd_unlock(hs, &bd, 0);
out: out:
cfs_hash_unlock(hs, 0); cfs_hash_unlock(hs, 0);
cfs_hash_for_each_exit(hs); cfs_hash_for_each_exit(hs);
} }
...@@ -1736,10 +1747,11 @@ EXPORT_SYMBOL(cfs_hash_hlist_for_each); ...@@ -1736,10 +1747,11 @@ EXPORT_SYMBOL(cfs_hash_hlist_for_each);
*/ */
void void
cfs_hash_for_each_key(struct cfs_hash *hs, const void *key, cfs_hash_for_each_key(struct cfs_hash *hs, const void *key,
cfs_hash_for_each_cb_t func, void *data) { cfs_hash_for_each_cb_t func, void *data)
{
struct hlist_node *hnode; struct hlist_node *hnode;
struct cfs_hash_bd bds[2]; struct cfs_hash_bd bds[2];
unsigned i; unsigned int i;
cfs_hash_lock(hs, 0); cfs_hash_lock(hs, 0);
...@@ -1886,7 +1898,7 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi) ...@@ -1886,7 +1898,7 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi)
int rc = 0; int rc = 0;
int i; int i;
LASSERT (hs != NULL && cfs_hash_with_rehash(hs)); LASSERT(hs != NULL && cfs_hash_with_rehash(hs));
cfs_hash_lock(hs, 0); cfs_hash_lock(hs, 0);
LASSERT(cfs_hash_is_rehashing(hs)); LASSERT(cfs_hash_is_rehashing(hs));
...@@ -1958,7 +1970,7 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi) ...@@ -1958,7 +1970,7 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi)
hs->hs_rehash_buckets = NULL; hs->hs_rehash_buckets = NULL;
hs->hs_cur_bits = hs->hs_rehash_bits; hs->hs_cur_bits = hs->hs_rehash_bits;
out: out:
hs->hs_rehash_bits = 0; hs->hs_rehash_bits = 0;
if (rc == -ESRCH) /* never be scheduled again */ if (rc == -ESRCH) /* never be scheduled again */
cfs_wi_exit(cfs_sched_rehash, wi); cfs_wi_exit(cfs_sched_rehash, wi);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment