]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: use xfs_bmap_longest_free_extent() in filestreams
authorDave Chinner <dchinner@redhat.com>
Tue, 9 May 2023 09:30:43 +0000 (11:30 +0200)
committerCarlos Maiolino <cem@kernel.org>
Wed, 10 May 2023 12:58:31 +0000 (14:58 +0200)
Source kernel commit: 05cf492a8d01f48d4b8d8f0b93f2d75de7349f12

The code in xfs_bmap_longest_free_extent() is open coded in
xfs_filestream_pick_ag(). Export xfs_bmap_longest_free_extent and
call it from the filestreams code instead.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h

index 844385bf496ec06f17d12d9ef8e1db610bfa7f94..7c5039d08d3202a4c51943330099e2a03ada8425 100644 (file)
@@ -3128,7 +3128,7 @@ xfs_bmap_adjacent(
 #undef ISVALID
 }
 
-static int
+int
 xfs_bmap_longest_free_extent(
        struct xfs_perag        *pag,
        struct xfs_trans        *tp,
index 524912f276f87857febc10647a9e71e740d18e89..b52cfdcb932062660589fa4966c15bbb595cbaff 100644 (file)
@@ -168,6 +168,8 @@ static inline bool xfs_bmap_is_written_extent(struct xfs_bmbt_irec *irec)
 #define xfs_valid_startblock(ip, startblock) \
        ((startblock) != 0 || XFS_IS_REALTIME_INODE(ip))
 
+int    xfs_bmap_longest_free_extent(struct xfs_perag *pag,
+               struct xfs_trans *tp, xfs_extlen_t *blen);
 void   xfs_trim_extent(struct xfs_bmbt_irec *irec, xfs_fileoff_t bno,
                xfs_filblks_t len);
 unsigned int xfs_bmap_compute_attr_offset(struct xfs_mount *mp);