]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: change some error-less functions to void types
authorEric Sandeen <sandeen@redhat.com>
Wed, 24 Jul 2019 19:54:07 +0000 (15:54 -0400)
committerEric Sandeen <sandeen@redhat.com>
Wed, 24 Jul 2019 19:54:07 +0000 (15:54 -0400)
Source kernel commit: 910832697cf85536c7fe26edb8bc6f830c4b9bb6

There are several functions which have no opportunity to return
an error, and don't contain any ASSERTs which could be argued
to be better constructed as error cases.  So, make them voids
to simplify the callers.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/info.c
libxfs/xfs_dquot_buf.c
libxfs/xfs_quota_defs.h
libxfs/xfs_sb.c
libxfs/xfs_sb.h
mkfs/xfs_mkfs.c

index b6c78f5c01b1c86ef345feca3281cd2b4e0b07e8..7dae6e255d2a4dd6d7c25b558d253674fd54cf2f 100644 (file)
--- a/db/info.c
+++ b/db/info.c
@@ -27,16 +27,8 @@ info_f(
        char                    **argv)
 {
        struct xfs_fsop_geom    geo;
-       int                     error;
-
-       error = -libxfs_fs_geometry(&mp->m_sb, &geo,
-                       XFS_FS_GEOM_MAX_STRUCT_VER);
-       if (error) {
-               dbprintf(_("could not obtain geometry\n"));
-               exitcode = 1;
-               return 0;
-       }
 
+       libxfs_fs_geometry(&mp->m_sb, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
        xfs_report_geom(&geo, fsdevice, x.logname, x.rtname);
        return 0;
 }
index 8bcae16905b046b7448bbd0ecf6f33a384e891f0..3a4eaca2a79f93374d5591b75624709fb7a38e03 100644 (file)
@@ -108,7 +108,7 @@ xfs_dqblk_verify(
 /*
  * Do some primitive error checking on ondisk dquot data structures.
  */
-int
+void
 xfs_dqblk_repair(
        struct xfs_mount        *mp,
        struct xfs_dqblk        *dqb,
@@ -131,8 +131,6 @@ xfs_dqblk_repair(
                xfs_update_cksum((char *)dqb, sizeof(struct xfs_dqblk),
                                 XFS_DQUOT_CRC_OFF);
        }
-
-       return 0;
 }
 
 STATIC bool
index d3f29779b72c4de6cc270deba0ed9228a454d7ed..c136ce0b083068c2e94642d370f5530e05ecde60 100644 (file)
@@ -144,7 +144,7 @@ extern xfs_failaddr_t xfs_dquot_verify(struct xfs_mount *mp,
 extern xfs_failaddr_t xfs_dqblk_verify(struct xfs_mount *mp,
                struct xfs_dqblk *dqb, xfs_dqid_t id, uint type);
 extern int xfs_calc_dquots_per_chunk(unsigned int nbblks);
-extern int xfs_dqblk_repair(struct xfs_mount *mp, struct xfs_dqblk *dqb,
+extern void xfs_dqblk_repair(struct xfs_mount *mp, struct xfs_dqblk *dqb,
                xfs_dqid_t id, uint type);
 
 #endif /* __XFS_QUOTA_H__ */
index 63025016623cd66b61effe898ebb2da47f06631e..7ca423ea69d755bb3150709bf000808bb1a6aa0d 100644 (file)
@@ -1062,7 +1062,7 @@ out:
        return error;
 }
 
-int
+void
 xfs_fs_geometry(
        struct xfs_sb           *sbp,
        struct xfs_fsop_geom    *geo,
@@ -1086,13 +1086,13 @@ xfs_fs_geometry(
        memcpy(geo->uuid, &sbp->sb_uuid, sizeof(sbp->sb_uuid));
 
        if (struct_version < 2)
-               return 0;
+               return;
 
        geo->sunit = sbp->sb_unit;
        geo->swidth = sbp->sb_width;
 
        if (struct_version < 3)
-               return 0;
+               return;
 
        geo->version = XFS_FSOP_GEOM_VERSION;
        geo->flags = XFS_FSOP_GEOM_FLAGS_NLINK |
@@ -1136,7 +1136,7 @@ xfs_fs_geometry(
        geo->dirblocksize = xfs_dir2_dirblock_bytes(sbp);
 
        if (struct_version < 4)
-               return 0;
+               return;
 
        if (xfs_sb_version_haslogv2(sbp))
                geo->flags |= XFS_FSOP_GEOM_FLAGS_LOGV2;
@@ -1144,11 +1144,9 @@ xfs_fs_geometry(
        geo->logsunit = sbp->sb_logsunit;
 
        if (struct_version < 5)
-               return 0;
+               return;
 
        geo->version = XFS_FSOP_GEOM_VERSION_V5;
-
-       return 0;
 }
 
 /* Read a secondary superblock. */
index 13564d69800af4973ea79ef10dfd141b88034815..92465a9a516204b40771b80fcfb3d8ccdbda900c 100644 (file)
@@ -33,7 +33,7 @@ extern void   xfs_sb_quota_from_disk(struct xfs_sb *sbp);
 extern int     xfs_update_secondary_sbs(struct xfs_mount *mp);
 
 #define XFS_FS_GEOM_MAX_STRUCT_VER     (4)
-extern int     xfs_fs_geometry(struct xfs_sb *sbp, struct xfs_fsop_geom *geo,
+extern void    xfs_fs_geometry(struct xfs_sb *sbp, struct xfs_fsop_geom *geo,
                                int struct_version);
 extern int     xfs_sb_read_secondary(struct xfs_mount *mp,
                                struct xfs_trans *tp, xfs_agnumber_t agno,
index 65cf1e0f6cc9e07c4f2d96ddb55308b4c2dd8be7..0adaa65d19f8df0a54ab58b889ae453aff25ef00 100644 (file)
@@ -4052,17 +4052,8 @@ main(
        /* Print the intended geometry of the fs. */
        if (!quiet || dry_run) {
                struct xfs_fsop_geom    geo;
-               int                     error;
-
-               error = -libxfs_fs_geometry(sbp, &geo,
-                               XFS_FS_GEOM_MAX_STRUCT_VER);
-               if (error) {
-                       fprintf(stderr,
-       _("%s: failed to generate filesystem geometry\n"),
-                               progname);
-                       exit(1);
-               }
 
+               libxfs_fs_geometry(sbp, &geo, XFS_FS_GEOM_MAX_STRUCT_VER);
                xfs_report_geom(&geo, dfile, logfile, rtfile);
                if (dry_run)
                        exit(0);