xfs
[Top] [All Lists]

[patch 1/3] add a separate lock class for the per-mount list of dquots

To: xfs@xxxxxxxxxxx
Subject: [patch 1/3] add a separate lock class for the per-mount list of dquots
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 29 Dec 2008 17:18:03 -0500
References: <20081229221802.268877000@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.46-1
We can have both a a quota hash chain and the per-mount list locked at
the same time.  But given that both use the same struct dqhash as list
head we have to tell lockdep that they are different lock classes.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfs/fs/xfs/quota/xfs_qm.c
===================================================================
--- xfs.orig/fs/xfs/quota/xfs_qm.c      2008-12-29 01:27:21.000000000 +0000
+++ xfs/fs/xfs/quota/xfs_qm.c   2008-12-29 01:34:48.000000000 +0000
@@ -1068,6 +1068,13 @@
        return 0;
 }
 
+/*
+ * The hash chains and the mplist use the same xfs_dqhash structure as
+ * their list head, but we can take the mplist qh_lock and one of the
+ * hash qh_locks at the same time without any problem as they aren't
+ * related.
+ */
+static struct lock_class_key xfs_quota_mplist_class;
 
 /*
  * This initializes all the quota information that's kept in the
@@ -1103,6 +1110,8 @@
        }
 
        xfs_qm_list_init(&qinf->qi_dqlist, "mpdqlist", 0);
+       lockdep_set_class(&qinf->qi_dqlist.qh_lock, &xfs_quota_mplist_class);
+
        qinf->qi_dqreclaims = 0;
 
        /* mutex used to serialize quotaoffs */

-- 

<Prev in Thread] Current Thread [Next in Thread>