aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-01-25 04:06:21 -0500
committerAlex Elder <aelder@sgi.com>2011-02-07 14:29:18 -0500
commit9681153b460006923bb1e9d39b05b80ec09d6b4e (patch)
tree4695cb892fd54dd75910583a4002f44509dbf239 /fs/xfs/xfs_rtalloc.c
parent0d8b30ad19bf13197cbcd786e2cd5a2ecef72e68 (diff)
xfs: add lockdep annotations for the rt inodes
The rt bitmap and summary inodes do not participate in the normal inode locking protocol. Instead the rt bitmap inode can be locked in any transaction involving rt allocations, and the both of the rt inodes can be locked at the same time. Add specific lockdep subclasses for the rt inodes to prevent lockdep from blowing up. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 037fab140242..f592ac978186 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1972,8 +1972,10 @@ xfs_growfs_rt(
1972 /* 1972 /*
1973 * Lock out other callers by grabbing the bitmap inode lock. 1973 * Lock out other callers by grabbing the bitmap inode lock.
1974 */ 1974 */
1975 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, 1975 error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
1976 XFS_ILOCK_EXCL, &ip))) 1976 XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP,
1977 &ip);
1978 if (error)
1977 goto error_cancel; 1979 goto error_cancel;
1978 ASSERT(ip == mp->m_rbmip); 1980 ASSERT(ip == mp->m_rbmip);
1979 /* 1981 /*
@@ -1986,8 +1988,9 @@ xfs_growfs_rt(
1986 /* 1988 /*
1987 * Get the summary inode into the transaction. 1989 * Get the summary inode into the transaction.
1988 */ 1990 */
1989 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, 1991 error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0,
1990 XFS_ILOCK_EXCL, &ip))) 1992 XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM, &ip);
1993 if (error)
1991 goto error_cancel; 1994 goto error_cancel;
1992 ASSERT(ip == mp->m_rsumip); 1995 ASSERT(ip == mp->m_rsumip);
1993 /* 1996 /*
@@ -2160,8 +2163,9 @@ xfs_rtfree_extent(
2160 /* 2163 /*
2161 * Synchronize by locking the bitmap inode. 2164 * Synchronize by locking the bitmap inode.
2162 */ 2165 */
2163 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, 2166 error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
2164 XFS_ILOCK_EXCL, &ip))) 2167 XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP, &ip);
2168 if (error)
2165 return error; 2169 return error;
2166#if defined(__KERNEL__) && defined(DEBUG) 2170#if defined(__KERNEL__) && defined(DEBUG)
2167 /* 2171 /*