diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-02-13 08:25:31 -0500 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-02-22 21:30:21 -0500 |
commit | 1050c71e2925ab0cb025e4c89e08b15529a1ee36 (patch) | |
tree | eacaa53e025ab0da4793f1c3c09fc9e15ebee6a5 /fs/xfs/xfs_bmap.c | |
parent | 5d15765594eeb5d82c5630b3428ea0ac4f7d3c31 (diff) |
xfs: stop using xfs_trans_iget in the RT allocator
During mount we establish references to the RT inodes, which we keep for
the lifetime of the filesystem. Instead of using xfs_trans_iget to grab
additional references when adding RT inodes to transactions use the
combination of xfs_ilock and xfs_trans_ijoin_ref, which archives the same
end result with less overhead.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/xfs_bmap.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index d8d090665283..e7b441db0530 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
@@ -2333,7 +2333,6 @@ xfs_bmap_rtalloc( | |||
2333 | xfs_extlen_t prod = 0; /* product factor for allocators */ | 2333 | xfs_extlen_t prod = 0; /* product factor for allocators */ |
2334 | xfs_extlen_t ralen = 0; /* realtime allocation length */ | 2334 | xfs_extlen_t ralen = 0; /* realtime allocation length */ |
2335 | xfs_extlen_t align; /* minimum allocation alignment */ | 2335 | xfs_extlen_t align; /* minimum allocation alignment */ |
2336 | xfs_inode_t *ip; /* bitmap incore inode */ | ||
2337 | xfs_rtblock_t rtb; | 2336 | xfs_rtblock_t rtb; |
2338 | 2337 | ||
2339 | mp = ap->ip->i_mount; | 2338 | mp = ap->ip->i_mount; |
@@ -2370,11 +2369,8 @@ xfs_bmap_rtalloc( | |||
2370 | /* | 2369 | /* |
2371 | * Lock out other modifications to the RT bitmap inode. | 2370 | * Lock out other modifications to the RT bitmap inode. |
2372 | */ | 2371 | */ |
2373 | error = xfs_trans_iget(mp, ap->tp, mp->m_sb.sb_rbmino, 0, | 2372 | xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL); |
2374 | XFS_ILOCK_EXCL | XFS_ILOCK_RTBITMAP, &ip); | 2373 | xfs_trans_ijoin_ref(ap->tp, mp->m_rbmip, XFS_ILOCK_EXCL); |
2375 | if (error) | ||
2376 | return error; | ||
2377 | ASSERT(ip == mp->m_rbmip); | ||
2378 | 2374 | ||
2379 | /* | 2375 | /* |
2380 | * If it's an allocation to an empty file at offset 0, | 2376 | * If it's an allocation to an empty file at offset 0, |