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

xfs: remove dfops parameter from ifree call stack

The inode free callchain starting in xfs_inactive_ifree() already
associates its dfops with the transaction. It still passes the dfops
on the stack down through xfs_difree_inobt(), however.

Clean up the call stack and reference dfops directly from the
transaction. This patch does not change behavior.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by

Brian Foster and committed by
Darrick J. Wong
0e0417f3 6aa67184

+7 -12
+2 -4
fs/xfs/libxfs/xfs_ialloc.c
··· 1915 1915 struct xfs_trans *tp, 1916 1916 struct xfs_buf *agbp, 1917 1917 xfs_agino_t agino, 1918 - struct xfs_defer_ops *dfops, 1919 1918 struct xfs_icluster *xic, 1920 1919 struct xfs_inobt_rec_incore *orec) 1921 1920 { ··· 2002 2003 goto error0; 2003 2004 } 2004 2005 2005 - xfs_difree_inode_chunk(mp, agno, &rec, dfops); 2006 + xfs_difree_inode_chunk(mp, agno, &rec, tp->t_dfops); 2006 2007 } else { 2007 2008 xic->deleted = false; 2008 2009 ··· 2147 2148 xfs_difree( 2148 2149 struct xfs_trans *tp, /* transaction pointer */ 2149 2150 xfs_ino_t inode, /* inode to be freed */ 2150 - struct xfs_defer_ops *dfops, /* extents to free */ 2151 2151 struct xfs_icluster *xic) /* cluster info if deleted */ 2152 2152 { 2153 2153 /* REFERENCED */ ··· 2198 2200 /* 2199 2201 * Fix up the inode allocation btree. 2200 2202 */ 2201 - error = xfs_difree_inobt(mp, tp, agbp, agino, dfops, xic, &rec); 2203 + error = xfs_difree_inobt(mp, tp, agbp, agino, xic, &rec); 2202 2204 if (error) 2203 2205 goto error0; 2204 2206
-1
fs/xfs/libxfs/xfs_ialloc.h
··· 82 82 xfs_difree( 83 83 struct xfs_trans *tp, /* transaction pointer */ 84 84 xfs_ino_t inode, /* inode to be freed */ 85 - struct xfs_defer_ops *dfops, /* extents to free */ 86 85 struct xfs_icluster *ifree); /* cluster info if deleted */ 87 86 88 87 /*
+4 -5
fs/xfs/xfs_inode.c
··· 1814 1814 1815 1815 xfs_defer_init(&dfops, &first_block); 1816 1816 tp->t_dfops = &dfops; 1817 - error = xfs_ifree(tp, ip, &dfops); 1817 + error = xfs_ifree(tp, ip); 1818 1818 if (error) { 1819 1819 /* 1820 1820 * If we fail to free the inode, shut down. The cancel ··· 2445 2445 */ 2446 2446 int 2447 2447 xfs_ifree( 2448 - xfs_trans_t *tp, 2449 - xfs_inode_t *ip, 2450 - struct xfs_defer_ops *dfops) 2448 + struct xfs_trans *tp, 2449 + struct xfs_inode *ip) 2451 2450 { 2452 2451 int error; 2453 2452 struct xfs_icluster xic = { 0 }; ··· 2465 2466 if (error) 2466 2467 return error; 2467 2468 2468 - error = xfs_difree(tp, ip->i_ino, dfops, &xic); 2469 + error = xfs_difree(tp, ip->i_ino, &xic); 2469 2470 if (error) 2470 2471 return error; 2471 2472
+1 -2
fs/xfs/xfs_inode.h
··· 415 415 uint xfs_ilock_attr_map_shared(struct xfs_inode *); 416 416 417 417 uint xfs_ip2xflags(struct xfs_inode *); 418 - int xfs_ifree(struct xfs_trans *, xfs_inode_t *, 419 - struct xfs_defer_ops *); 418 + int xfs_ifree(struct xfs_trans *, struct xfs_inode *); 420 419 int xfs_itruncate_extents_flags(struct xfs_trans **, 421 420 struct xfs_inode *, int, xfs_fsize_t, int); 422 421 void xfs_iext_realloc(xfs_inode_t *, int, int);