[PATCH 7/7] nfsd: filecache: give disposal lock a unique class name.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are at least three locks in the kernel which are initialised as

  spin_Lock_init(&l->lock);

This makes them hard to differential in /proc/lock_stat.

For the lock in nfsd/filecache.c introduce a variable with a more
descriptve name so we can:

  spin_lock_init(&nfsd_fcache_disposal->lock);

and easily identify this in /proc/lock_stat.

Signed-off-by: NeilBrown <neilb@xxxxxxx>
---
 fs/nfsd/filecache.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index eb95a53f806f..af95bc381753 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -867,12 +867,13 @@ __nfsd_file_cache_purge(struct net *net)
 static struct nfsd_fcache_disposal *
 nfsd_alloc_fcache_disposal(void)
 {
-	struct nfsd_fcache_disposal *l;
+	struct nfsd_fcache_disposal *l, *nfsd_fcache_disposal;
 
 	l = kmalloc(sizeof(*l), GFP_KERNEL);
 	if (!l)
 		return NULL;
-	spin_lock_init(&l->lock);
+	nfsd_fcache_disposal = l;
+	spin_lock_init(&nfsd_fcache_disposal->lock);
 	timer_setup(&l->timer, nfsd_file_gc_worker, 0);
 	INIT_LIST_HEAD(&l->recent);
 	INIT_LIST_HEAD(&l->older);
-- 
2.47.1





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux