xfs: move buffer invalidation to xfs_btree_free_block
authorChristoph Hellwig <hch@lst.de>
Mon, 8 Feb 2016 03:58:07 +0000 (14:58 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 8 Feb 2016 03:58:07 +0000 (14:58 +1100)
... instead of leaving it in the methods.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_alloc_btree.c
fs/xfs/libxfs/xfs_bmap_btree.c
fs/xfs/libxfs/xfs_btree.c
fs/xfs/libxfs/xfs_ialloc_btree.c

index 444626ddbd1b9ba2baca676b48a62d90299d515e..d9b42425291e37c6a4845c21dd0e1f61d8a76e86 100644 (file)
@@ -118,8 +118,6 @@ xfs_allocbt_free_block(
        xfs_extent_busy_insert(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1,
                              XFS_EXTENT_BUSY_SKIP_DISCARD);
        xfs_trans_agbtree_delta(cur->bc_tp, -1);
-
-       xfs_trans_binval(cur->bc_tp, bp);
        return 0;
 }
 
index 1637c37bfbaa1cb61ef69e48c52eb95716ecd649..e37508ae589b11ef4009129c82b3a3cce98f3ca6 100644 (file)
@@ -531,7 +531,6 @@ xfs_bmbt_free_block(
 
        xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
        xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT, -1L);
-       xfs_trans_binval(tp, bp);
        return 0;
 }
 
index 77afb4a899b9d2fea1c08dc75d1a50879a0a650e..1f88e1ce770f35442f0161466632c68fe0e46153 100644 (file)
@@ -302,8 +302,10 @@ xfs_btree_free_block(
        int                     error;
 
        error = cur->bc_ops->free_block(cur, bp);
-       if (!error)
+       if (!error) {
+               xfs_trans_binval(cur->bc_tp, bp);
                XFS_BTREE_STATS_INC(cur, free);
+       }
        return error;
 }
 
index c679f3c05b63cb535de34e7de5543a75ac57faac..89c21d771e35edbc026eb7fe7cb373280774b162 100644 (file)
@@ -125,16 +125,8 @@ xfs_inobt_free_block(
        struct xfs_btree_cur    *cur,
        struct xfs_buf          *bp)
 {
-       xfs_fsblock_t           fsbno;
-       int                     error;
-
-       fsbno = XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp));
-       error = xfs_free_extent(cur->bc_tp, fsbno, 1);
-       if (error)
-               return error;
-
-       xfs_trans_binval(cur->bc_tp, bp);
-       return error;
+       return xfs_free_extent(cur->bc_tp,
+                       XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)), 1);
 }
 
 STATIC int
This page took 0.027786 seconds and 5 git commands to generate.