]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: refactor metadump handling of multi-fsb objects
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 26 Apr 2019 20:40:19 +0000 (15:40 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 26 Apr 2019 20:40:19 +0000 (15:40 -0500)
Separate the multi-fsb object dispatch from actual dir block processing
so that we can implement symlink handling correctly as a multi-fsb file.

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

index 3cce3012f17bc83291bfcbb42388f601e7cc1228..83a257d00ab408754304a463e37c4639aa0326dc 100644 (file)
@@ -1911,7 +1911,7 @@ static struct bbmap mfsb_map;
 static int mfsb_length;
 
 static int
-process_multi_fsb_objects(
+process_multi_fsb_dir(
        xfs_fileoff_t   o,
        xfs_fsblock_t   s,
        xfs_filblks_t   c,
@@ -1921,14 +1921,6 @@ process_multi_fsb_objects(
        char            *dp;
        int             ret = 0;
 
-       switch (btype) {
-       case TYP_DIR2:
-               break;
-       default:
-               print_warning("bad type for multi-fsb object %d", btype);
-               return -EINVAL;
-       }
-
        while (c > 0) {
                unsigned int    bm_len;
 
@@ -1987,6 +1979,23 @@ out_pop:
        return ret;
 }
 
+static int
+process_multi_fsb_objects(
+       xfs_fileoff_t   o,
+       xfs_fsblock_t   s,
+       xfs_filblks_t   c,
+       typnm_t         btype,
+       xfs_fileoff_t   last)
+{
+       switch (btype) {
+       case TYP_DIR2:
+               return process_multi_fsb_dir(o, s, c, btype, last);
+       default:
+               print_warning("bad type for multi-fsb object %d", btype);
+               return -EINVAL;
+       }
+}
+
 /* inode copy routines */
 static int
 process_bmbt_reclist(