Skip to contentSkip to conversation

sunrpc: remove 'inuse' flag from struct cache_detail.

PATCH In review NeilBrown 2 participants 2 messages Jun 2, 2016

Subsystems (3)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 sunrpc: remove 'inuse' flag from struct cache_detail.

This field is not currently in use.

---

I recently noticed this and wondered what it was for. "Nothing" seems to be the answer..

NeilBrown

 include/linux/sunrpc/cache.h | 2 --
 net/sunrpc/cache.c           | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
include/linux/sunrpc/cache.h +0 -2
index ed03c9f7f908..62a60eeacb0a 100644
@@ -78,8 +78,6 @@ struct cache_detail {
 	struct hlist_head *	hash_table;
 	rwlock_t		hash_lock;
 
-	atomic_t		inuse; /* active user-space update or lookup */
-
 	char			*name;
 	void			(*cache_put)(struct kref *);
 
net/sunrpc/cache.c +1 -1
index 553bf95f7003..4d8e11f94a35 100644
@@ -362,7 +362,7 @@ void sunrpc_destroy_cache_detail(struct cache_detail *cd)
 	cache_purge(cd);
 	spin_lock(&cache_list_lock);
 	write_lock(&cd->hash_lock);
-	if (cd->entries || atomic_read(&cd->inuse)) {
+	if (cd->entries) {
 		write_unlock(&cd->hash_lock);
 		spin_unlock(&cache_list_lock);
 		goto out;
Signature · 1 line
2.8.3
#1 lore raw
Quoted 2 lines · NeilBrown

This field is not currently in use.

Hah. OK, thanks.--b.

Quoted 43 lines

---

I recently noticed this and wondered what it was for. "Nothing" seems to be the answer..

NeilBrown

 include/linux/sunrpc/cache.h | 2 --
 net/sunrpc/cache.c           | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)
include/linux/sunrpc/cache.h +0 -2
index ed03c9f7f908..62a60eeacb0a 100644
@@ -78,8 +78,6 @@ struct cache_detail {
 	struct hlist_head *	hash_table;
 	rwlock_t		hash_lock;
 
-	atomic_t		inuse; /* active user-space update or lookup */
-
 	char			*name;
 	void			(*cache_put)(struct kref *);
 
net/sunrpc/cache.c +1 -1
index 553bf95f7003..4d8e11f94a35 100644
@@ -362,7 +362,7 @@ void sunrpc_destroy_cache_detail(struct cache_detail *cd)
 	cache_purge(cd);
 	spin_lock(&cache_list_lock);
 	write_lock(&cd->hash_lock);
-	if (cd->entries || atomic_read(&cd->inuse)) {
+	if (cd->entries) {
 		write_unlock(&cd->hash_lock);
 		spin_unlock(&cache_list_lock);
 		goto out;
Signature · 1 line
2.8.3