summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-01-25 12:06:21 +0300
committerAlex Elder <aelder@sgi.com>2011-02-07 22:29:18 +0300
commit9681153b460006923bb1e9d39b05b80ec09d6b4e (patch)
tree4695cb892fd54dd75910583a4002f44509dbf239 /fs/xfs/xfs_rtalloc.c
parent0d8b30ad19bf13197cbcd786e2cd5a2ecef72e68 (diff)
downloadlinux-9681153b460006923bb1e9d39b05b80ec09d6b4e.tar.xz
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(
/*
* Lock out other callers by grabbing the bitmap inode lock.
*/
- if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
- XFS_ILOCK_EXCL, &ip)))
+ error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
+ XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP,
+ &ip);
+ if (error)
goto error_cancel;
ASSERT(ip == mp->m_rbmip);
/*
@@ -1986,8 +1988,9 @@ xfs_growfs_rt(
/*
* Get the summary inode into the transaction.
*/
- if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0,
- XFS_ILOCK_EXCL, &ip)))
+ error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0,
+ XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM, &ip);
+ if (error)
goto error_cancel;
ASSERT(ip == mp->m_rsumip);
/*
@@ -2160,8 +2163,9 @@ xfs_rtfree_extent(
/*
* Synchronize by locking the bitmap inode.
*/
- if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
- XFS_ILOCK_EXCL, &ip)))
+ error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
+ XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP, &ip);
+ if (error)
return error;
#if defined(__KERNEL__) && defined(DEBUG)
/*