xfs: stop using xfs_trans_iget in the RT allocator
PATCH 1/2 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.
fs/xfs/xfs_bmap.c +2 -6
@@ -2333,7 +2333,6 @@ xfs_bmap_rtalloc(xfs_extlen_t prod =0 ;/* product factor for allocators */ xfs_extlen_t ralen =0 ;/* realtime allocation length */ xfs_extlen_t align;/* minimum allocation alignment */ -xfs_inode_t *ip;/* bitmap incore inode */ xfs_rtblock_t rtb; mp = ap->ip->i_mount;
@@ -2370,11 +2369,8 @@ xfs_bmap_rtalloc(/* * Lock out other modifications to the RT bitmap inode. */ - error =xfs_trans_iget (mp, ap->tp, mp->m_sb.sb_rbmino,0 , -XFS_ILOCK_EXCL |XFS_ILOCK_RTBITMAP , &ip); -if (error) -return error; -ASSERT (ip == mp->m_rbmip); +xfs_ilock (mp->m_rbmip,XFS_ILOCK_EXCL ); +xfs_trans_ijoin_ref (ap->tp, mp->m_rbmip,XFS_ILOCK_EXCL );/* * If it's an allocation to an empty file at offset 0,
fs/xfs/xfs_rtalloc.c +21 -33
121 lines not on this page · raw message
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 4 lines · Christoph Hellwig
During mount we establish references to the RT inodes, which we keep for the lifetime of the filesystem. Instead of using
xfs_trans_igetto grab additional references when adding RT inodes to transactions use the combination ofxfs_ilockandxfs_trans_ijoin_ref, which archives the same
achieves
Quoted 3 lines
end result with less overhead.
Signed-off-by Christoph Hellwig <[email protected]>
Looks good.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Christoph Hellwig
During mount we establish references to the RT inodes, which we keep for the lifetime of the filesystem. Instead of using
xfs_trans_igetto grab additional references when adding RT inodes to transactions use the combination ofxfs_ilockandxfs_trans_ijoin_ref, which archives the same end result with less overhead.Signed-off-by Christoph Hellwig <[email protected]>
Looks good.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs