From: Dave Chinner Date: Tue, 9 May 2023 09:30:43 +0000 (+0200) Subject: xfs: use xfs_bmap_longest_free_extent() in filestreams X-Git-Tag: v6.3.0~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=c92d3040144be827dc4670a849b5e2e0f7858cda;p=xfsprogs-dev.git xfs: use xfs_bmap_longest_free_extent() in filestreams 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 Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 844385bf4..7c5039d08 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -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, diff --git a/libxfs/xfs_bmap.h b/libxfs/xfs_bmap.h index 524912f27..b52cfdcb9 100644 --- a/libxfs/xfs_bmap.h +++ b/libxfs/xfs_bmap.h @@ -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);