aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/quota/xfs_dquot.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-01-19 02:03:19 +0100
committerChristoph Hellwig <hch@brick.lst.de>2009-01-19 02:03:19 +0100
commit5bb87a33b2cfb8e7ef3383718274094bdff266a3 (patch)
tree7917b0354e01dde2fc321a48214f72333aab3073 /fs/xfs/quota/xfs_dquot.h
parenta4edd1da20af79b2e92efeee3ca94831c8024d61 (diff)
xfs: lockdep annotations for xfs_dqlock2
xfs_dqlock2 locks two xfs_dquots, which is fine as it always locks the dquot with the lower id first. Use mutex_lock_nested to tell lockdep about this fact. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/quota/xfs_dquot.h')
-rw-r--r--fs/xfs/quota/xfs_dquot.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/quota/xfs_dquot.h b/fs/xfs/quota/xfs_dquot.h
index 7e455337e2b..d443e93b433 100644
--- a/fs/xfs/quota/xfs_dquot.h
+++ b/fs/xfs/quota/xfs_dquot.h
@@ -97,6 +97,16 @@ typedef struct xfs_dquot {
#define dq_hashlist q_lists.dqm_hashlist
#define dq_flags q_lists.dqm_flags
+/*
+ * Lock hierachy for q_qlock:
+ * XFS_QLOCK_NORMAL is the implicit default,
+ * XFS_QLOCK_NESTED is the dquot with the higher id in xfs_dqlock2
+ */
+enum {
+ XFS_QLOCK_NORMAL = 0,
+ XFS_QLOCK_NESTED,
+};
+
#define XFS_DQHOLD(dqp) ((dqp)->q_nrefs++)
#ifdef DEBUG