[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V3 1/9] block: add a helper function to read nr_setcs
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Tue, 2 Jul 2019 10:42:27 -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: ECiyRcIB2FAaIJDzsti6JDTbFe4YHYMEBg91pFuysCyANcEKud5fZ2p8b9agtr4sD/e1bFaP3+ fj9/3r0ZNWhclFuqiu1FT7pA+gc1GkdOHhfkG+9tOK1Nx6KfRuqVo0Y8eCnOU+JfZQwhYxYM/S jjrjIQUfGmta9GniU8HCc4OkmvnFRKowMZpffAvrmcClYnlhnM2SRdSkFFKvJKxw51PXhMun6a qpiV+2QmaooYpmceC6CEveRxMsXbjkQviUPZjP8anSZUF0zKr2Zo0E6t8weMaGsJbxAWa5cBlS bzQ=
- Ironport-sdr: 7eiwyhzqxRlLi1tqea43WkbeHyECBbk7usevsD+Xz1biXrqGZ4L0silrVQTgvHS5w3vcRIyHo3 Ow9Bv2tAGqZYSmDV+kt+6Xr8YYF3/TUoYBv5xCBjGp5q6CN3GbQY6MuUWU5455FoMrPrs5gesg 3GMEFpHsdxcIYOkW3N3ZjA3JNajdZtH6KifkF5ZY2+Sv4Hq39OknS0bc8lySJNafyTtwHUci1J +eiRsS2i1tyMulnk3smAIHMIvyqyOdIgTAZx4rntA0+BpNM7ZWqudfQaKJmuLDhVPqBb6AypYD h+HRCF4peQFfWzLy7o3OMb6X
- Ironport-sdr: PULQy2lnpUjzZmGu5JhOPM0yZ067ec9EuCSAYxpuoeel4NTIXUCfgyS4rhbF25Q7yRUqnKjJjO CP1MdvtMJIn2BUXo8nmrX5ayVwfG45PvBnj1Se1hmqO/H2IJqLy+IP8Kg2K+s2Xj+EgkZWW02g anJeJj1nyY5U/2ClaYOMcnAe03Lwy49+x9vakB7tPIjcZZdty/SvzK2wSsXbiK+BxED3VRniEP eYYWAlSc535zS92ZL8AaU3F97Xew5XRNC2UFo/huZ0jIVGZ/OGA+nQC4AFOvTDhTQ795+4uCYY dd0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
This patch introduces helper function to read the number of sectors
from struct block_device->bd_part member. For more details Please refer
to the comment in the include/linux/genhd.h for part_nr_sects_read().
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
include/linux/blkdev.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 592669bcc536..be7ee5a0b0dd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1475,6 +1475,12 @@ static inline void put_dev_sector(Sector p)
put_page(p.v);
}
+/* Helper function to read the bdev->bd_part->nr_sects */
+static inline sector_t bdev_nr_sects(struct block_device *bdev)
+{
+ return part_nr_sects_read(bdev->bd_part);
+}
+
int kblockd_schedule_work(struct work_struct *work);
int kblockd_schedule_work_on(int cpu, struct work_struct *work);
int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned
long delay);
--
2.19.1
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|