]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: use new extent lookup helpers in bmap_next_offset
authorEric Sandeen <sandeen@sandeen.net>
Tue, 10 Jan 2017 02:18:47 +0000 (20:18 -0600)
committerEric Sandeen <sandeen@redhat.com>
Tue, 10 Jan 2017 02:18:47 +0000 (20:18 -0600)
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/libxfs_api_defs.h
repair/phase6.c

index b7b104350881eb1fc0b2b6283bae4ffde4f8a039..31239caad72d0911d788fe0ff879ec92483c78ed 100644 (file)
@@ -67,6 +67,7 @@
 #define xfs_alloc_read_agf             libxfs_alloc_read_agf
 #define xfs_bmap_last_offset           libxfs_bmap_last_offset
 #define xfs_bmap_search_extents                libxfs_bmap_search_extents
+#define xfs_iext_lookup_extent         libxfs_iext_lookup_extent
 #define xfs_bmapi_write                        libxfs_bmapi_write
 #define xfs_bmapi_read                 libxfs_bmapi_read
 #define xfs_bunmapi                    libxfs_bunmapi
index 399ecde36e2ef8810a87fd0548093f41d3084b73..3eb7cf1eecb15fb97969ef570b546d8cc388fea1 100644 (file)
@@ -434,12 +434,10 @@ bmap_next_offset(
        int             whichfork)              /* data or attr fork */
 {
        xfs_fileoff_t   bno;                    /* current block */
-       int             eof;                    /* hit end of file */
        int             error;                  /* error return value */
        xfs_bmbt_irec_t got;                    /* current extent value */
        xfs_ifork_t     *ifp;                   /* inode fork pointer */
-       xfs_extnum_t    lastx;                  /* last extent used */
-       xfs_bmbt_irec_t prev;                   /* previous extent value */
+       xfs_extnum_t    idx;                    /* last extent used */
 
        if (XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE &&
            XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS &&
@@ -454,9 +452,7 @@ bmap_next_offset(
            (error = -libxfs_iread_extents(tp, ip, whichfork)))
                return error;
        bno = *bnop + 1;
-       libxfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx,
-                                  &got, &prev);
-       if (eof)
+       if (!libxfs_iext_lookup_extent(ip, ifp, bno, &idx, &got))
                *bnop = NULLFILEOFF;
        else
                *bnop = got.br_startoff < bno ? bno : got.br_startoff;