]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: stop using ->data_entry_p()
authorEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:43 +0000 (11:29 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 22 Jan 2020 16:29:43 +0000 (11:29 -0500)
The ->data_entry_p() op went away in v5.5 kernelspace, so rework
xfs_repair to use ->data_entry_offset instead, in preparation
for the v5.5 libxfs backport.

This could later be cleaned up to use offsets as was done
in kernel commit 8073af5153c for example.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/dir2.c
repair/phase6.c

index b8a45461005801344b6cb3858204abe4fa250509..f5f2d7bf7c131839b9e8eb9cf9e434970c45b097 100644 (file)
@@ -580,7 +580,7 @@ process_dir2_data(
 
        d = bp->b_addr;
        bf = M_DIROPS(mp)->data_bestfree_p(d);
-       ptr = (char *)M_DIROPS(mp)->data_entry_p(d);
+       ptr = (char *)d + M_DIROPS(mp)->data_entry_offset;
        badbest = lastfree = freeseen = 0;
        if (be16_to_cpu(bf[0].length) == 0) {
                badbest |= be16_to_cpu(bf[0].offset) != 0;
@@ -646,7 +646,7 @@ process_dir2_data(
                        do_warn(_("\twould junk block\n"));
                return 1;
        }
-       ptr = (char *)M_DIROPS(mp)->data_entry_p(d);
+       ptr = (char *)d + M_DIROPS(mp)->data_entry_offset;
        /*
         * Process the entries now.
         */
index d4d26254ab279ef3e408f99e0b3efb5761fdd3dd..e7d227ae39b140f342408a5ac9fee0a13a0749ca 100644 (file)
@@ -1527,7 +1527,7 @@ longform_dir2_entry_check_data(
 
        bp = *bpp;
        d = bp->b_addr;
-       ptr = (char *)M_DIROPS(mp)->data_entry_p(d);
+       ptr = (char *)d + M_DIROPS(mp)->data_entry_offset;
        nbad = 0;
        needscan = needlog = 0;
        junkit = 0;
@@ -1587,7 +1587,7 @@ longform_dir2_entry_check_data(
                                break;
 
                        /* check for block with no data entries */
-                       if ((ptr == (char *)M_DIROPS(mp)->data_entry_p(d)) &&
+                       if ((ptr == (char *)d + M_DIROPS(mp)->data_entry_offset) &&
                            (ptr + be16_to_cpu(dup->length) >= endptr)) {
                                junkit = 1;
                                *num_illegal += 1;
@@ -1656,7 +1656,7 @@ longform_dir2_entry_check_data(
                        do_warn(_("would fix magic # to %#x\n"), wantmagic);
        }
        lastfree = 0;
-       ptr = (char *)M_DIROPS(mp)->data_entry_p(d);
+       ptr = (char *)d + M_DIROPS(mp)->data_entry_offset;
        /*
         * look at each entry.  reference inode pointed to by each
         * entry in the incore inode tree.
@@ -1831,7 +1831,7 @@ longform_dir2_entry_check_data(
                               (dep->name[0] == '.' && dep->namelen == 1));
                        add_inode_ref(current_irec, current_ino_offset);
                        if (da_bno != 0 ||
-                           dep != M_DIROPS(mp)->data_entry_p(d)) {
+                           dep != (void *)d + M_DIROPS(mp)->data_entry_offset) {
                                /* "." should be the first entry */
                                nbad++;
                                if (entry_junked(