]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove dead size < 0 checks in libxfs_init
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Dec 2023 16:37:36 +0000 (17:37 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 18 Dec 2023 13:57:49 +0000 (14:57 +0100)
libxfs_init initializes the device size to 0 at the start of the function
and libxfs_open_device never sets the size to a negativ value.  Remove
these checks as they are dead code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/init.c

index 5be6f8cf1d8624fc3e0ac7c72b8f13acdc0d3a51..87193c3a62e4ff278b04bf2dbe7874e2dae2f0ef 100644 (file)
@@ -329,21 +329,6 @@ libxfs_init(struct libxfs_init *a)
                platform_findsizes(dname, a->rtfd, &a->rtsize, &a->rtbsize);
        }
 
-       if (a->dsize < 0) {
-               fprintf(stderr, _("%s: can't get size for data subvolume\n"),
-                       progname);
-               goto done;
-       }
-       if (a->logBBsize < 0) {
-               fprintf(stderr, _("%s: can't get size for log subvolume\n"),
-                       progname);
-               goto done;
-       }
-       if (a->rtsize < 0) {
-               fprintf(stderr, _("%s: can't get size for realtime subvolume\n"),
-                       progname);
-               goto done;
-       }
        if (!libxfs_bhash_size)
                libxfs_bhash_size = LIBXFS_BHASHSIZE(sbp);
        libxfs_bcache = cache_init(a->bcache_flags, libxfs_bhash_size,