diff mbox series

[15/23] libxfs: remove the setblksize == 1 case in libxfs_device_open

Message ID 20231211163742.837427-16-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
All callers of libxfs_init always pass an actual sector size or zero in
the setblksize member.  Remove the unreachable setblksize == 1 case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 libxfs/init.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Carlos Maiolino Dec. 18, 2023, 12:44 p.m. UTC | #1
On Mon, Dec 11, 2023 at 05:37:34PM +0100, Christoph Hellwig wrote:
> All callers of libxfs_init always pass an actual sector size or zero in
> the setblksize member.  Remove the unreachable setblksize == 1 case.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> ---
>  libxfs/init.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/libxfs/init.c b/libxfs/init.c
> index de1e588f1..6570c595a 100644
> --- a/libxfs/init.c
> +++ b/libxfs/init.c
> @@ -125,10 +125,7 @@ retry:
>  	}
> 
>  	if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) {
> -		if (setblksize == 1) {
> -			/* use the default blocksize */
> -			(void)platform_set_blocksize(fd, path, statb.st_rdev, XFS_MIN_SECTORSIZE, 0);
> -		} else if (dio) {
> +		if (dio) {
>  			/* try to use the given explicit blocksize */
>  			(void)platform_set_blocksize(fd, path, statb.st_rdev,
>  					setblksize, 0);
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/libxfs/init.c b/libxfs/init.c
index de1e588f1..6570c595a 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -125,10 +125,7 @@  retry:
 	}
 
 	if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) {
-		if (setblksize == 1) {
-			/* use the default blocksize */
-			(void)platform_set_blocksize(fd, path, statb.st_rdev, XFS_MIN_SECTORSIZE, 0);
-		} else if (dio) {
+		if (dio) {
 			/* try to use the given explicit blocksize */
 			(void)platform_set_blocksize(fd, path, statb.st_rdev,
 					setblksize, 0);