xfs: remove xfs_trans_get_block_res
PATCH 1/1 xfs: remove xfs_trans_get_block_res
Just use the t_blk_res field directly instead of obsfucating the reference by a macro.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/xfs/libxfs/xfs_bmap.c | 6 +++--- fs/xfs/libxfs/xfs_bmap_btree.c | 4 ++-- fs/xfs/xfs_trans.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-)
fs/xfs/libxfs/xfs_bmap.c +3 -3
@@ -5707,7 +5707,7 @@ xfs_bunmapi(* This is better than zeroing it. */ ASSERT (del.br_state ==XFS_EXT_NORM ); -ASSERT (xfs_trans_get_block_res (tp) >0 ); +ASSERT (tp->t_blk_res >0 );/* * If this spans a realtime extent boundary, * chop it back to the start of the one we end at.
@@ -5738,7 +5738,7 @@ xfs_bunmapi( del.br_startblock += mod; }else if ((del.br_startoff == start && (del.br_state ==XFS_EXT_UNWRITTEN || -xfs_trans_get_block_res (tp) ==0 )) || + tp->t_blk_res ==0 )) || !xfs_sb_version_hasextflgbit (&mp->m_sb)) {/* * Can't make it unwritten. There isn't
@@ -5829,7 +5829,7 @@ xfs_bunmapi(* conversion to btree format, since the transaction * will be dirty. */ - if (!wasdel && xfs_trans_get_block_res(tp) == 0 && + if (!wasdel && tp->t_blk_res == 0 && XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ XFS_IFORK_MAXEXT(ip, whichfork) &&
fs/xfs/libxfs/xfs_bmap_btree.c +2 -2
@@ -464,7 +464,7 @@ try_another_ag:* reservation amount is insufficient then we may fail a * block allocation here and corrupt the filesystem. */ - args.minleft =xfs_trans_get_block_res (args.tp); + args.minleft = args.tp->t_blk_res; }else if (cur->bc_private.b.flist->xbf_low) { args.type =XFS_ALLOCTYPE_START_BNO ; }else {
@@ -473,7 +473,7 @@ try_another_ag: args.minlen = args.maxlen = args.prod =1 ; args.wasdel = cur->bc_private.b.flags &XFS_BTCUR_BPRV_WASDEL ; -if (!args.wasdel &&xfs_trans_get_block_res (args.tp) ==0 ) { +if (!args.wasdel && args.tp->t_blk_res ==0 ) { error = -ENOSPC ; goto error0; }
fs/xfs/xfs_trans.h +0 -1
@@ -133,7 +133,6 @@ typedef struct xfs_trans {* XFS transaction mechanism exported interfaces that are * actually macros. */ -#define xfs_trans_get_block_res (tp) ((tp)->t_blk_res)#define xfs_trans_set_sync (tp) ((tp)->t_flags |= XFS_TRANS_SYNC)#if defined(DEBUG ) || defined(XFS_WARN )
Signature · 6 lines
2.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 5 lines · Christoph Hellwig
Just use the
t_blk_resfield directly instead of obsfucating the reference by a macro.Signed-off-by Christoph Hellwig <[email protected]>---
Reviewed-by Brian Foster <[email protected]>
Quoted 77 lines
fs/xfs/libxfs/xfs_bmap.c | 6 +++--- fs/xfs/libxfs/xfs_bmap_btree.c | 4 ++-- fs/xfs/xfs_trans.h | 1 - 3 files changed, 5 insertions(+), 6 deletions(-)fs/xfs/libxfs/xfs_bmap.c +3
-3@@ -5707,7 +5707,7 @@ xfs_bunmapi(* This is better than zeroing it. */ ASSERT (del.br_state ==XFS_EXT_NORM ); -ASSERT (xfs_trans_get_block_res (tp) >0 ); +ASSERT (tp->t_blk_res >0 );/* * If this spans a realtime extent boundary, * chop it back to the start of the one we end at. @@ -5738,7 +5738,7 @@ xfs_bunmapi( del.br_startblock += mod; }else if ((del.br_startoff == start && (del.br_state ==XFS_EXT_UNWRITTEN || -xfs_trans_get_block_res (tp) ==0 )) || + tp->t_blk_res ==0 )) || !xfs_sb_version_hasextflgbit (&mp->m_sb)) {/* * Can't make it unwritten. There isn't @@ -5829,7 +5829,7 @@ xfs_bunmapi(* conversion to btree format, since the transaction * will be dirty. */ - if (!wasdel && xfs_trans_get_block_res(tp) == 0 && + if (!wasdel && tp->t_blk_res == 0 && XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_EXTENTS && XFS_IFORK_NEXTENTS(ip, whichfork) >= /* Note the >= */ XFS_IFORK_MAXEXT(ip, whichfork) &&fs/xfs/libxfs/xfs_bmap_btree.c +2
-2@@ -464,7 +464,7 @@ try_another_ag:* reservation amount is insufficient then we may fail a * block allocation here and corrupt the filesystem. */ - args.minleft =xfs_trans_get_block_res (args.tp); + args.minleft = args.tp->t_blk_res; }else if (cur->bc_private.b.flist->xbf_low) { args.type =XFS_ALLOCTYPE_START_BNO ; }else {@@ -473,7 +473,7 @@ try_another_ag: args.minlen = args.maxlen = args.prod =1 ; args.wasdel = cur->bc_private.b.flags &XFS_BTCUR_BPRV_WASDEL ; -if (!args.wasdel &&xfs_trans_get_block_res (args.tp) ==0 ) { +if (!args.wasdel && args.tp->t_blk_res ==0 ) { error = -ENOSPC ; goto error0; }fs/xfs/xfs_trans.h +0
-1@@ -133,7 +133,6 @@ typedef struct xfs_trans {* XFS transaction mechanism exported interfaces that are * actually macros. */ -#define xfs_trans_get_block_res (tp) ((tp)->t_blk_res)#define xfs_trans_set_sync (tp) ((tp)->t_flags |= XFS_TRANS_SYNC)#if defined(DEBUG ) || defined(XFS_WARN )Signature · 6 lines
2.1.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs