aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_ialloc.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2018-08-01 10:20:34 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-08-03 02:05:14 -0400
commit0f37d1780c3d864599fb377dcb47ad1aa0686b4e (patch)
tree4b54695109c61c7a5141636a89ba0ede57312585 /fs/xfs/libxfs/xfs_ialloc.c
parent1ae093cbea3d1ef04e1344b9e3996a9e1763a91b (diff)
xfs: pass transaction to xfs_defer_add()
The majority of remaining references to struct xfs_defer_ops in XFS are associated with xfs_defer_add(). At this point, there are no more external xfs_defer_ops users left. All instances of xfs_defer_ops are embedded in the transaction, which means we can safely pass the transaction down to the dfops add interface. Update xfs_defer_add() to receive the transaction as a parameter. Various subsystems implement wrappers to allocate and construct the context specific data structures for the associated deferred operation type. Update these to also carry the transaction down as needed and clean up unused dfops parameters along the way. This removes most of the remaining references to struct xfs_defer_ops throughout the code and facilitates removal of the structure. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> [darrick: fix unused variable warnings with ftrace disabled] Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_ialloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 295304ad1bc1..a8f6db735d5d 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -1838,23 +1838,24 @@ out_error:
1838 */ 1838 */
1839STATIC void 1839STATIC void
1840xfs_difree_inode_chunk( 1840xfs_difree_inode_chunk(
1841 struct xfs_mount *mp, 1841 struct xfs_trans *tp,
1842 xfs_agnumber_t agno, 1842 xfs_agnumber_t agno,
1843 struct xfs_inobt_rec_incore *rec, 1843 struct xfs_inobt_rec_incore *rec)
1844 struct xfs_defer_ops *dfops)
1845{ 1844{
1846 xfs_agblock_t sagbno = XFS_AGINO_TO_AGBNO(mp, rec->ir_startino); 1845 struct xfs_mount *mp = tp->t_mountp;
1847 int startidx, endidx; 1846 xfs_agblock_t sagbno = XFS_AGINO_TO_AGBNO(mp,
1848 int nextbit; 1847 rec->ir_startino);
1849 xfs_agblock_t agbno; 1848 int startidx, endidx;
1850 int contigblk; 1849 int nextbit;
1851 struct xfs_owner_info oinfo; 1850 xfs_agblock_t agbno;
1851 int contigblk;
1852 struct xfs_owner_info oinfo;
1852 DECLARE_BITMAP(holemask, XFS_INOBT_HOLEMASK_BITS); 1853 DECLARE_BITMAP(holemask, XFS_INOBT_HOLEMASK_BITS);
1853 xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES); 1854 xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES);
1854 1855
1855 if (!xfs_inobt_issparse(rec->ir_holemask)) { 1856 if (!xfs_inobt_issparse(rec->ir_holemask)) {
1856 /* not sparse, calculate extent info directly */ 1857 /* not sparse, calculate extent info directly */
1857 xfs_bmap_add_free(mp, dfops, XFS_AGB_TO_FSB(mp, agno, sagbno), 1858 xfs_bmap_add_free(tp, XFS_AGB_TO_FSB(mp, agno, sagbno),
1858 mp->m_ialloc_blks, &oinfo); 1859 mp->m_ialloc_blks, &oinfo);
1859 return; 1860 return;
1860 } 1861 }
@@ -1898,7 +1899,7 @@ xfs_difree_inode_chunk(
1898 1899
1899 ASSERT(agbno % mp->m_sb.sb_spino_align == 0); 1900 ASSERT(agbno % mp->m_sb.sb_spino_align == 0);
1900 ASSERT(contigblk % mp->m_sb.sb_spino_align == 0); 1901 ASSERT(contigblk % mp->m_sb.sb_spino_align == 0);
1901 xfs_bmap_add_free(mp, dfops, XFS_AGB_TO_FSB(mp, agno, agbno), 1902 xfs_bmap_add_free(tp, XFS_AGB_TO_FSB(mp, agno, agbno),
1902 contigblk, &oinfo); 1903 contigblk, &oinfo);
1903 1904
1904 /* reset range to current bit and carry on... */ 1905 /* reset range to current bit and carry on... */
@@ -2002,7 +2003,7 @@ xfs_difree_inobt(
2002 goto error0; 2003 goto error0;
2003 } 2004 }
2004 2005
2005 xfs_difree_inode_chunk(mp, agno, &rec, tp->t_dfops); 2006 xfs_difree_inode_chunk(tp, agno, &rec);
2006 } else { 2007 } else {
2007 xic->deleted = false; 2008 xic->deleted = false;
2008 2009