]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: always pass a valid hdr to xfs_dir3_leaf_check_int
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2020 16:29:44 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:44 +0000 (11:29 -0500)
Source kernel commit: 23220fe260c4b307da1c1fa82a944c50bf0742e4

Move the code for extracting the incore header to the only caller that
didn't already do that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_dir2_leaf.c

index c3b327220fe7c30042a47ec94285edde88becb3c..72b97a328d348b063e4158c1779f599b23ed7aee 100644 (file)
@@ -135,20 +135,14 @@ xfs_dir3_leaf_check(
 
 xfs_failaddr_t
 xfs_dir3_leaf_check_int(
-       struct xfs_mount        *mp,
-       struct xfs_dir3_icleaf_hdr *hdr,
-       struct xfs_dir2_leaf    *leaf)
+       struct xfs_mount                *mp,
+       struct xfs_dir3_icleaf_hdr      *hdr,
+       struct xfs_dir2_leaf            *leaf)
 {
-       xfs_dir2_leaf_tail_t    *ltp;
-       int                     stale;
-       int                     i;
-       struct xfs_dir3_icleaf_hdr leafhdr;
-       struct xfs_da_geometry  *geo = mp->m_dir_geo;
-
-       if (!hdr) {
-               xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
-               hdr = &leafhdr;
-       }
+       struct xfs_da_geometry          *geo = mp->m_dir_geo;
+       xfs_dir2_leaf_tail_t            *ltp;
+       int                             stale;
+       int                             i;
 
        ltp = xfs_dir2_leaf_tail_p(geo, leaf);
 
@@ -188,17 +182,18 @@ xfs_dir3_leaf_check_int(
  */
 static xfs_failaddr_t
 xfs_dir3_leaf_verify(
-       struct xfs_buf          *bp)
+       struct xfs_buf                  *bp)
 {
-       struct xfs_mount        *mp = bp->b_mount;
-       struct xfs_dir2_leaf    *leaf = bp->b_addr;
-       xfs_failaddr_t          fa;
+       struct xfs_mount                *mp = bp->b_mount;
+       struct xfs_dir3_icleaf_hdr      leafhdr;
+       xfs_failaddr_t                  fa;
 
        fa = xfs_da3_blkinfo_verify(bp, bp->b_addr);
        if (fa)
                return fa;
 
-       return xfs_dir3_leaf_check_int(mp, NULL, leaf);
+       xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, bp->b_addr);
+       return xfs_dir3_leaf_check_int(mp, &leafhdr, bp->b_addr);
 }
 
 static void