Commit 29323b3e authored by Lisa Nguyen's avatar Lisa Nguyen Committed by Greg Kroah-Hartman

staging: lustre: Remove typedef and update cfs_hash_lock union

Remove typedef keyword and rename the cfs_hash_lock_t
union to cfs_hash_lock in libcfs_hash.h. These changes
resolve the "Do not add new typedefs" warning
generated by checkpatch.pl and meet kernel coding style.

The union variables in hash.c are updated to reflect this
change as well.
Signed-off-by: default avatarLisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bcc3b704
...@@ -81,10 +81,10 @@ struct cfs_hash_ops; ...@@ -81,10 +81,10 @@ struct cfs_hash_ops;
struct cfs_hash_lock_ops; struct cfs_hash_lock_ops;
struct cfs_hash_hlist_ops; struct cfs_hash_hlist_ops;
typedef union { union cfs_hash_lock {
rwlock_t rw; /**< rwlock */ rwlock_t rw; /**< rwlock */
spinlock_t spin; /**< spinlock */ spinlock_t spin; /**< spinlock */
} cfs_hash_lock_t; };
/** /**
* cfs_hash_bucket is a container of: * cfs_hash_bucket is a container of:
...@@ -98,7 +98,7 @@ typedef union { ...@@ -98,7 +98,7 @@ typedef union {
* - some extra bytes (caller can require it while creating hash) * - some extra bytes (caller can require it while creating hash)
*/ */
typedef struct cfs_hash_bucket { typedef struct cfs_hash_bucket {
cfs_hash_lock_t hsb_lock; /**< bucket lock */ union cfs_hash_lock hsb_lock; /**< bucket lock */
__u32 hsb_count; /**< current entries */ __u32 hsb_count; /**< current entries */
__u32 hsb_version; /**< change version */ __u32 hsb_version; /**< change version */
unsigned int hsb_index; /**< index of bucket */ unsigned int hsb_index; /**< index of bucket */
...@@ -213,7 +213,7 @@ enum cfs_hash_tag { ...@@ -213,7 +213,7 @@ enum cfs_hash_tag {
typedef struct cfs_hash { typedef struct cfs_hash {
/** serialize with rehash, or serialize all operations if /** serialize with rehash, or serialize all operations if
* the hash-table has CFS_HASH_NO_BKTLOCK */ * the hash-table has CFS_HASH_NO_BKTLOCK */
cfs_hash_lock_t hs_lock; union cfs_hash_lock hs_lock;
/** hash operations */ /** hash operations */
struct cfs_hash_ops *hs_ops; struct cfs_hash_ops *hs_ops;
/** hash lock operations */ /** hash lock operations */
...@@ -276,13 +276,13 @@ typedef struct cfs_hash { ...@@ -276,13 +276,13 @@ typedef struct cfs_hash {
typedef struct cfs_hash_lock_ops { typedef struct cfs_hash_lock_ops {
/** lock the hash table */ /** lock the hash table */
void (*hs_lock)(cfs_hash_lock_t *lock, int exclusive); void (*hs_lock)(union cfs_hash_lock *lock, int exclusive);
/** unlock the hash table */ /** unlock the hash table */
void (*hs_unlock)(cfs_hash_lock_t *lock, int exclusive); void (*hs_unlock)(union cfs_hash_lock *lock, int exclusive);
/** lock the hash bucket */ /** lock the hash bucket */
void (*hs_bkt_lock)(cfs_hash_lock_t *lock, int exclusive); void (*hs_bkt_lock)(union cfs_hash_lock *lock, int exclusive);
/** unlock the hash bucket */ /** unlock the hash bucket */
void (*hs_bkt_unlock)(cfs_hash_lock_t *lock, int exclusive); void (*hs_bkt_unlock)(union cfs_hash_lock *lock, int exclusive);
} cfs_hash_lock_ops_t; } cfs_hash_lock_ops_t;
typedef struct cfs_hash_hlist_ops { typedef struct cfs_hash_hlist_ops {
......
...@@ -119,25 +119,25 @@ CFS_MODULE_PARM(warn_on_depth, "i", uint, 0644, ...@@ -119,25 +119,25 @@ CFS_MODULE_PARM(warn_on_depth, "i", uint, 0644,
struct cfs_wi_sched *cfs_sched_rehash; struct cfs_wi_sched *cfs_sched_rehash;
static inline void 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 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 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); spin_lock(&lock->spin);
} }
static inline void 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); spin_unlock(&lock->spin);
} }
static inline void 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) if (!exclusive)
read_lock(&lock->rw); read_lock(&lock->rw);
...@@ -146,7 +146,7 @@ cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive) ...@@ -146,7 +146,7 @@ cfs_hash_rw_lock(cfs_hash_lock_t *lock, int exclusive)
} }
static inline void 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) if (!exclusive)
read_unlock(&lock->rw); read_unlock(&lock->rw);
......
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