Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Brian Foster and committed by
Darrick J. Wong
0f37d178 1ae093cb

+169 -210
+4 -5
fs/xfs/libxfs/xfs_alloc.c
··· 2198 2198 */ 2199 2199 STATIC void 2200 2200 xfs_defer_agfl_block( 2201 - struct xfs_mount *mp, 2202 - struct xfs_defer_ops *dfops, 2201 + struct xfs_trans *tp, 2203 2202 xfs_agnumber_t agno, 2204 2203 xfs_fsblock_t agbno, 2205 2204 struct xfs_owner_info *oinfo) 2206 2205 { 2206 + struct xfs_mount *mp = tp->t_mountp; 2207 2207 struct xfs_extent_free_item *new; /* new element */ 2208 2208 2209 2209 ASSERT(xfs_bmap_free_item_zone != NULL); ··· 2216 2216 2217 2217 trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1); 2218 2218 2219 - xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list); 2219 + xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list); 2220 2220 } 2221 2221 2222 2222 /* ··· 2325 2325 2326 2326 /* defer agfl frees if dfops is provided */ 2327 2327 if (tp->t_dfops) { 2328 - xfs_defer_agfl_block(mp, tp->t_dfops, args->agno, 2329 - bno, &targs.oinfo); 2328 + xfs_defer_agfl_block(tp, args->agno, bno, &targs.oinfo); 2330 2329 } else { 2331 2330 error = xfs_free_agfl_block(tp, args->agno, bno, agbp, 2332 2331 &targs.oinfo);
+40 -49
fs/xfs/libxfs/xfs_bmap.c
··· 533 533 */ 534 534 void 535 535 __xfs_bmap_add_free( 536 - struct xfs_mount *mp, 537 - struct xfs_defer_ops *dfops, 536 + struct xfs_trans *tp, 538 537 xfs_fsblock_t bno, 539 538 xfs_filblks_t len, 540 539 struct xfs_owner_info *oinfo, ··· 541 542 { 542 543 struct xfs_extent_free_item *new; /* new element */ 543 544 #ifdef DEBUG 544 - xfs_agnumber_t agno; 545 - xfs_agblock_t agbno; 545 + struct xfs_mount *mp = tp->t_mountp; 546 + xfs_agnumber_t agno; 547 + xfs_agblock_t agbno; 546 548 547 549 ASSERT(bno != NULLFSBLOCK); 548 550 ASSERT(len > 0); ··· 566 566 else 567 567 xfs_rmap_skip_owner_update(&new->xefi_oinfo); 568 568 new->xefi_skip_discard = skip_discard; 569 - trace_xfs_bmap_free_defer(mp, XFS_FSB_TO_AGNO(mp, bno), 0, 570 - XFS_FSB_TO_AGBNO(mp, bno), len); 571 - xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_FREE, &new->xefi_list); 569 + trace_xfs_bmap_free_defer(tp->t_mountp, 570 + XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0, 571 + XFS_FSB_TO_AGBNO(tp->t_mountp, bno), len); 572 + xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_FREE, &new->xefi_list); 572 573 } 573 574 574 575 /* ··· 625 624 if ((error = xfs_btree_check_block(cur, cblock, 0, cbp))) 626 625 return error; 627 626 xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, whichfork); 628 - xfs_bmap_add_free(mp, cur->bc_tp->t_dfops, cbno, 1, &oinfo); 627 + xfs_bmap_add_free(cur->bc_tp, cbno, 1, &oinfo); 629 628 ip->i_d.di_nblocks--; 630 629 xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); 631 630 xfs_trans_binval(tp, cbp); ··· 1962 1961 1963 1962 /* add reverse mapping unless caller opted out */ 1964 1963 if (!(bma->flags & XFS_BMAPI_NORMAP)) { 1965 - error = xfs_rmap_map_extent(mp, bma->tp->t_dfops, bma->ip, 1966 - whichfork, new); 1964 + error = xfs_rmap_map_extent(bma->tp, bma->ip, whichfork, new); 1967 1965 if (error) 1968 1966 goto done; 1969 1967 } ··· 2026 2026 int state = xfs_bmap_fork_to_state(whichfork); 2027 2027 struct xfs_mount *mp = ip->i_mount; 2028 2028 struct xfs_bmbt_irec old; 2029 - struct xfs_defer_ops *dfops = tp ? tp->t_dfops : NULL; 2030 2029 2031 2030 *logflagsp = 0; 2032 2031 ··· 2444 2445 } 2445 2446 2446 2447 /* update reverse mappings */ 2447 - error = xfs_rmap_convert_extent(mp, dfops, ip, whichfork, new); 2448 + error = xfs_rmap_convert_extent(mp, tp, ip, whichfork, new); 2448 2449 if (error) 2449 2450 goto done; 2450 2451 ··· 2805 2806 2806 2807 /* add reverse mapping unless caller opted out */ 2807 2808 if (!(flags & XFS_BMAPI_NORMAP)) { 2808 - error = xfs_rmap_map_extent(mp, tp->t_dfops, ip, whichfork, 2809 - new); 2809 + error = xfs_rmap_map_extent(tp, ip, whichfork, new); 2810 2810 if (error) 2811 2811 goto done; 2812 2812 } ··· 4362 4364 * the refcount btree for orphan recovery. 4363 4365 */ 4364 4366 if (whichfork == XFS_COW_FORK) { 4365 - error = xfs_refcount_alloc_cow_extent(mp, 4366 - tp->t_dfops, bma.blkno, 4367 - bma.length); 4367 + error = xfs_refcount_alloc_cow_extent(tp, 4368 + bma.blkno, bma.length); 4368 4369 if (error) 4369 4370 goto error0; 4370 4371 } ··· 4849 4852 uint qfield; /* quota field to update */ 4850 4853 int state = xfs_bmap_fork_to_state(whichfork); 4851 4854 struct xfs_bmbt_irec old; 4852 - struct xfs_defer_ops *dfops = tp ? tp->t_dfops : NULL; 4853 4855 4854 4856 mp = ip->i_mount; 4855 4857 XFS_STATS_INC(mp, xs_del_exlist); ··· 5032 5036 } 5033 5037 5034 5038 /* remove reverse mapping */ 5035 - error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, del); 5039 + error = xfs_rmap_unmap_extent(tp, ip, whichfork, del); 5036 5040 if (error) 5037 5041 goto done; 5038 5042 ··· 5041 5045 */ 5042 5046 if (do_fx && !(bflags & XFS_BMAPI_REMAP)) { 5043 5047 if (xfs_is_reflink_inode(ip) && whichfork == XFS_DATA_FORK) { 5044 - error = xfs_refcount_decrease_extent(mp, dfops, del); 5048 + error = xfs_refcount_decrease_extent(tp, del); 5045 5049 if (error) 5046 5050 goto done; 5047 5051 } else { 5048 - __xfs_bmap_add_free(mp, dfops, del->br_startblock, 5052 + __xfs_bmap_add_free(tp, del->br_startblock, 5049 5053 del->br_blockcount, NULL, 5050 5054 (bflags & XFS_BMAPI_NODISCARD) || 5051 5055 del->br_state == XFS_EXT_UNWRITTEN); ··· 5485 5489 */ 5486 5490 STATIC int 5487 5491 xfs_bmse_merge( 5492 + struct xfs_trans *tp, 5488 5493 struct xfs_inode *ip, 5489 5494 int whichfork, 5490 5495 xfs_fileoff_t shift, /* shift fsb */ ··· 5493 5496 struct xfs_bmbt_irec *got, /* extent to shift */ 5494 5497 struct xfs_bmbt_irec *left, /* preceding extent */ 5495 5498 struct xfs_btree_cur *cur, 5496 - int *logflags, /* output */ 5497 - struct xfs_defer_ops *dfops) 5499 + int *logflags) /* output */ 5498 5500 { 5499 5501 struct xfs_bmbt_irec new; 5500 5502 xfs_filblks_t blockcount; ··· 5549 5553 &new); 5550 5554 5551 5555 /* update reverse mapping. rmap functions merge the rmaps for us */ 5552 - error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, got); 5556 + error = xfs_rmap_unmap_extent(tp, ip, whichfork, got); 5553 5557 if (error) 5554 5558 return error; 5555 5559 memcpy(&new, got, sizeof(new)); 5556 5560 new.br_startoff = left->br_startoff + left->br_blockcount; 5557 - return xfs_rmap_map_extent(mp, dfops, ip, whichfork, &new); 5561 + return xfs_rmap_map_extent(tp, ip, whichfork, &new); 5558 5562 } 5559 5563 5560 5564 static int 5561 5565 xfs_bmap_shift_update_extent( 5566 + struct xfs_trans *tp, 5562 5567 struct xfs_inode *ip, 5563 5568 int whichfork, 5564 5569 struct xfs_iext_cursor *icur, 5565 5570 struct xfs_bmbt_irec *got, 5566 5571 struct xfs_btree_cur *cur, 5567 5572 int *logflags, 5568 - struct xfs_defer_ops *dfops, 5569 5573 xfs_fileoff_t startoff) 5570 5574 { 5571 5575 struct xfs_mount *mp = ip->i_mount; ··· 5593 5597 got); 5594 5598 5595 5599 /* update reverse mapping */ 5596 - error = xfs_rmap_unmap_extent(mp, dfops, ip, whichfork, &prev); 5600 + error = xfs_rmap_unmap_extent(tp, ip, whichfork, &prev); 5597 5601 if (error) 5598 5602 return error; 5599 - return xfs_rmap_map_extent(mp, dfops, ip, whichfork, got); 5603 + return xfs_rmap_map_extent(tp, ip, whichfork, got); 5600 5604 } 5601 5605 5602 5606 int ··· 5656 5660 } 5657 5661 5658 5662 if (xfs_bmse_can_merge(&prev, &got, offset_shift_fsb)) { 5659 - error = xfs_bmse_merge(ip, whichfork, offset_shift_fsb, 5660 - &icur, &got, &prev, cur, &logflags, 5661 - tp->t_dfops); 5663 + error = xfs_bmse_merge(tp, ip, whichfork, 5664 + offset_shift_fsb, &icur, &got, &prev, 5665 + cur, &logflags); 5662 5666 if (error) 5663 5667 goto del_cursor; 5664 5668 goto done; ··· 5670 5674 } 5671 5675 } 5672 5676 5673 - error = xfs_bmap_shift_update_extent(ip, whichfork, &icur, &got, cur, 5674 - &logflags, tp->t_dfops, new_startoff); 5677 + error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, 5678 + cur, &logflags, new_startoff); 5675 5679 if (error) 5676 5680 goto del_cursor; 5677 5681 ··· 5797 5801 WARN_ON_ONCE(1); 5798 5802 } 5799 5803 5800 - error = xfs_bmap_shift_update_extent(ip, whichfork, &icur, &got, cur, 5801 - &logflags, tp->t_dfops, new_startoff); 5804 + error = xfs_bmap_shift_update_extent(tp, ip, whichfork, &icur, &got, 5805 + cur, &logflags, new_startoff); 5802 5806 if (error) 5803 5807 goto del_cursor; 5804 5808 ··· 5975 5979 /* Record a bmap intent. */ 5976 5980 static int 5977 5981 __xfs_bmap_add( 5978 - struct xfs_mount *mp, 5979 - struct xfs_defer_ops *dfops, 5982 + struct xfs_trans *tp, 5980 5983 enum xfs_bmap_intent_type type, 5981 5984 struct xfs_inode *ip, 5982 5985 int whichfork, ··· 5983 5988 { 5984 5989 struct xfs_bmap_intent *bi; 5985 5990 5986 - trace_xfs_bmap_defer(mp, 5987 - XFS_FSB_TO_AGNO(mp, bmap->br_startblock), 5991 + trace_xfs_bmap_defer(tp->t_mountp, 5992 + XFS_FSB_TO_AGNO(tp->t_mountp, bmap->br_startblock), 5988 5993 type, 5989 - XFS_FSB_TO_AGBNO(mp, bmap->br_startblock), 5994 + XFS_FSB_TO_AGBNO(tp->t_mountp, bmap->br_startblock), 5990 5995 ip->i_ino, whichfork, 5991 5996 bmap->br_startoff, 5992 5997 bmap->br_blockcount, ··· 5999 6004 bi->bi_whichfork = whichfork; 6000 6005 bi->bi_bmap = *bmap; 6001 6006 6002 - xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_BMAP, &bi->bi_list); 6007 + xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_BMAP, &bi->bi_list); 6003 6008 return 0; 6004 6009 } 6005 6010 6006 6011 /* Map an extent into a file. */ 6007 6012 int 6008 6013 xfs_bmap_map_extent( 6009 - struct xfs_mount *mp, 6010 - struct xfs_defer_ops *dfops, 6014 + struct xfs_trans *tp, 6011 6015 struct xfs_inode *ip, 6012 6016 struct xfs_bmbt_irec *PREV) 6013 6017 { 6014 6018 if (!xfs_bmap_is_update_needed(PREV)) 6015 6019 return 0; 6016 6020 6017 - return __xfs_bmap_add(mp, dfops, XFS_BMAP_MAP, ip, 6018 - XFS_DATA_FORK, PREV); 6021 + return __xfs_bmap_add(tp, XFS_BMAP_MAP, ip, XFS_DATA_FORK, PREV); 6019 6022 } 6020 6023 6021 6024 /* Unmap an extent out of a file. */ 6022 6025 int 6023 6026 xfs_bmap_unmap_extent( 6024 - struct xfs_mount *mp, 6025 - struct xfs_defer_ops *dfops, 6027 + struct xfs_trans *tp, 6026 6028 struct xfs_inode *ip, 6027 6029 struct xfs_bmbt_irec *PREV) 6028 6030 { 6029 6031 if (!xfs_bmap_is_update_needed(PREV)) 6030 6032 return 0; 6031 6033 6032 - return __xfs_bmap_add(mp, dfops, XFS_BMAP_UNMAP, ip, 6033 - XFS_DATA_FORK, PREV); 6034 + return __xfs_bmap_add(tp, XFS_BMAP_UNMAP, ip, XFS_DATA_FORK, PREV); 6034 6035 } 6035 6036 6036 6037 /*
+9 -10
fs/xfs/libxfs/xfs_bmap.h
··· 184 184 void xfs_trim_extent_eof(struct xfs_bmbt_irec *, struct xfs_inode *); 185 185 int xfs_bmap_add_attrfork(struct xfs_inode *ip, int size, int rsvd); 186 186 void xfs_bmap_local_to_extents_empty(struct xfs_inode *ip, int whichfork); 187 - void __xfs_bmap_add_free(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 188 - xfs_fsblock_t bno, xfs_filblks_t len, 189 - struct xfs_owner_info *oinfo, bool skip_discard); 187 + void __xfs_bmap_add_free(struct xfs_trans *tp, xfs_fsblock_t bno, 188 + xfs_filblks_t len, struct xfs_owner_info *oinfo, 189 + bool skip_discard); 190 190 void xfs_bmap_compute_maxlevels(struct xfs_mount *mp, int whichfork); 191 191 int xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip, 192 192 xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork); ··· 230 230 231 231 static inline void 232 232 xfs_bmap_add_free( 233 - struct xfs_mount *mp, 234 - struct xfs_defer_ops *dfops, 233 + struct xfs_trans *tp, 235 234 xfs_fsblock_t bno, 236 235 xfs_filblks_t len, 237 236 struct xfs_owner_info *oinfo) 238 237 { 239 - __xfs_bmap_add_free(mp, dfops, bno, len, oinfo, false); 238 + __xfs_bmap_add_free(tp, bno, len, oinfo, false); 240 239 } 241 240 242 241 enum xfs_bmap_intent_type { ··· 255 256 enum xfs_bmap_intent_type type, int whichfork, 256 257 xfs_fileoff_t startoff, xfs_fsblock_t startblock, 257 258 xfs_filblks_t *blockcount, xfs_exntst_t state); 258 - int xfs_bmap_map_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 259 - struct xfs_inode *ip, struct xfs_bmbt_irec *imap); 260 - int xfs_bmap_unmap_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 261 - struct xfs_inode *ip, struct xfs_bmbt_irec *imap); 259 + int xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip, 260 + struct xfs_bmbt_irec *imap); 261 + int xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip, 262 + struct xfs_bmbt_irec *imap); 262 263 263 264 static inline int xfs_bmap_fork_to_state(int whichfork) 264 265 {
+1 -1
fs/xfs/libxfs/xfs_bmap_btree.c
··· 289 289 struct xfs_owner_info oinfo; 290 290 291 291 xfs_rmap_ino_bmbt_owner(&oinfo, ip->i_ino, cur->bc_private.b.whichfork); 292 - xfs_bmap_add_free(mp, cur->bc_tp->t_dfops, fsbno, 1, &oinfo); 292 + xfs_bmap_add_free(cur->bc_tp, fsbno, 1, &oinfo); 293 293 ip->i_d.di_nblocks--; 294 294 295 295 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
+4 -1
fs/xfs/libxfs/xfs_defer.c
··· 487 487 /* Add an item for later deferred processing. */ 488 488 void 489 489 xfs_defer_add( 490 - struct xfs_defer_ops *dop, 490 + struct xfs_trans *tp, 491 491 enum xfs_defer_ops_type type, 492 492 struct list_head *li) 493 493 { 494 + struct xfs_defer_ops *dop = tp->t_dfops; 494 495 struct xfs_defer_pending *dfp = NULL; 496 + 497 + ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); 495 498 496 499 /* 497 500 * Add the item to a pending item at the end of the intake list.
+1 -1
fs/xfs/libxfs/xfs_defer.h
··· 35 35 XFS_DEFER_OPS_TYPE_MAX, 36 36 }; 37 37 38 - void xfs_defer_add(struct xfs_defer_ops *dop, enum xfs_defer_ops_type type, 38 + void xfs_defer_add(struct xfs_trans *tp, enum xfs_defer_ops_type type, 39 39 struct list_head *h); 40 40 int xfs_defer_finish_noroll(struct xfs_trans **tp); 41 41 int xfs_defer_finish(struct xfs_trans **tp);
+13 -12
fs/xfs/libxfs/xfs_ialloc.c
··· 1838 1838 */ 1839 1839 STATIC void 1840 1840 xfs_difree_inode_chunk( 1841 - struct xfs_mount *mp, 1841 + struct xfs_trans *tp, 1842 1842 xfs_agnumber_t agno, 1843 - struct xfs_inobt_rec_incore *rec, 1844 - struct xfs_defer_ops *dfops) 1843 + struct xfs_inobt_rec_incore *rec) 1845 1844 { 1846 - xfs_agblock_t sagbno = XFS_AGINO_TO_AGBNO(mp, rec->ir_startino); 1847 - int startidx, endidx; 1848 - int nextbit; 1849 - xfs_agblock_t agbno; 1850 - int contigblk; 1851 - struct xfs_owner_info oinfo; 1845 + struct xfs_mount *mp = tp->t_mountp; 1846 + xfs_agblock_t sagbno = XFS_AGINO_TO_AGBNO(mp, 1847 + rec->ir_startino); 1848 + int startidx, endidx; 1849 + int nextbit; 1850 + xfs_agblock_t agbno; 1851 + int contigblk; 1852 + struct xfs_owner_info oinfo; 1852 1853 DECLARE_BITMAP(holemask, XFS_INOBT_HOLEMASK_BITS); 1853 1854 xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_INODES); 1854 1855 1855 1856 if (!xfs_inobt_issparse(rec->ir_holemask)) { 1856 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 1859 mp->m_ialloc_blks, &oinfo); 1859 1860 return; 1860 1861 } ··· 1899 1898 1900 1899 ASSERT(agbno % mp->m_sb.sb_spino_align == 0); 1901 1900 ASSERT(contigblk % mp->m_sb.sb_spino_align == 0); 1902 - xfs_bmap_add_free(mp, dfops, XFS_AGB_TO_FSB(mp, agno, agbno), 1901 + xfs_bmap_add_free(tp, XFS_AGB_TO_FSB(mp, agno, agbno), 1903 1902 contigblk, &oinfo); 1904 1903 1905 1904 /* reset range to current bit and carry on... */ ··· 2003 2002 goto error0; 2004 2003 } 2005 2004 2006 - xfs_difree_inode_chunk(mp, agno, &rec, tp->t_dfops); 2005 + xfs_difree_inode_chunk(tp, agno, &rec); 2007 2006 } else { 2008 2007 xic->deleted = false; 2009 2008
+34 -46
fs/xfs/libxfs/xfs_refcount.c
··· 34 34 }; 35 35 36 36 STATIC int __xfs_refcount_cow_alloc(struct xfs_btree_cur *rcur, 37 - xfs_agblock_t agbno, xfs_extlen_t aglen, 38 - struct xfs_defer_ops *dfops); 37 + xfs_agblock_t agbno, xfs_extlen_t aglen); 39 38 STATIC int __xfs_refcount_cow_free(struct xfs_btree_cur *rcur, 40 - xfs_agblock_t agbno, xfs_extlen_t aglen, 41 - struct xfs_defer_ops *dfops); 39 + xfs_agblock_t agbno, xfs_extlen_t aglen); 42 40 43 41 /* 44 42 * Look up the first record less than or equal to [bno, len] in the btree ··· 868 870 xfs_agblock_t *agbno, 869 871 xfs_extlen_t *aglen, 870 872 enum xfs_refc_adjust_op adj, 871 - struct xfs_defer_ops *dfops, 872 873 struct xfs_owner_info *oinfo) 873 874 { 874 875 struct xfs_refcount_irec ext, tmp; ··· 922 925 fsbno = XFS_AGB_TO_FSB(cur->bc_mp, 923 926 cur->bc_private.a.agno, 924 927 tmp.rc_startblock); 925 - xfs_bmap_add_free(cur->bc_mp, dfops, fsbno, 926 - tmp.rc_blockcount, oinfo); 928 + xfs_bmap_add_free(cur->bc_tp, fsbno, 929 + tmp.rc_blockcount, oinfo); 927 930 } 928 931 929 932 (*agbno) += tmp.rc_blockcount; ··· 965 968 fsbno = XFS_AGB_TO_FSB(cur->bc_mp, 966 969 cur->bc_private.a.agno, 967 970 ext.rc_startblock); 968 - xfs_bmap_add_free(cur->bc_mp, dfops, fsbno, 969 - ext.rc_blockcount, oinfo); 971 + xfs_bmap_add_free(cur->bc_tp, fsbno, ext.rc_blockcount, 972 + oinfo); 970 973 } 971 974 972 975 skip: ··· 995 998 xfs_agblock_t *new_agbno, 996 999 xfs_extlen_t *new_aglen, 997 1000 enum xfs_refc_adjust_op adj, 998 - struct xfs_defer_ops *dfops, 999 1001 struct xfs_owner_info *oinfo) 1000 1002 { 1001 1003 bool shape_changed; ··· 1039 1043 1040 1044 /* Now that we've taken care of the ends, adjust the middle extents */ 1041 1045 error = xfs_refcount_adjust_extents(cur, new_agbno, new_aglen, 1042 - adj, dfops, oinfo); 1046 + adj, oinfo); 1043 1047 if (error) 1044 1048 goto out_error; 1045 1049 ··· 1086 1090 struct xfs_btree_cur **pcur) 1087 1091 { 1088 1092 struct xfs_mount *mp = tp->t_mountp; 1089 - struct xfs_defer_ops *dfops = tp->t_dfops; 1090 1093 struct xfs_btree_cur *rcur; 1091 1094 struct xfs_buf *agbp = NULL; 1092 1095 int error = 0; ··· 1140 1145 switch (type) { 1141 1146 case XFS_REFCOUNT_INCREASE: 1142 1147 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, 1143 - new_len, XFS_REFCOUNT_ADJUST_INCREASE, dfops, NULL); 1148 + new_len, XFS_REFCOUNT_ADJUST_INCREASE, NULL); 1144 1149 *new_fsb = XFS_AGB_TO_FSB(mp, agno, new_agbno); 1145 1150 break; 1146 1151 case XFS_REFCOUNT_DECREASE: 1147 1152 error = xfs_refcount_adjust(rcur, bno, blockcount, &new_agbno, 1148 - new_len, XFS_REFCOUNT_ADJUST_DECREASE, dfops, NULL); 1153 + new_len, XFS_REFCOUNT_ADJUST_DECREASE, NULL); 1149 1154 *new_fsb = XFS_AGB_TO_FSB(mp, agno, new_agbno); 1150 1155 break; 1151 1156 case XFS_REFCOUNT_ALLOC_COW: 1152 1157 *new_fsb = startblock + blockcount; 1153 1158 *new_len = 0; 1154 - error = __xfs_refcount_cow_alloc(rcur, bno, blockcount, dfops); 1159 + error = __xfs_refcount_cow_alloc(rcur, bno, blockcount); 1155 1160 break; 1156 1161 case XFS_REFCOUNT_FREE_COW: 1157 1162 *new_fsb = startblock + blockcount; 1158 1163 *new_len = 0; 1159 - error = __xfs_refcount_cow_free(rcur, bno, blockcount, dfops); 1164 + error = __xfs_refcount_cow_free(rcur, bno, blockcount); 1160 1165 break; 1161 1166 default: 1162 1167 ASSERT(0); ··· 1178 1183 */ 1179 1184 static int 1180 1185 __xfs_refcount_add( 1181 - struct xfs_mount *mp, 1182 - struct xfs_defer_ops *dfops, 1186 + struct xfs_trans *tp, 1183 1187 enum xfs_refcount_intent_type type, 1184 1188 xfs_fsblock_t startblock, 1185 1189 xfs_extlen_t blockcount) 1186 1190 { 1187 1191 struct xfs_refcount_intent *ri; 1188 1192 1189 - trace_xfs_refcount_defer(mp, XFS_FSB_TO_AGNO(mp, startblock), 1190 - type, XFS_FSB_TO_AGBNO(mp, startblock), 1193 + trace_xfs_refcount_defer(tp->t_mountp, 1194 + XFS_FSB_TO_AGNO(tp->t_mountp, startblock), 1195 + type, XFS_FSB_TO_AGBNO(tp->t_mountp, startblock), 1191 1196 blockcount); 1192 1197 1193 1198 ri = kmem_alloc(sizeof(struct xfs_refcount_intent), ··· 1197 1202 ri->ri_startblock = startblock; 1198 1203 ri->ri_blockcount = blockcount; 1199 1204 1200 - xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_REFCOUNT, &ri->ri_list); 1205 + xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_REFCOUNT, &ri->ri_list); 1201 1206 return 0; 1202 1207 } 1203 1208 ··· 1206 1211 */ 1207 1212 int 1208 1213 xfs_refcount_increase_extent( 1209 - struct xfs_mount *mp, 1210 - struct xfs_defer_ops *dfops, 1214 + struct xfs_trans *tp, 1211 1215 struct xfs_bmbt_irec *PREV) 1212 1216 { 1213 - if (!xfs_sb_version_hasreflink(&mp->m_sb)) 1217 + if (!xfs_sb_version_hasreflink(&tp->t_mountp->m_sb)) 1214 1218 return 0; 1215 1219 1216 - return __xfs_refcount_add(mp, dfops, XFS_REFCOUNT_INCREASE, 1220 + return __xfs_refcount_add(tp, XFS_REFCOUNT_INCREASE, 1217 1221 PREV->br_startblock, PREV->br_blockcount); 1218 1222 } 1219 1223 ··· 1221 1227 */ 1222 1228 int 1223 1229 xfs_refcount_decrease_extent( 1224 - struct xfs_mount *mp, 1225 - struct xfs_defer_ops *dfops, 1230 + struct xfs_trans *tp, 1226 1231 struct xfs_bmbt_irec *PREV) 1227 1232 { 1228 - if (!xfs_sb_version_hasreflink(&mp->m_sb)) 1233 + if (!xfs_sb_version_hasreflink(&tp->t_mountp->m_sb)) 1229 1234 return 0; 1230 1235 1231 - return __xfs_refcount_add(mp, dfops, XFS_REFCOUNT_DECREASE, 1236 + return __xfs_refcount_add(tp, XFS_REFCOUNT_DECREASE, 1232 1237 PREV->br_startblock, PREV->br_blockcount); 1233 1238 } 1234 1239 ··· 1515 1522 __xfs_refcount_cow_alloc( 1516 1523 struct xfs_btree_cur *rcur, 1517 1524 xfs_agblock_t agbno, 1518 - xfs_extlen_t aglen, 1519 - struct xfs_defer_ops *dfops) 1525 + xfs_extlen_t aglen) 1520 1526 { 1521 1527 trace_xfs_refcount_cow_increase(rcur->bc_mp, rcur->bc_private.a.agno, 1522 1528 agbno, aglen); ··· 1532 1540 __xfs_refcount_cow_free( 1533 1541 struct xfs_btree_cur *rcur, 1534 1542 xfs_agblock_t agbno, 1535 - xfs_extlen_t aglen, 1536 - struct xfs_defer_ops *dfops) 1543 + xfs_extlen_t aglen) 1537 1544 { 1538 1545 trace_xfs_refcount_cow_decrease(rcur->bc_mp, rcur->bc_private.a.agno, 1539 1546 agbno, aglen); ··· 1545 1554 /* Record a CoW staging extent in the refcount btree. */ 1546 1555 int 1547 1556 xfs_refcount_alloc_cow_extent( 1548 - struct xfs_mount *mp, 1549 - struct xfs_defer_ops *dfops, 1557 + struct xfs_trans *tp, 1550 1558 xfs_fsblock_t fsb, 1551 1559 xfs_extlen_t len) 1552 1560 { 1561 + struct xfs_mount *mp = tp->t_mountp; 1553 1562 int error; 1554 1563 1555 1564 if (!xfs_sb_version_hasreflink(&mp->m_sb)) 1556 1565 return 0; 1557 1566 1558 - error = __xfs_refcount_add(mp, dfops, XFS_REFCOUNT_ALLOC_COW, 1559 - fsb, len); 1567 + error = __xfs_refcount_add(tp, XFS_REFCOUNT_ALLOC_COW, fsb, len); 1560 1568 if (error) 1561 1569 return error; 1562 1570 1563 1571 /* Add rmap entry */ 1564 - return xfs_rmap_alloc_extent(mp, dfops, XFS_FSB_TO_AGNO(mp, fsb), 1572 + return xfs_rmap_alloc_extent(tp, XFS_FSB_TO_AGNO(mp, fsb), 1565 1573 XFS_FSB_TO_AGBNO(mp, fsb), len, XFS_RMAP_OWN_COW); 1566 1574 } 1567 1575 1568 1576 /* Forget a CoW staging event in the refcount btree. */ 1569 1577 int 1570 1578 xfs_refcount_free_cow_extent( 1571 - struct xfs_mount *mp, 1572 - struct xfs_defer_ops *dfops, 1579 + struct xfs_trans *tp, 1573 1580 xfs_fsblock_t fsb, 1574 1581 xfs_extlen_t len) 1575 1582 { 1583 + struct xfs_mount *mp = tp->t_mountp; 1576 1584 int error; 1577 1585 1578 1586 if (!xfs_sb_version_hasreflink(&mp->m_sb)) 1579 1587 return 0; 1580 1588 1581 1589 /* Remove rmap entry */ 1582 - error = xfs_rmap_free_extent(mp, dfops, XFS_FSB_TO_AGNO(mp, fsb), 1590 + error = xfs_rmap_free_extent(tp, XFS_FSB_TO_AGNO(mp, fsb), 1583 1591 XFS_FSB_TO_AGBNO(mp, fsb), len, XFS_RMAP_OWN_COW); 1584 1592 if (error) 1585 1593 return error; 1586 1594 1587 - return __xfs_refcount_add(mp, dfops, XFS_REFCOUNT_FREE_COW, 1588 - fsb, len); 1595 + return __xfs_refcount_add(tp, XFS_REFCOUNT_FREE_COW, fsb, len); 1589 1596 } 1590 1597 1591 1598 struct xfs_refcount_recovery { ··· 1681 1692 /* Free the orphan record */ 1682 1693 agbno = rr->rr_rrec.rc_startblock - XFS_REFC_COW_START; 1683 1694 fsb = XFS_AGB_TO_FSB(mp, agno, agbno); 1684 - error = xfs_refcount_free_cow_extent(mp, tp->t_dfops, fsb, 1695 + error = xfs_refcount_free_cow_extent(tp, fsb, 1685 1696 rr->rr_rrec.rc_blockcount); 1686 1697 if (error) 1687 1698 goto out_trans; 1688 1699 1689 1700 /* Free the block. */ 1690 - xfs_bmap_add_free(mp, tp->t_dfops, fsb, 1691 - rr->rr_rrec.rc_blockcount, NULL); 1701 + xfs_bmap_add_free(tp, fsb, rr->rr_rrec.rc_blockcount, NULL); 1692 1702 1693 1703 error = xfs_trans_commit(tp); 1694 1704 if (error)
+8 -10
fs/xfs/libxfs/xfs_refcount.h
··· 29 29 xfs_extlen_t ri_blockcount; 30 30 }; 31 31 32 - extern int xfs_refcount_increase_extent(struct xfs_mount *mp, 33 - struct xfs_defer_ops *dfops, struct xfs_bmbt_irec *irec); 34 - extern int xfs_refcount_decrease_extent(struct xfs_mount *mp, 35 - struct xfs_defer_ops *dfops, struct xfs_bmbt_irec *irec); 32 + extern int xfs_refcount_increase_extent(struct xfs_trans *tp, 33 + struct xfs_bmbt_irec *irec); 34 + extern int xfs_refcount_decrease_extent(struct xfs_trans *tp, 35 + struct xfs_bmbt_irec *irec); 36 36 37 37 extern void xfs_refcount_finish_one_cleanup(struct xfs_trans *tp, 38 38 struct xfs_btree_cur *rcur, int error); ··· 45 45 xfs_agblock_t agbno, xfs_extlen_t aglen, xfs_agblock_t *fbno, 46 46 xfs_extlen_t *flen, bool find_end_of_shared); 47 47 48 - extern int xfs_refcount_alloc_cow_extent(struct xfs_mount *mp, 49 - struct xfs_defer_ops *dfops, xfs_fsblock_t fsb, 50 - xfs_extlen_t len); 51 - extern int xfs_refcount_free_cow_extent(struct xfs_mount *mp, 52 - struct xfs_defer_ops *dfops, xfs_fsblock_t fsb, 53 - xfs_extlen_t len); 48 + extern int xfs_refcount_alloc_cow_extent(struct xfs_trans *tp, 49 + xfs_fsblock_t fsb, xfs_extlen_t len); 50 + extern int xfs_refcount_free_cow_extent(struct xfs_trans *tp, 51 + xfs_fsblock_t fsb, xfs_extlen_t len); 54 52 extern int xfs_refcount_recover_cow_leftovers(struct xfs_mount *mp, 55 53 xfs_agnumber_t agno); 56 54
+28 -29
fs/xfs/libxfs/xfs_rmap.c
··· 2277 2277 */ 2278 2278 static int 2279 2279 __xfs_rmap_add( 2280 - struct xfs_mount *mp, 2281 - struct xfs_defer_ops *dfops, 2280 + struct xfs_trans *tp, 2282 2281 enum xfs_rmap_intent_type type, 2283 2282 uint64_t owner, 2284 2283 int whichfork, 2285 2284 struct xfs_bmbt_irec *bmap) 2286 2285 { 2287 - struct xfs_rmap_intent *ri; 2286 + struct xfs_rmap_intent *ri; 2288 2287 2289 - trace_xfs_rmap_defer(mp, XFS_FSB_TO_AGNO(mp, bmap->br_startblock), 2288 + trace_xfs_rmap_defer(tp->t_mountp, 2289 + XFS_FSB_TO_AGNO(tp->t_mountp, bmap->br_startblock), 2290 2290 type, 2291 - XFS_FSB_TO_AGBNO(mp, bmap->br_startblock), 2291 + XFS_FSB_TO_AGBNO(tp->t_mountp, bmap->br_startblock), 2292 2292 owner, whichfork, 2293 2293 bmap->br_startoff, 2294 2294 bmap->br_blockcount, ··· 2301 2301 ri->ri_whichfork = whichfork; 2302 2302 ri->ri_bmap = *bmap; 2303 2303 2304 - xfs_defer_add(dfops, XFS_DEFER_OPS_TYPE_RMAP, &ri->ri_list); 2304 + xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_RMAP, &ri->ri_list); 2305 2305 return 0; 2306 2306 } 2307 2307 2308 2308 /* Map an extent into a file. */ 2309 2309 int 2310 2310 xfs_rmap_map_extent( 2311 - struct xfs_mount *mp, 2312 - struct xfs_defer_ops *dfops, 2311 + struct xfs_trans *tp, 2313 2312 struct xfs_inode *ip, 2314 2313 int whichfork, 2315 2314 struct xfs_bmbt_irec *PREV) 2316 2315 { 2317 - if (!xfs_rmap_update_is_needed(mp, whichfork)) 2316 + if (!xfs_rmap_update_is_needed(tp->t_mountp, whichfork)) 2318 2317 return 0; 2319 2318 2320 - return __xfs_rmap_add(mp, dfops, xfs_is_reflink_inode(ip) ? 2319 + return __xfs_rmap_add(tp, xfs_is_reflink_inode(ip) ? 2321 2320 XFS_RMAP_MAP_SHARED : XFS_RMAP_MAP, ip->i_ino, 2322 2321 whichfork, PREV); 2323 2322 } ··· 2324 2325 /* Unmap an extent out of a file. */ 2325 2326 int 2326 2327 xfs_rmap_unmap_extent( 2327 - struct xfs_mount *mp, 2328 - struct xfs_defer_ops *dfops, 2328 + struct xfs_trans *tp, 2329 2329 struct xfs_inode *ip, 2330 2330 int whichfork, 2331 2331 struct xfs_bmbt_irec *PREV) 2332 2332 { 2333 - if (!xfs_rmap_update_is_needed(mp, whichfork)) 2333 + if (!xfs_rmap_update_is_needed(tp->t_mountp, whichfork)) 2334 2334 return 0; 2335 2335 2336 - return __xfs_rmap_add(mp, dfops, xfs_is_reflink_inode(ip) ? 2336 + return __xfs_rmap_add(tp, xfs_is_reflink_inode(ip) ? 2337 2337 XFS_RMAP_UNMAP_SHARED : XFS_RMAP_UNMAP, ip->i_ino, 2338 2338 whichfork, PREV); 2339 2339 } 2340 2340 2341 - /* Convert a data fork extent from unwritten to real or vice versa. */ 2341 + /* 2342 + * Convert a data fork extent from unwritten to real or vice versa. 2343 + * 2344 + * Note that tp can be NULL here as no transaction is used for COW fork 2345 + * unwritten conversion. 2346 + */ 2342 2347 int 2343 2348 xfs_rmap_convert_extent( 2344 2349 struct xfs_mount *mp, 2345 - struct xfs_defer_ops *dfops, 2350 + struct xfs_trans *tp, 2346 2351 struct xfs_inode *ip, 2347 2352 int whichfork, 2348 2353 struct xfs_bmbt_irec *PREV) ··· 2354 2351 if (!xfs_rmap_update_is_needed(mp, whichfork)) 2355 2352 return 0; 2356 2353 2357 - return __xfs_rmap_add(mp, dfops, xfs_is_reflink_inode(ip) ? 2354 + return __xfs_rmap_add(tp, xfs_is_reflink_inode(ip) ? 2358 2355 XFS_RMAP_CONVERT_SHARED : XFS_RMAP_CONVERT, ip->i_ino, 2359 2356 whichfork, PREV); 2360 2357 } ··· 2362 2359 /* Schedule the creation of an rmap for non-file data. */ 2363 2360 int 2364 2361 xfs_rmap_alloc_extent( 2365 - struct xfs_mount *mp, 2366 - struct xfs_defer_ops *dfops, 2362 + struct xfs_trans *tp, 2367 2363 xfs_agnumber_t agno, 2368 2364 xfs_agblock_t bno, 2369 2365 xfs_extlen_t len, ··· 2370 2368 { 2371 2369 struct xfs_bmbt_irec bmap; 2372 2370 2373 - if (!xfs_rmap_update_is_needed(mp, XFS_DATA_FORK)) 2371 + if (!xfs_rmap_update_is_needed(tp->t_mountp, XFS_DATA_FORK)) 2374 2372 return 0; 2375 2373 2376 - bmap.br_startblock = XFS_AGB_TO_FSB(mp, agno, bno); 2374 + bmap.br_startblock = XFS_AGB_TO_FSB(tp->t_mountp, agno, bno); 2377 2375 bmap.br_blockcount = len; 2378 2376 bmap.br_startoff = 0; 2379 2377 bmap.br_state = XFS_EXT_NORM; 2380 2378 2381 - return __xfs_rmap_add(mp, dfops, XFS_RMAP_ALLOC, owner, 2382 - XFS_DATA_FORK, &bmap); 2379 + return __xfs_rmap_add(tp, XFS_RMAP_ALLOC, owner, XFS_DATA_FORK, &bmap); 2383 2380 } 2384 2381 2385 2382 /* Schedule the deletion of an rmap for non-file data. */ 2386 2383 int 2387 2384 xfs_rmap_free_extent( 2388 - struct xfs_mount *mp, 2389 - struct xfs_defer_ops *dfops, 2385 + struct xfs_trans *tp, 2390 2386 xfs_agnumber_t agno, 2391 2387 xfs_agblock_t bno, 2392 2388 xfs_extlen_t len, ··· 2392 2392 { 2393 2393 struct xfs_bmbt_irec bmap; 2394 2394 2395 - if (!xfs_rmap_update_is_needed(mp, XFS_DATA_FORK)) 2395 + if (!xfs_rmap_update_is_needed(tp->t_mountp, XFS_DATA_FORK)) 2396 2396 return 0; 2397 2397 2398 - bmap.br_startblock = XFS_AGB_TO_FSB(mp, agno, bno); 2398 + bmap.br_startblock = XFS_AGB_TO_FSB(tp->t_mountp, agno, bno); 2399 2399 bmap.br_blockcount = len; 2400 2400 bmap.br_startoff = 0; 2401 2401 bmap.br_state = XFS_EXT_NORM; 2402 2402 2403 - return __xfs_rmap_add(mp, dfops, XFS_RMAP_FREE, owner, 2404 - XFS_DATA_FORK, &bmap); 2403 + return __xfs_rmap_add(tp, XFS_RMAP_FREE, owner, XFS_DATA_FORK, &bmap); 2405 2404 } 2406 2405 2407 2406 /* Compare rmap records. Returns -1 if a < b, 1 if a > b, and 0 if equal. */
+9 -13
fs/xfs/libxfs/xfs_rmap.h
··· 185 185 }; 186 186 187 187 /* functions for updating the rmapbt based on bmbt map/unmap operations */ 188 - int xfs_rmap_map_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 188 + int xfs_rmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip, 189 + int whichfork, struct xfs_bmbt_irec *imap); 190 + int xfs_rmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip, 191 + int whichfork, struct xfs_bmbt_irec *imap); 192 + int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_trans *tp, 189 193 struct xfs_inode *ip, int whichfork, 190 194 struct xfs_bmbt_irec *imap); 191 - int xfs_rmap_unmap_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 192 - struct xfs_inode *ip, int whichfork, 193 - struct xfs_bmbt_irec *imap); 194 - int xfs_rmap_convert_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 195 - struct xfs_inode *ip, int whichfork, 196 - struct xfs_bmbt_irec *imap); 197 - int xfs_rmap_alloc_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 198 - xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, 199 - uint64_t owner); 200 - int xfs_rmap_free_extent(struct xfs_mount *mp, struct xfs_defer_ops *dfops, 201 - xfs_agnumber_t agno, xfs_agblock_t bno, xfs_extlen_t len, 202 - uint64_t owner); 195 + int xfs_rmap_alloc_extent(struct xfs_trans *tp, xfs_agnumber_t agno, 196 + xfs_agblock_t bno, xfs_extlen_t len, uint64_t owner); 197 + int xfs_rmap_free_extent(struct xfs_trans *tp, xfs_agnumber_t agno, 198 + xfs_agblock_t bno, xfs_extlen_t len, uint64_t owner); 203 199 204 200 void xfs_rmap_finish_one_cleanup(struct xfs_trans *tp, 205 201 struct xfs_btree_cur *rcur, int error);
+1 -2
fs/xfs/xfs_bmap_item.c
··· 486 486 irec.br_blockcount = count; 487 487 irec.br_startoff = bmap->me_startoff; 488 488 irec.br_state = state; 489 - error = xfs_bmap_unmap_extent(tp->t_mountp, tp->t_dfops, ip, 490 - &irec); 489 + error = xfs_bmap_unmap_extent(tp, ip, &irec); 491 490 if (error) 492 491 goto err_inode; 493 492 }
+4 -9
fs/xfs/xfs_bmap_util.c
··· 1534 1534 struct xfs_inode *tip) 1535 1535 { 1536 1536 struct xfs_trans *tp = *tpp; 1537 - struct xfs_mount *mp = tp->t_mountp; 1538 1537 struct xfs_bmbt_irec irec; 1539 1538 struct xfs_bmbt_irec uirec; 1540 1539 struct xfs_bmbt_irec tirec; ··· 1597 1598 trace_xfs_swap_extent_rmap_remap_piece(tip, &uirec); 1598 1599 1599 1600 /* Remove the mapping from the donor file. */ 1600 - error = xfs_bmap_unmap_extent(mp, tp->t_dfops, tip, 1601 - &uirec); 1601 + error = xfs_bmap_unmap_extent(tp, tip, &uirec); 1602 1602 if (error) 1603 1603 goto out_defer; 1604 1604 1605 1605 /* Remove the mapping from the source file. */ 1606 - error = xfs_bmap_unmap_extent(mp, tp->t_dfops, ip, 1607 - &irec); 1606 + error = xfs_bmap_unmap_extent(tp, ip, &irec); 1608 1607 if (error) 1609 1608 goto out_defer; 1610 1609 1611 1610 /* Map the donor file's blocks into the source file. */ 1612 - error = xfs_bmap_map_extent(mp, tp->t_dfops, ip, 1613 - &uirec); 1611 + error = xfs_bmap_map_extent(tp, ip, &uirec); 1614 1612 if (error) 1615 1613 goto out_defer; 1616 1614 1617 1615 /* Map the source file's blocks into the donor file. */ 1618 - error = xfs_bmap_map_extent(mp, tp->t_dfops, tip, 1619 - &irec); 1616 + error = xfs_bmap_map_extent(tp, tip, &irec); 1620 1617 if (error) 1621 1618 goto out_defer; 1622 1619
+4 -10
fs/xfs/xfs_refcount_item.c
··· 490 490 irec.br_blockcount = new_len; 491 491 switch (type) { 492 492 case XFS_REFCOUNT_INCREASE: 493 - error = xfs_refcount_increase_extent( 494 - tp->t_mountp, tp->t_dfops, 495 - &irec); 493 + error = xfs_refcount_increase_extent(tp, &irec); 496 494 break; 497 495 case XFS_REFCOUNT_DECREASE: 498 - error = xfs_refcount_decrease_extent( 499 - tp->t_mountp, tp->t_dfops, 500 - &irec); 496 + error = xfs_refcount_decrease_extent(tp, &irec); 501 497 break; 502 498 case XFS_REFCOUNT_ALLOC_COW: 503 - error = xfs_refcount_alloc_cow_extent( 504 - tp->t_mountp, tp->t_dfops, 499 + error = xfs_refcount_alloc_cow_extent(tp, 505 500 irec.br_startblock, 506 501 irec.br_blockcount); 507 502 break; 508 503 case XFS_REFCOUNT_FREE_COW: 509 - error = xfs_refcount_free_cow_extent( 510 - tp->t_mountp, tp->t_dfops, 504 + error = xfs_refcount_free_cow_extent(tp, 511 505 irec.br_startblock, 512 506 irec.br_blockcount); 513 507 break;
+9 -12
fs/xfs/xfs_reflink.c
··· 506 506 ASSERT((*tpp)->t_firstblock == NULLFSBLOCK); 507 507 508 508 /* Free the CoW orphan record. */ 509 - error = xfs_refcount_free_cow_extent(ip->i_mount, 510 - (*tpp)->t_dfops, del.br_startblock, 511 - del.br_blockcount); 509 + error = xfs_refcount_free_cow_extent(*tpp, 510 + del.br_startblock, del.br_blockcount); 512 511 if (error) 513 512 break; 514 513 515 - xfs_bmap_add_free(ip->i_mount, (*tpp)->t_dfops, 516 - del.br_startblock, del.br_blockcount, 517 - NULL); 514 + xfs_bmap_add_free(*tpp, del.br_startblock, 515 + del.br_blockcount, NULL); 518 516 519 517 /* Roll the transaction */ 520 518 error = xfs_defer_finish(tpp); ··· 692 694 trace_xfs_reflink_cow_remap(ip, &del); 693 695 694 696 /* Free the CoW orphan record. */ 695 - error = xfs_refcount_free_cow_extent(tp->t_mountp, tp->t_dfops, 696 - del.br_startblock, del.br_blockcount); 697 + error = xfs_refcount_free_cow_extent(tp, del.br_startblock, 698 + del.br_blockcount); 697 699 if (error) 698 700 goto out_cancel; 699 701 700 702 /* Map the new blocks into the data fork. */ 701 - error = xfs_bmap_map_extent(tp->t_mountp, tp->t_dfops, ip, 702 - &del); 703 + error = xfs_bmap_map_extent(tp, ip, &del); 703 704 if (error) 704 705 goto out_cancel; 705 706 ··· 1043 1046 uirec.br_blockcount, uirec.br_startblock); 1044 1047 1045 1048 /* Update the refcount tree */ 1046 - error = xfs_refcount_increase_extent(mp, tp->t_dfops, &uirec); 1049 + error = xfs_refcount_increase_extent(tp, &uirec); 1047 1050 if (error) 1048 1051 goto out_cancel; 1049 1052 1050 1053 /* Map the new blocks into the data fork. */ 1051 - error = xfs_bmap_map_extent(mp, tp->t_dfops, ip, &uirec); 1054 + error = xfs_bmap_map_extent(tp, ip, &uirec); 1052 1055 if (error) 1053 1056 goto out_cancel; 1054 1057