[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Xen-devel] [PATCH V5 1/9] block: add a helper function to read nr_setcs
- To: linux-block@xxxxxxxxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Tue, 20 Aug 2019 23:14:15 -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: Wed, 21 Aug 2019 06:14:39 +0000
- Ironport-sdr: MsVv/qeZcm0Ji7q/gXpc8i8DrO4rLySfr10vSgP4QDJmywDnNcKBffT7L2ZXxZZF22syJhmP5K MpVRCjXzaLyhFX3cWqzhFCin3j0PTltnF1d7LKKRT7nGeLdeVY8WUM2yCPmgQdTvcmnZnGrb+c OCt4xfDYQfh8Fa40IxHIWIrleRpHenhUlYu+eBfok9ujiM+9o9TxQsrP48AfRYuONwZ/sNOmz/ rbENHQJRwQ1Mwzdur4sW9iMl5w8ykeP7zZU3ibTw61pODMurc1aAyOXupw9X1Z6LawmcokEkg9 J4E=
- Ironport-sdr: /x2WVFwhMssmG4YuCAUPOp71T5HaHEph5tsmSLnrIS/8Bft81w+S9EdUz8hkKcgQ4RwvHBfV06 CEq9lj4emOc45f/Aqmjf/tMfzXXi4VrHzVqsnm9DFb0vhCF4bKTz6OtrdyRnev4N/SVu16R0Ng 2Ww5YvZ/Rm0A/gZ5+0h8ZgcoF3X8neHkPY4zJtlJgsHJaRsfDrxvZ1PWkNG/VxczvKQqtzov2r a1bp/ktFheMqrgprUoWcnlNajrOc9mEZ8KUXo0/ggb/H+5ziMiKSulnIvlgu4Uh7U3Hwl+4iPP WZBK2JRLl6EFhz22hkPsvVwz
- Ironport-sdr: J1I/5bgiTFIAu8nNl9kv6CSGMFr4yg0TlUcqLzMJdDy8EZZg8n4rfy/XPfR/JjpgmOnfkVltBx ssjiOGwNssK5XXLGHSuoQGzY72APilAq4AuufFX7XHX3TUf6fMAFSvIG+S4BOIvcE8H6g4FFk4 w6w8aEGbtPr28z7XjcaeIOJwLHNeebOJOnfEd1HlWA5+RnjTkgiUj/gkJ7B08lWbk1QlQ2RUaA iYA9zikhwLYCTW/T6a0mIofhJVPKp5ODf79l+YclGUXbyljEgCoXjsbem9ACoYAnj3ly4+ysyD mtk=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Wdcironportexception: Internal
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().
Reviewed-by: Minwoo Im <minwoo.im.dev@xxxxxxxxx>
Reviewed-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
include/linux/blkdev.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4798bb25f1ee..aa5801c8ff73 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1468,6 +1468,11 @@ static inline void put_dev_sector(Sector p)
put_page(p.v);
}
+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.17.0
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|