[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V3 5/9] bcache: update cached_dev_init() with helper
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Tue, 2 Jul 2019 10:42:31 -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: Tue, 02 Jul 2019 17:44:45 +0000
- Ironport-sdr: Est5czJKx0ZLuLlhD46yi07ZSFqIOOrVuznzaayyAaYXxUcMtm4xBVlKVBQuckIlmIjiepGZJ9 LJoe6P/H9jXB3LoSgcoX6s/zHmFujZ5QLKMv0h37+bIW3fOFxfoCFnbxMtipxxZ7TLIW0gRQ7g 4L1pBqcbybkSY+c/GSIF+WDBR+IfSZ+m8gW/i6iLmPL0328u9G7ZsUZn3KrFhv74ZW8attDRKo RXYlVLP0hhjIAyXj0tVivoGaJ6P+4Zhg6JJrFWUNuRE95rWTAx0ZCnmgiDMqcrnyEwAmyM0Yvj J/o=
- Ironport-sdr: O4vg4I65mT8nzYC/3TARPI6Zd8NKC6WLpFt2mPaPVZh+DUdDBPFfHF7KPprkts3ZH0803UEIMg jmJtYK4SGBGpanJsBLpluq9CMj3K71Y4q2JKAmeiWt8t/H+BO+o7qk7BrcdbA5gInJs8Bqqc6u R+Vj4OpI5kGAfV37oOtpfj0t77W55Q9K5w0C4dZBka+urhq2te8v0cZxZLe/+I/QwMapvj01fU hF0RVQMZglt0YmKfEgymvB6CEp4rVCwf+iw/Uhi/jJXOEkJzo6WRgwcDpkFbqIsTR9C5xzrw/u ofNX8vjqDVmcqiXqlppRabiP
- Ironport-sdr: dsdfrG+O+D0YYUKDQmR4iE3UN3zVh/hsdwUfa6x7YhTtUiGIL8CpmfkBwMDTgt0WzdLK9m8IAG jYsHWpvDyzppL1pgzcvOiz9dvRaFzp+UV4DGE2Qj6epyYaGFA0N+k406z9PObsn/0+cPUjLQ/X WE1E455mHT1sBW+V63HZhc7EKmX80L5NAxQo4WHs+RnjTp6Exnns3m6jjZroXcgog5MKSTbJER ZZjwX0UI2MDh6Rwc5quokKaI99tN9VzJI2KH+raddvpBf/NohnJUIwwJVnZcacJhGyuYPLliiT GoM=
- 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 1b63ac876169..6a29ba89dae1 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1263,7 +1263,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.19.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|