xfs: remove unnecessary int returns from deferred bmap functions
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 27 Aug 2019 00:06:04 +0000 (17:06 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 28 Aug 2019 15:31:02 +0000 (08:31 -0700)
Remove the return value from the functions that schedule deferred bmap
operations since they never fail and do not return status.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap.h
fs/xfs/xfs_bmap_item.c
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_reflink.c

index fca226c..05aedf4 100644 (file)
@@ -6085,29 +6085,29 @@ __xfs_bmap_add(
 }
 
 /* Map an extent into a file. */
-int
+void
 xfs_bmap_map_extent(
        struct xfs_trans        *tp,
        struct xfs_inode        *ip,
        struct xfs_bmbt_irec    *PREV)
 {
        if (!xfs_bmap_is_update_needed(PREV))
-               return 0;
+               return;
 
-       return __xfs_bmap_add(tp, XFS_BMAP_MAP, ip, XFS_DATA_FORK, PREV);
+       __xfs_bmap_add(tp, XFS_BMAP_MAP, ip, XFS_DATA_FORK, PREV);
 }
 
 /* Unmap an extent out of a file. */
-int
+void
 xfs_bmap_unmap_extent(
        struct xfs_trans        *tp,
        struct xfs_inode        *ip,
        struct xfs_bmbt_irec    *PREV)
 {
        if (!xfs_bmap_is_update_needed(PREV))
-               return 0;
+               return;
 
-       return __xfs_bmap_add(tp, XFS_BMAP_UNMAP, ip, XFS_DATA_FORK, PREV);
+       __xfs_bmap_add(tp, XFS_BMAP_UNMAP, ip, XFS_DATA_FORK, PREV);
 }
 
 /*
index 8f597f9..c409871 100644 (file)
@@ -254,9 +254,9 @@ int xfs_bmap_finish_one(struct xfs_trans *tp, struct xfs_inode *ip,
                enum xfs_bmap_intent_type type, int whichfork,
                xfs_fileoff_t startoff, xfs_fsblock_t startblock,
                xfs_filblks_t *blockcount, xfs_exntst_t state);
-int    xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
+void   xfs_bmap_map_extent(struct xfs_trans *tp, struct xfs_inode *ip,
                struct xfs_bmbt_irec *imap);
-int    xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip,
+void   xfs_bmap_unmap_extent(struct xfs_trans *tp, struct xfs_inode *ip,
                struct xfs_bmbt_irec *imap);
 
 static inline int xfs_bmap_fork_to_state(int whichfork)
index 989163e..83d24e9 100644 (file)
@@ -542,9 +542,7 @@ xfs_bui_recover(
                irec.br_blockcount = count;
                irec.br_startoff = bmap->me_startoff;
                irec.br_state = state;
-               error = xfs_bmap_unmap_extent(tp, ip, &irec);
-               if (error)
-                       goto err_inode;
+               xfs_bmap_unmap_extent(tp, ip, &irec);
        }
 
        set_bit(XFS_BUI_RECOVERED, &buip->bui_flags);
index 98c6a7a..e12f0ba 100644 (file)
@@ -1532,24 +1532,16 @@ xfs_swap_extent_rmap(
                        trace_xfs_swap_extent_rmap_remap_piece(tip, &uirec);
 
                        /* Remove the mapping from the donor file. */
-                       error = xfs_bmap_unmap_extent(tp, tip, &uirec);
-                       if (error)
-                               goto out;
+                       xfs_bmap_unmap_extent(tp, tip, &uirec);
 
                        /* Remove the mapping from the source file. */
-                       error = xfs_bmap_unmap_extent(tp, ip, &irec);
-                       if (error)
-                               goto out;
+                       xfs_bmap_unmap_extent(tp, ip, &irec);
 
                        /* Map the donor file's blocks into the source file. */
-                       error = xfs_bmap_map_extent(tp, ip, &uirec);
-                       if (error)
-                               goto out;
+                       xfs_bmap_map_extent(tp, ip, &uirec);
 
                        /* Map the source file's blocks into the donor file. */
-                       error = xfs_bmap_map_extent(tp, tip, &irec);
-                       if (error)
-                               goto out;
+                       xfs_bmap_map_extent(tp, tip, &irec);
 
                        error = xfs_defer_finish(tpp);
                        tp = *tpp;
index eae128e..0f08153 100644 (file)
@@ -676,9 +676,7 @@ xfs_reflink_end_cow_extent(
        xfs_refcount_free_cow_extent(tp, del.br_startblock, del.br_blockcount);
 
        /* Map the new blocks into the data fork. */
-       error = xfs_bmap_map_extent(tp, ip, &del);
-       if (error)
-               goto out_cancel;
+       xfs_bmap_map_extent(tp, ip, &del);
 
        /* Charge this new data fork mapping to the on-disk quota. */
        xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_DELBCOUNT,
@@ -1068,9 +1066,7 @@ xfs_reflink_remap_extent(
                xfs_refcount_increase_extent(tp, &uirec);
 
                /* Map the new blocks into the data fork. */
-               error = xfs_bmap_map_extent(tp, ip, &uirec);
-               if (error)
-                       goto out_cancel;
+               xfs_bmap_map_extent(tp, ip, &uirec);
 
                /* Update quota accounting. */
                xfs_trans_mod_dquot_byino(tp, ip, XFS_TRANS_DQ_BCOUNT,