xfs_trim_extent(&imap, offset_fsb, end_fsb - offset_fsb);
 
                /* Trim the mapping to the nearest shared extent boundary. */
-               error = xfs_inode_need_cow(ip, &imap, &shared);
+               error = xfs_bmap_trim_cow(ip, &imap, &shared);
                if (error)
                        goto out_unlock;
 
 
        }
 }
 
-bool
-xfs_inode_need_cow(
+int
+xfs_bmap_trim_cow(
        struct xfs_inode        *ip,
        struct xfs_bmbt_irec    *imap,
        bool                    *shared)
        if (cmap->br_startoff > offset_fsb) {
                xfs_trim_extent(imap, imap->br_startoff,
                                cmap->br_startoff - imap->br_startoff);
-               return xfs_inode_need_cow(ip, imap, shared);
+               return xfs_bmap_trim_cow(ip, imap, shared);
        }
 
        *shared = true;
 
                xfs_agblock_t *fbno, xfs_extlen_t *flen, bool find_maximal);
 extern int xfs_reflink_trim_around_shared(struct xfs_inode *ip,
                struct xfs_bmbt_irec *irec, bool *shared);
-bool xfs_inode_need_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,
+int xfs_bmap_trim_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,
                bool *shared);
 
 int xfs_reflink_allocate_cow(struct xfs_inode *ip, struct xfs_bmbt_irec *imap,