diff mbox series

[17/23] libxfs: remove dead size < 0 checks in libxfs_init

Message ID 20231211163742.837427-18-hch@lst.de (mailing list archive)
State Accepted
Headers show
Series [01/23] libxfs: remove the unused icache_flags member from struct libxfs_xinit | expand

Commit Message

Christoph Hellwig Dec. 11, 2023, 4:37 p.m. UTC
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>
---
 libxfs/init.c | 15 ---------------
 1 file changed, 15 deletions(-)

Comments

Carlos Maiolino Dec. 18, 2023, 12:51 p.m. UTC | #1
On Mon, Dec 11, 2023 at 05:37:36PM +0100, Christoph Hellwig wrote:
> 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: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  libxfs/init.c | 15 ---------------
>  1 file changed, 15 deletions(-)
> 
> diff --git a/libxfs/init.c b/libxfs/init.c
> index 5be6f8cf1..87193c3a6 100644
> --- a/libxfs/init.c
> +++ b/libxfs/init.c
> @@ -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,
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/libxfs/init.c b/libxfs/init.c
index 5be6f8cf1..87193c3a6 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -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,