aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Simmons <uja.ornl@yahoo.com>2015-10-28 12:54:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-28 19:02:24 -0400
commit6cd3d8505e710a84bf76e28fb79e992b6aa106bd (patch)
tree1bdd0a209ebf9dd83e300ab54d14739ffaf49932
parent7e6094f8ae200b7616e785cf3228f82bc1d51f1f (diff)
staging: lustre: change cfs_hash_head*_t to struct
Change cfs_hash_head_t and cfs_head_head_dep_t from typedef to true structures. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h4
-rw-r--r--drivers/staging/lustre/lustre/libcfs/hash.c33
2 files changed, 21 insertions, 16 deletions
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
index 805f2981b08b..c9f550e0f556 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
@@ -88,8 +88,8 @@ union cfs_hash_lock {
88 * cfs_hash_bucket is a container of: 88 * cfs_hash_bucket is a container of:
89 * - lock, counter ... 89 * - lock, counter ...
90 * - array of hash-head starting from hsb_head[0], hash-head can be one of 90 * - array of hash-head starting from hsb_head[0], hash-head can be one of
91 * . cfs_hash_head_t 91 * . struct cfs_hash_head
92 * . cfs_hash_head_dep_t 92 * . struct cfs_hash_head_dep
93 * . struct cfs_hash_dhead 93 * . struct cfs_hash_dhead
94 * . struct cfs_hash_dhead_dep 94 * . struct cfs_hash_dhead_dep
95 * which depends on requirement of user 95 * which depends on requirement of user
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c
index 575e8a8d533a..c267f8ae82e2 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -239,21 +239,22 @@ cfs_hash_lock_setup(struct cfs_hash *hs)
239 * Simple hash head without depth tracking 239 * Simple hash head without depth tracking
240 * new element is always added to head of hlist 240 * new element is always added to head of hlist
241 */ 241 */
242typedef struct { 242struct cfs_hash_head {
243 struct hlist_head hh_head; /**< entries list */ 243 struct hlist_head hh_head; /**< entries list */
244} cfs_hash_head_t; 244};
245 245
246static int 246static int
247cfs_hash_hh_hhead_size(struct cfs_hash *hs) 247cfs_hash_hh_hhead_size(struct cfs_hash *hs)
248{ 248{
249 return sizeof(cfs_hash_head_t); 249 return sizeof(struct cfs_hash_head);
250} 250}
251 251
252static struct hlist_head * 252static struct hlist_head *
253cfs_hash_hh_hhead(struct cfs_hash *hs, struct cfs_hash_bd *bd) 253cfs_hash_hh_hhead(struct cfs_hash *hs, struct cfs_hash_bd *bd)
254{ 254{
255 cfs_hash_head_t *head = (cfs_hash_head_t *)&bd->bd_bucket->hsb_head[0]; 255 struct cfs_hash_head *head;
256 256
257 head = (struct cfs_hash_head *)&bd->bd_bucket->hsb_head[0];
257 return &head[bd->bd_offset].hh_head; 258 return &head[bd->bd_offset].hh_head;
258} 259}
259 260
@@ -277,23 +278,23 @@ cfs_hash_hh_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd,
277 * Simple hash head with depth tracking 278 * Simple hash head with depth tracking
278 * new element is always added to head of hlist 279 * new element is always added to head of hlist
279 */ 280 */
280typedef struct { 281struct cfs_hash_head_dep {
281 struct hlist_head hd_head; /**< entries list */ 282 struct hlist_head hd_head; /**< entries list */
282 unsigned int hd_depth; /**< list length */ 283 unsigned int hd_depth; /**< list length */
283} cfs_hash_head_dep_t; 284};
284 285
285static int 286static int
286cfs_hash_hd_hhead_size(struct cfs_hash *hs) 287cfs_hash_hd_hhead_size(struct cfs_hash *hs)
287{ 288{
288 return sizeof(cfs_hash_head_dep_t); 289 return sizeof(struct cfs_hash_head_dep);
289} 290}
290 291
291static struct hlist_head * 292static struct hlist_head *
292cfs_hash_hd_hhead(struct cfs_hash *hs, struct cfs_hash_bd *bd) 293cfs_hash_hd_hhead(struct cfs_hash *hs, struct cfs_hash_bd *bd)
293{ 294{
294 cfs_hash_head_dep_t *head; 295 struct cfs_hash_head_dep *head;
295 296
296 head = (cfs_hash_head_dep_t *)&bd->bd_bucket->hsb_head[0]; 297 head = (struct cfs_hash_head_dep *)&bd->bd_bucket->hsb_head[0];
297 return &head[bd->bd_offset].hd_head; 298 return &head[bd->bd_offset].hd_head;
298} 299}
299 300
@@ -301,8 +302,10 @@ static int
301cfs_hash_hd_hnode_add(struct cfs_hash *hs, struct cfs_hash_bd *bd, 302cfs_hash_hd_hnode_add(struct cfs_hash *hs, struct cfs_hash_bd *bd,
302 struct hlist_node *hnode) 303 struct hlist_node *hnode)
303{ 304{
304 cfs_hash_head_dep_t *hh = container_of(cfs_hash_hd_hhead(hs, bd), 305 struct cfs_hash_head_dep *hh;
305 cfs_hash_head_dep_t, hd_head); 306
307 hh = container_of(cfs_hash_hd_hhead(hs, bd),
308 struct cfs_hash_head_dep, hd_head);
306 hlist_add_head(hnode, &hh->hd_head); 309 hlist_add_head(hnode, &hh->hd_head);
307 return ++hh->hd_depth; 310 return ++hh->hd_depth;
308} 311}
@@ -311,8 +314,10 @@ static int
311cfs_hash_hd_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd, 314cfs_hash_hd_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd,
312 struct hlist_node *hnode) 315 struct hlist_node *hnode)
313{ 316{
314 cfs_hash_head_dep_t *hh = container_of(cfs_hash_hd_hhead(hs, bd), 317 struct cfs_hash_head_dep *hh;
315 cfs_hash_head_dep_t, hd_head); 318
319 hh = container_of(cfs_hash_hd_hhead(hs, bd),
320 struct cfs_hash_head_dep, hd_head);
316 hlist_del_init(hnode); 321 hlist_del_init(hnode);
317 return --hh->hd_depth; 322 return --hh->hd_depth;
318} 323}