[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V4 5/9] bcache: update cached_dev_init() with helper
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Mon, 8 Jul 2019 11:47:07 -0700
- Cc: damien.lemoal@xxxxxxx, linux-btrace@xxxxxxxxxxxxxxx, bvanassche@xxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>, yuchao0@xxxxxxxxxx, colyli@xxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, jaegeuk@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, kent.overstreet@xxxxxxxxx, roger.pau@xxxxxxxxxx
- Delivery-date: Mon, 08 Jul 2019 18:47:48 +0000
- Ironport-sdr: wneg7Bk451byGpWEZbMg3ObYJTGxk9OTNwnto/dC3xiuxGdpKt4sX7cHUdGYvj9uY1tbUyOTm/ TkTXEdn31Ar5Wa02s2c/Xv2fMvVQllr7J/3lMZPtIIBQpCcToMEciiUl5Idq6gmfQmUok+mkiE 24RXc+Gsbbfq/42YImMfh71YSPactg4P5PZ0PrSTQQ4AuOmMovK91feddWW4CS5HYb1NDeSlOI WC9b8/7wEe55rec12HxMxufjWlMBVwClfuPmknG6zYRVL50Dpgqa4rMOUxZE8s0UlTmCM4f9kV xDM=
- Ironport-sdr: ee3NC6WIyp0G6cd8lL6QJLGpRFQW6WF6UUXG7jzzqsIBOdlh/hTJaOsULj3rsnChun1X/34Z1G UrG4O3YY726D9zEjnvs1p8DgSOl5vUjjGKp5wUXdCgt50+IuNp51gbkcCW+NJAYeJasX85/SFL 1tLN9yRBr6eonxG+Yxi1cUcpDuIa9mSho0Qg38ofDc8VG0c1roQnjOXxmJt9pFdlF0CIWPyUBP jFbaejYtNepih/RyC8Q9lNBMp7dx+R5dJZmO1+RpOGFlAKQOXts3JilydBls6FKi5mbLfCbyNR 41/jL4X3CUj5wyex3gO2aqZM
- Ironport-sdr: mSzQo+wfNgERgCVFud7JBTp2NieFcrt7EnGnb+zRa7q9bK08hCzDg+CJfwLIldFz0pOGFDaOKS V6OLvb+6LzgoSZ8fb06fYk117r61T/uhgntkoprDYN+CpfYFFy8Z4K5aL8MlfWEEC7slAkAebQ RzEUF6LpJ2Fl9VRSOL/l7pBDwfnAJvdasZYCjnUsGlYv9bAJsIIK6krklHTnNtryjtwKwmHIup TcdxBUboya/h4ldKo3V5LNG4gKVzAq1Ws/lBSg2Eets7EHoT7i8XMvEDqQtXp9sqLszOkgy8Ka Yhc=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
In the bcache when initializing the cached device we don't actually
use any sort of locking when reading the number of sectors from the
part. This patch updates the cached_dev_init() with newly introduced
helper function to read the nr_sects from block device's hd_parts with
the help of part_nr_sects_read().
Acked-by: Coly Li <colyli@xxxxxxx>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
drivers/md/bcache/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 26e374fbf57c..024c52d11b0f 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1302,7 +1302,7 @@ static int cached_dev_init(struct cached_dev *dc,
unsigned int block_size)
q->limits.raid_partial_stripes_expensive;
ret = bcache_device_init(&dc->disk, block_size,
- dc->bdev->bd_part->nr_sects - dc->sb.data_offset);
+ bdev_nr_sects(dc->bdev) - dc->sb.data_offset);
if (ret)
return ret;
--
2.17.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|