lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230628093500.68779-3-frank.li@vivo.com>
Date:   Wed, 28 Jun 2023 17:34:56 +0800
From:   Yangtao Li <frank.li@...o.com>
To:     axboe@...nel.dk, song@...nel.org, viro@...iv.linux.org.uk,
        brauner@...nel.org, xiang@...nel.org, chao@...nel.org,
        huyue2@...lpad.com, jefflexu@...ux.alibaba.com, hch@...radead.org,
        djwong@...nel.org
Cc:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-raid@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-erofs@...ts.ozlabs.org, linux-xfs@...r.kernel.org,
        Yangtao Li <frank.li@...o.com>
Subject: [PATCH 3/7] md: Convert to queue_logical_block_mask()

Use queue_logical_block_mask() to simplify code.

Signed-off-by: Yangtao Li <frank.li@...o.com>
---
 drivers/md/md.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 2e38ef421d69..fd646e5ed082 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1649,7 +1649,7 @@ static int super_1_load(struct md_rdev *rdev, struct md_rdev *refdev, int minor_
 	atomic_set(&rdev->corrected_errors, le32_to_cpu(sb->cnt_corrected_read));
 
 	rdev->sb_size = le32_to_cpu(sb->max_dev) * 2 + 256;
-	bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
+	bmask = queue_logical_block_mask(rdev->bdev->bd_disk->queue);
 	if (rdev->sb_size & bmask)
 		rdev->sb_size = (rdev->sb_size | bmask) + 1;
 
@@ -2062,7 +2062,7 @@ static void super_1_sync(struct mddev *mddev, struct md_rdev *rdev)
 		int bmask;
 		sb->max_dev = cpu_to_le32(max_dev);
 		rdev->sb_size = max_dev * 2 + 256;
-		bmask = queue_logical_block_size(rdev->bdev->bd_disk->queue)-1;
+		bmask = queue_logical_block_mask(rdev->bdev->bd_disk->queue);
 		if (rdev->sb_size & bmask)
 			rdev->sb_size = (rdev->sb_size | bmask) + 1;
 	} else
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ