]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/lustre/lustre/libcfs/hash.c
staging: lustre: Remove typedef and update cfs_hash_bucket struct
[~andy/linux] / drivers / staging / lustre / lustre / libcfs / hash.c
index 0dd12c8c91b6126c0c790ef8932e033dcdc0d468..c3cb1c0b04d5787fabeaf49a61ec5299cde8ae9f 100644 (file)
@@ -119,25 +119,25 @@ CFS_MODULE_PARM(warn_on_depth, "i", uint, 0644,
 struct cfs_wi_sched *cfs_sched_rehash;
 
 static inline void
-cfs_hash_nl_lock(cfs_hash_lock_t *lock, int exclusive) {}
+cfs_hash_nl_lock(union cfs_hash_lock *lock, int exclusive) {}
 
 static inline void
-cfs_hash_nl_unlock(cfs_hash_lock_t *lock, int exclusive) {}
+cfs_hash_nl_unlock(union cfs_hash_lock *lock, int exclusive) {}
 
 static inline void
-cfs_hash_spin_lock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_spin_lock(union cfs_hash_lock *lock, int exclusive)
 {
        spin_lock(&lock->spin);
 }
 
 static inline void
-cfs_hash_spin_unlock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_spin_unlock(union cfs_hash_lock *lock, int exclusive)
 {
        spin_unlock(&lock->spin);
 }
 
 static inline void
-cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
 {
        if (!exclusive)
                read_lock(&lock->rw);
@@ -146,7 +146,7 @@ cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
 }
 
 static inline void
-cfs_hash_rw_unlock(cfs_hash_lock_t *lock, int exclusive)
+cfs_hash_rw_unlock(union cfs_hash_lock *lock, int exclusive)
 {
        if (!exclusive)
                read_unlock(&lock->rw);
@@ -469,7 +469,7 @@ cfs_hash_hlist_setup(cfs_hash_t *hs)
 }
 
 static void
-cfs_hash_bd_from_key(cfs_hash_t *hs, cfs_hash_bucket_t **bkts,
+cfs_hash_bd_from_key(cfs_hash_t *hs, struct cfs_hash_bucket **bkts,
                     unsigned int bits, const void *key, cfs_hash_bd_t *bd)
 {
        unsigned int index = cfs_hash_id(hs, key, (1U << bits) - 1);
@@ -563,8 +563,8 @@ void
 cfs_hash_bd_move_locked(cfs_hash_t *hs, cfs_hash_bd_t *bd_old,
                        cfs_hash_bd_t *bd_new, struct hlist_node *hnode)
 {
-       cfs_hash_bucket_t *obkt = bd_old->bd_bucket;
-       cfs_hash_bucket_t *nbkt = bd_new->bd_bucket;
+       struct cfs_hash_bucket *obkt = bd_old->bd_bucket;
+       struct cfs_hash_bucket *nbkt = bd_new->bd_bucket;
        int             rc;
 
        if (cfs_hash_bd_compare(bd_old, bd_new) == 0)
@@ -698,7 +698,7 @@ static void
 cfs_hash_multi_bd_lock(cfs_hash_t *hs, cfs_hash_bd_t *bds,
                       unsigned n, int excl)
 {
-       cfs_hash_bucket_t *prev = NULL;
+       struct cfs_hash_bucket *prev = NULL;
        int             i;
 
        /**
@@ -721,7 +721,7 @@ static void
 cfs_hash_multi_bd_unlock(cfs_hash_t *hs, cfs_hash_bd_t *bds,
                         unsigned n, int excl)
 {
-       cfs_hash_bucket_t *prev = NULL;
+       struct cfs_hash_bucket *prev = NULL;
        int             i;
 
        cfs_hash_for_each_bd(bds, n, i) {
@@ -884,7 +884,7 @@ cfs_hash_dual_bd_finddel_locked(cfs_hash_t *hs, cfs_hash_bd_t *bds,
 EXPORT_SYMBOL(cfs_hash_dual_bd_finddel_locked);
 
 static void
-cfs_hash_buckets_free(cfs_hash_bucket_t **buckets,
+cfs_hash_buckets_free(struct cfs_hash_bucket **buckets,
                      int bkt_size, int prev_size, int size)
 {
        int     i;
@@ -902,11 +902,11 @@ cfs_hash_buckets_free(cfs_hash_bucket_t **buckets,
  * needed, the newly allocated buckets if allocation was needed and
  * successful, and NULL on error.
  */
-static cfs_hash_bucket_t **
-cfs_hash_buckets_realloc(cfs_hash_t *hs, cfs_hash_bucket_t **old_bkts,
+static struct cfs_hash_bucket **
+cfs_hash_buckets_realloc(cfs_hash_t *hs, struct cfs_hash_bucket **old_bkts,
                         unsigned int old_size, unsigned int new_size)
 {
-       cfs_hash_bucket_t **new_bkts;
+       struct cfs_hash_bucket **new_bkts;
        int              i;
 
        LASSERT(old_size == 0 || old_bkts != NULL);
@@ -1874,7 +1874,7 @@ static int
 cfs_hash_rehash_worker(cfs_workitem_t *wi)
 {
        cfs_hash_t       *hs = container_of(wi, cfs_hash_t, hs_rehash_wi);
-       cfs_hash_bucket_t **bkts;
+       struct cfs_hash_bucket **bkts;
        cfs_hash_bd_t       bd;
        unsigned int    old_size;
        unsigned int    new_size;
@@ -1965,7 +1965,7 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi)
        if (bkts != NULL)
                cfs_hash_buckets_free(bkts, bsize, new_size, old_size);
        if (rc != 0)
-               CDEBUG(D_INFO, "early quit of of rehashing: %d\n", rc);
+               CDEBUG(D_INFO, "early quit of rehashing: %d\n", rc);
        /* return 1 only if cfs_wi_exit is called */
        return rc == -ESRCH;
 }
@@ -2028,7 +2028,7 @@ int cfs_hash_debug_header(struct seq_file *m)
 }
 EXPORT_SYMBOL(cfs_hash_debug_header);
 
-static cfs_hash_bucket_t **
+static struct cfs_hash_bucket **
 cfs_hash_full_bkts(cfs_hash_t *hs)
 {
        /* NB: caller should hold hs->hs_rwlock if REHASH is set */