]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: remove the setblksize == 1 case in libxfs_device_open
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Dec 2023 16:37:34 +0000 (17:37 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 18 Dec 2023 13:57:48 +0000 (14:57 +0100)
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: 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 de1e588f1c827dd8cc4fd72e578265e27e1ad701..6570c595aedcd02e2128aff54f27ebcf75118b9a 100644 (file)
@@ -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);