]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: devirtualize ->leaf_hdr_from_disk
authorChristoph Hellwig <hch@lst.de>
Wed, 22 Jan 2020 16:29:41 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:41 +0000 (11:29 -0500)
Source kernel commit: 518425560a8b6ec7516505846c1b79623b467148

Replace the ->leaf_hdr_from_disk dir ops method with a directly called
xfs_dir2_leaf_hdr_from_disk helper that takes care of the differences
between the v4 and v5 on-disk format.

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>
12 files changed:
db/btdump.c
db/metadump.c
libxfs/libxfs_api_defs.h
libxfs/xfs_da_btree.c
libxfs/xfs_da_format.c
libxfs/xfs_dir2.h
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
libxfs/xfs_dir2_priv.h
repair/dir2.c
repair/phase6.c

index a6d0bc1707f3469ef66d87fe9bb9880b99e4b7ad..920f595b4e6926bc3679b3a79a4636351f8f23a5 100644 (file)
@@ -215,7 +215,7 @@ dir_has_rightsib(
                libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
                return nhdr.forw != 0;
        }
-       M_DIROPS(mp)->leaf_hdr_from_disk(&lhdr, block);
+       libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
        return lhdr.forw != 0;
 }
 
@@ -229,7 +229,7 @@ dir_level(
        switch (((struct xfs_da_intnode *)block)->hdr.info.magic) {
        case cpu_to_be16(XFS_DIR2_LEAF1_MAGIC):
        case cpu_to_be16(XFS_DIR2_LEAFN_MAGIC):
-               M_DIROPS(mp)->leaf_hdr_from_disk(&lhdr, block);
+               libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
                return 0;
        case cpu_to_be16(XFS_DA_NODE_MAGIC):
                libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
@@ -249,7 +249,7 @@ dir3_level(
        switch (((struct xfs_da_intnode *)block)->hdr.info.magic) {
        case cpu_to_be16(XFS_DIR3_LEAF1_MAGIC):
        case cpu_to_be16(XFS_DIR3_LEAFN_MAGIC):
-               M_DIROPS(mp)->leaf_hdr_from_disk(&lhdr, block);
+               libxfs_dir2_leaf_hdr_from_disk(mp, &lhdr, block);
                return 0;
        case cpu_to_be16(XFS_DA3_NODE_MAGIC):
                libxfs_da3_node_hdr_from_disk(mp, &nhdr, block);
index bdec7bb22e76741d3cadb5c44a9272f1bf248150..8c14c5cb8fd2a3c7a841fba2f6f632ac5416d26b 100644 (file)
@@ -1471,7 +1471,7 @@ process_dir_leaf_block(
 
        /* Yes, this works for dir2 & dir3.  Difference is padding. */
        leaf = (struct xfs_dir2_leaf *)block;
-       M_DIROPS(mp)->leaf_hdr_from_disk(&leafhdr, leaf);
+       libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
        switch (leafhdr.magic) {
        case XFS_DIR2_LEAF1_MAGIC:
index bc3b099838b3cc60a3d4c6af46940a1c4389e37d..889d4e52edd2bf813e60839fc1386ab4e2707eb5 100644 (file)
@@ -75,6 +75,7 @@
 #define xfs_dir_init                   libxfs_dir_init
 #define xfs_dir_lookup                 libxfs_dir_lookup
 #define xfs_dir_replace                        libxfs_dir_replace
+#define xfs_dir2_leaf_hdr_from_disk    libxfs_dir2_leaf_hdr_from_disk
 #define xfs_dir2_isblock               libxfs_dir2_isblock
 #define xfs_dir2_isleaf                        libxfs_dir2_isleaf
 #define xfs_dir2_data_freescan_int     libxfs_dir2_data_freescan_int
index f52e738e5d15269cfa0dd1454415a87c5a5ec230..ab3b319cb2b1e9d909853c0484b28bc2cc107650 100644 (file)
@@ -640,7 +640,7 @@ xfs_da3_root_split(
                struct xfs_dir2_leaf_entry *ents;
 
                leaf = (xfs_dir2_leaf_t *)oldroot;
-               dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+               xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
                ents = dp->d_ops->leaf_ents_p(leaf);
 
                ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC ||
@@ -2292,7 +2292,8 @@ xfs_da3_swap_lastblock(
                struct xfs_dir2_leaf_entry *ents;
 
                dead_leaf2 = (xfs_dir2_leaf_t *)dead_info;
-               dp->d_ops->leaf_hdr_from_disk(&leafhdr, dead_leaf2);
+               xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr,
+                                           dead_leaf2);
                ents = dp->d_ops->leaf_ents_p(dead_leaf2);
                dead_level = 0;
                dead_hash = be32_to_cpu(ents[leafhdr.count - 1].hashval);
index 436ea2d7fca00c53ea30dc7bc8ac19e5dcae70b4..c342f8b8afe6961af5146ae925507bbef5d4c872 100644 (file)
@@ -430,21 +430,6 @@ xfs_dir3_leaf_ents_p(struct xfs_dir2_leaf *lp)
        return ((struct xfs_dir3_leaf *)lp)->__ents;
 }
 
-static void
-xfs_dir2_leaf_hdr_from_disk(
-       struct xfs_dir3_icleaf_hdr      *to,
-       struct xfs_dir2_leaf            *from)
-{
-       to->forw = be32_to_cpu(from->hdr.info.forw);
-       to->back = be32_to_cpu(from->hdr.info.back);
-       to->magic = be16_to_cpu(from->hdr.info.magic);
-       to->count = be16_to_cpu(from->hdr.count);
-       to->stale = be16_to_cpu(from->hdr.stale);
-
-       ASSERT(to->magic == XFS_DIR2_LEAF1_MAGIC ||
-              to->magic == XFS_DIR2_LEAFN_MAGIC);
-}
-
 static void
 xfs_dir2_leaf_hdr_to_disk(
        struct xfs_dir2_leaf            *to,
@@ -460,23 +445,6 @@ xfs_dir2_leaf_hdr_to_disk(
        to->hdr.stale = cpu_to_be16(from->stale);
 }
 
-static void
-xfs_dir3_leaf_hdr_from_disk(
-       struct xfs_dir3_icleaf_hdr      *to,
-       struct xfs_dir2_leaf            *from)
-{
-       struct xfs_dir3_leaf_hdr *hdr3 = (struct xfs_dir3_leaf_hdr *)from;
-
-       to->forw = be32_to_cpu(hdr3->info.hdr.forw);
-       to->back = be32_to_cpu(hdr3->info.hdr.back);
-       to->magic = be16_to_cpu(hdr3->info.hdr.magic);
-       to->count = be16_to_cpu(hdr3->count);
-       to->stale = be16_to_cpu(hdr3->stale);
-
-       ASSERT(to->magic == XFS_DIR3_LEAF1_MAGIC ||
-              to->magic == XFS_DIR3_LEAFN_MAGIC);
-}
-
 static void
 xfs_dir3_leaf_hdr_to_disk(
        struct xfs_dir2_leaf            *to,
@@ -648,7 +616,6 @@ static const struct xfs_dir_ops xfs_dir2_ops = {
 
        .leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr),
        .leaf_hdr_to_disk = xfs_dir2_leaf_hdr_to_disk,
-       .leaf_hdr_from_disk = xfs_dir2_leaf_hdr_from_disk,
        .leaf_max_ents = xfs_dir2_max_leaf_ents,
        .leaf_ents_p = xfs_dir2_leaf_ents_p,
 
@@ -693,7 +660,6 @@ static const struct xfs_dir_ops xfs_dir2_ftype_ops = {
 
        .leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr),
        .leaf_hdr_to_disk = xfs_dir2_leaf_hdr_to_disk,
-       .leaf_hdr_from_disk = xfs_dir2_leaf_hdr_from_disk,
        .leaf_max_ents = xfs_dir2_max_leaf_ents,
        .leaf_ents_p = xfs_dir2_leaf_ents_p,
 
@@ -738,7 +704,6 @@ static const struct xfs_dir_ops xfs_dir3_ops = {
 
        .leaf_hdr_size = sizeof(struct xfs_dir3_leaf_hdr),
        .leaf_hdr_to_disk = xfs_dir3_leaf_hdr_to_disk,
-       .leaf_hdr_from_disk = xfs_dir3_leaf_hdr_from_disk,
        .leaf_max_ents = xfs_dir3_max_leaf_ents,
        .leaf_ents_p = xfs_dir3_leaf_ents_p,
 
index 87fe876e90edda98da97b7b35a343da2de694d7d..74c592496bf0ce8d68d2722f4142af7924cea8d5 100644 (file)
@@ -75,8 +75,6 @@ struct xfs_dir_ops {
        int     leaf_hdr_size;
        void    (*leaf_hdr_to_disk)(struct xfs_dir2_leaf *to,
                                    struct xfs_dir3_icleaf_hdr *from);
-       void    (*leaf_hdr_from_disk)(struct xfs_dir3_icleaf_hdr *to,
-                                     struct xfs_dir2_leaf *from);
        int     (*leaf_max_ents)(struct xfs_da_geometry *geo);
        struct xfs_dir2_leaf_entry *
                (*leaf_ents_p)(struct xfs_dir2_leaf *lp);
index 95965914c709e1f5afef99a2472c890a457e57c6..fb615cdd6838bf35fd855f900ba189491c290ec8 100644 (file)
@@ -920,7 +920,7 @@ xfs_dir2_leaf_to_block(
        tp = args->trans;
        mp = dp->i_mount;
        leaf = lbp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
        ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
 
index 7a1e42840733ff51f4d3cbe7a29a8ac636ad321b..9b3e9924066095da553f42c067c6bc7647930618 100644 (file)
@@ -28,6 +28,35 @@ static void xfs_dir3_leaf_log_bests(struct xfs_da_args *args,
 static void xfs_dir3_leaf_log_tail(struct xfs_da_args *args,
                                   struct xfs_buf *bp);
 
+void
+xfs_dir2_leaf_hdr_from_disk(
+       struct xfs_mount                *mp,
+       struct xfs_dir3_icleaf_hdr      *to,
+       struct xfs_dir2_leaf            *from)
+{
+       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+               struct xfs_dir3_leaf *from3 = (struct xfs_dir3_leaf *)from;
+
+               to->forw = be32_to_cpu(from3->hdr.info.hdr.forw);
+               to->back = be32_to_cpu(from3->hdr.info.hdr.back);
+               to->magic = be16_to_cpu(from3->hdr.info.hdr.magic);
+               to->count = be16_to_cpu(from3->hdr.count);
+               to->stale = be16_to_cpu(from3->hdr.stale);
+
+               ASSERT(to->magic == XFS_DIR3_LEAF1_MAGIC ||
+                      to->magic == XFS_DIR3_LEAFN_MAGIC);
+       } else {
+               to->forw = be32_to_cpu(from->hdr.info.forw);
+               to->back = be32_to_cpu(from->hdr.info.back);
+               to->magic = be16_to_cpu(from->hdr.info.magic);
+               to->count = be16_to_cpu(from->hdr.count);
+               to->stale = be16_to_cpu(from->hdr.stale);
+
+               ASSERT(to->magic == XFS_DIR2_LEAF1_MAGIC ||
+                      to->magic == XFS_DIR2_LEAFN_MAGIC);
+       }
+}
+
 /*
  * Check the internal consistency of a leaf1 block.
  * Pop an assert if something is wrong.
@@ -41,7 +70,7 @@ xfs_dir3_leaf1_check(
        struct xfs_dir2_leaf    *leaf = bp->b_addr;
        struct xfs_dir3_icleaf_hdr leafhdr;
 
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
 
        if (leafhdr.magic == XFS_DIR3_LEAF1_MAGIC) {
                struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
@@ -94,7 +123,7 @@ xfs_dir3_leaf_check_int(
        ops = xfs_dir_get_ops(mp, dp);
 
        if (!hdr) {
-               ops->leaf_hdr_from_disk(&leafhdr, leaf);
+               xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
                hdr = &leafhdr;
        }
 
@@ -379,7 +408,7 @@ xfs_dir2_block_to_leaf(
        /*
         * Set the counts in the leaf header.
         */
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
        leafhdr.count = be32_to_cpu(btp->count);
        leafhdr.stale = be32_to_cpu(btp->stale);
        dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr);
@@ -606,7 +635,7 @@ xfs_dir2_leaf_addname(
        leaf = lbp->b_addr;
        ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
        bestsp = xfs_dir2_leaf_bests_p(ltp);
        length = dp->d_ops->data_entsize(args->namelen);
 
@@ -1195,7 +1224,7 @@ xfs_dir2_leaf_lookup_int(
        leaf = lbp->b_addr;
        xfs_dir3_leaf_check(dp, lbp);
        ents = dp->d_ops->leaf_ents_p(leaf);
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
        /*
         * Look for the first leaf entry with our hash value.
@@ -1328,7 +1357,7 @@ xfs_dir2_leaf_removename(
        hdr = dbp->b_addr;
        xfs_dir3_data_check(dp, dbp);
        bf = dp->d_ops->data_bestfree_p(hdr);
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
        /*
         * Point to the leaf entry, use that to point to the data entry.
@@ -1509,7 +1538,7 @@ xfs_dir2_leaf_search_hash(
 
        leaf = lbp->b_addr;
        ents = args->dp->d_ops->leaf_ents_p(leaf);
-       args->dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(args->dp->i_mount, &leafhdr, leaf);
 
        /*
         * Note, the table cannot be empty, so we have to go through the loop.
@@ -1697,7 +1726,7 @@ xfs_dir2_node_to_leaf(
                return 0;
        lbp = state->path.blk[0].bp;
        leaf = lbp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
 
        ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC ||
               leafhdr.magic == XFS_DIR3_LEAFN_MAGIC);
index 783492a29f0e2a0d24e639cdb0daa40cfb881578..ddfc2b7d9a531a5087a2f235c4aac858aaa3000e 100644 (file)
@@ -42,7 +42,7 @@ xfs_dir3_leafn_check(
        struct xfs_dir2_leaf    *leaf = bp->b_addr;
        struct xfs_dir3_icleaf_hdr leafhdr;
 
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
 
        if (leafhdr.magic == XFS_DIR3_LEAFN_MAGIC) {
                struct xfs_dir3_leaf_hdr *leaf3 = bp->b_addr;
@@ -437,7 +437,7 @@ xfs_dir2_leafn_add(
 
        trace_xfs_dir2_leafn_add(args, index);
 
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
 
        /*
@@ -535,7 +535,7 @@ xfs_dir2_leaf_lasthash(
        struct xfs_dir2_leaf_entry *ents;
        struct xfs_dir3_icleaf_hdr leafhdr;
 
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
 
        ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC ||
               leafhdr.magic == XFS_DIR3_LEAFN_MAGIC ||
@@ -584,7 +584,7 @@ xfs_dir2_leafn_lookup_for_addname(
        tp = args->trans;
        mp = dp->i_mount;
        leaf = bp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
 
        xfs_dir3_leaf_check(dp, bp);
@@ -736,7 +736,7 @@ xfs_dir2_leafn_lookup_for_entry(
        tp = args->trans;
        mp = dp->i_mount;
        leaf = bp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
 
        xfs_dir3_leaf_check(dp, bp);
@@ -974,8 +974,8 @@ xfs_dir2_leafn_order(
        struct xfs_dir3_icleaf_hdr hdr1;
        struct xfs_dir3_icleaf_hdr hdr2;
 
-       dp->d_ops->leaf_hdr_from_disk(&hdr1, leaf1);
-       dp->d_ops->leaf_hdr_from_disk(&hdr2, leaf2);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr1, leaf1);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr2, leaf2);
        ents1 = dp->d_ops->leaf_ents_p(leaf1);
        ents2 = dp->d_ops->leaf_ents_p(leaf2);
 
@@ -1027,8 +1027,8 @@ xfs_dir2_leafn_rebalance(
 
        leaf1 = blk1->bp->b_addr;
        leaf2 = blk2->bp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&hdr1, leaf1);
-       dp->d_ops->leaf_hdr_from_disk(&hdr2, leaf2);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr1, leaf1);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr2, leaf2);
        ents1 = dp->d_ops->leaf_ents_p(leaf1);
        ents2 = dp->d_ops->leaf_ents_p(leaf2);
 
@@ -1225,7 +1225,7 @@ xfs_dir2_leafn_remove(
        dp = args->dp;
        tp = args->trans;
        leaf = bp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
 
        /*
@@ -1447,7 +1447,7 @@ xfs_dir2_leafn_toosmall(
         */
        blk = &state->path.blk[state->path.active - 1];
        leaf = blk->bp->b_addr;
-       dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
        ents = dp->d_ops->leaf_ents_p(leaf);
        xfs_dir3_leaf_check(dp, blk->bp);
 
@@ -1510,7 +1510,7 @@ xfs_dir2_leafn_toosmall(
                        (state->args->geo->blksize >> 2);
 
                leaf = bp->b_addr;
-               dp->d_ops->leaf_hdr_from_disk(&hdr2, leaf);
+               xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr2, leaf);
                ents = dp->d_ops->leaf_ents_p(leaf);
                count += hdr2.count - hdr2.stale;
                bytes -= count * sizeof(ents[0]);
@@ -1573,8 +1573,8 @@ xfs_dir2_leafn_unbalance(
        drop_leaf = drop_blk->bp->b_addr;
        save_leaf = save_blk->bp->b_addr;
 
-       dp->d_ops->leaf_hdr_from_disk(&savehdr, save_leaf);
-       dp->d_ops->leaf_hdr_from_disk(&drophdr, drop_leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &savehdr, save_leaf);
+       xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &drophdr, drop_leaf);
        sents = dp->d_ops->leaf_ents_p(save_leaf);
        dents = dp->d_ops->leaf_ents_p(drop_leaf);
 
index d2eaea663e7f205b69e785c262c8bf7a2ea992c0..5f42f2c81869e66375eec3db1bdaf77cdd672a2e 100644 (file)
@@ -66,6 +66,8 @@ extern int xfs_dir3_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno,
                struct xfs_buf **bpp);
 
 /* xfs_dir2_leaf.c */
+void xfs_dir2_leaf_hdr_from_disk(struct xfs_mount *mp,
+               struct xfs_dir3_icleaf_hdr *to, struct xfs_dir2_leaf *from);
 extern int xfs_dir3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp,
                xfs_dablk_t fbno, xfs_daddr_t mappedbno, struct xfs_buf **bpp);
 extern int xfs_dir3_leafn_read(struct xfs_trans *tp, struct xfs_inode *dp,
index 4ac0084e1480bbd1162b6a0cced805dda7258e22..b4c2be220afb75a7d60a68792f23e47a252fb9fd 100644 (file)
@@ -1038,7 +1038,7 @@ process_leaf_block_dir2(
        struct xfs_dir2_leaf_entry *ents;
        struct xfs_dir3_icleaf_hdr leafhdr;
 
-       M_DIROPS(mp)->leaf_hdr_from_disk(&leafhdr, leaf);
+       libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
        ents = M_DIROPS(mp)->leaf_ents_p(leaf);
 
        for (i = stale = 0; i < leafhdr.count; i++) {
@@ -1124,7 +1124,7 @@ _("can't read file block %u for directory inode %" PRIu64 "\n"),
                        goto error_out;
                }
                leaf = bp->b_addr;
-               M_DIROPS(mp)->leaf_hdr_from_disk(&leafhdr, leaf);
+               libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
                /*
                 * Check magic number for leaf directory btree block.
                 */
index 91d208a6708cb9d7889f6aec4bf660f31ea0acdc..958a8aa75f28c31e751467d40025dc2f1259f3e7 100644 (file)
@@ -2057,7 +2057,7 @@ longform_dir2_check_leaf(
        }
 
        leaf = bp->b_addr;
-       M_DIROPS(mp)->leaf_hdr_from_disk(&leafhdr, leaf);
+       libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
        ents = M_DIROPS(mp)->leaf_ents_p(leaf);
        ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf);
        bestsp = xfs_dir2_leaf_bests_p(ltp);
@@ -2154,7 +2154,7 @@ longform_dir2_check_node(
                        return 1;
                }
                leaf = bp->b_addr;
-               M_DIROPS(mp)->leaf_hdr_from_disk(&leafhdr, leaf);
+               libxfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
                ents = M_DIROPS(mp)->leaf_ents_p(leaf);
                if (!(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC ||
                      leafhdr.magic == XFS_DIR3_LEAFN_MAGIC ||