[RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, linux-fscrypt@xxxxxxxxxxxxxxx, jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- Subject: [RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:28 -0800
- In-reply-to: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Ironport-sdr: IP02B0t48+ZS6eTsMOy5CC4RvdEC+J4WI9rOgdDEL6i+HX6ygrGDYLvMrfBXB2nTQ5LpDFtVWv gMdNsHFU2JezHpKEkqwybnwgmcuI798F/kciBpPZolNLi9bp8xTa+4HfW6fHo1GbxKRjrxMjfp 7eQRFkGemN5ylmzRa/Ukp+ERpUbpL99IpOCxK/EX5Pa3CE9GzgMFXlFqRpWaaSm/bzJFEde46p hhsPPIEmSkbCxIhNlqeNlH1u1W9MFYS+buMJDv/j50PjkY5wwj3vJBsqGN6j6S9bsklmwl3iDU TzU=
- Ironport-sdr: 4Shp0a9OlbAOH2CLBuUtXbd+Bd5iM/1YmLPuWzuCX8Y3r04Ee/2cIPh0Zs23g6TRb0TXi4GG7g JNHZPStpg0g3A4hGYg+hkzLSApvbGQqHQhvj/pG9ufJK7xcXmdUr5+s8gCA9VYUPlFQ13d69+8 FWvE2wiURnHEUwCGdMXd1g966XZn5RFqVeDduSg0FzqH10abFQxea6BhWdkpq4oI1C1AaRvc1h SbylIYTBak8uc2nt1vQ0wghyDCCwhFzdt31mVfM2BnQxSElL0yLvkVA7PVmdz3MmyvJGE8J09a 9dKJ64EPHArlVy0q24EEbj/h
- Ironport-sdr: +tiKd6++/IklFSy7iDJaHbayhG5AQMYy46sQaNwq7O80dac1IZ8ZNlxjx4DxYbXvKYV6ua9+Jn RJlpIO7cWN3eoJjRXIKMWDgWPb2hxGv4A2WF6qkOCUmJWGu679NggrholDw0Y/zhUvvPmDPwT6 YMwbiHmVzfz4ihKs4Lc84G8Ml2oUugQkKwA3saHG7RouPgTCEOWIbUjZGA0E7lav6RMiRyuWgb NQVibBmtLzaPM7sNDSYSURpVt5muhPgCfKQdUKPwhH4mY9hUDkI5QyIoSDd8h2S0Ai5kAfU9pn AHM=
- References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Wdcironportexception: Internal
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
kernel/power/swap.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index c73f2e295167..e92e36c053a6 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -271,13 +271,12 @@ static int hib_submit_io(int op, int op_flags, pgoff_t page_off, void *addr,
struct hib_bio_batch *hb)
{
struct page *page = virt_to_page(addr);
+ sector_t sect = page_off * (PAGE_SIZE >> 9);
struct bio *bio;
int error = 0;
- bio = bio_alloc(GFP_NOIO | __GFP_HIGH, 1);
- bio->bi_iter.bi_sector = page_off * (PAGE_SIZE >> 9);
- bio_set_dev(bio, hib_resume_bdev);
- bio_set_op_attrs(bio, op, op_flags);
+ bio = bio_new(hib_resume_bdev, sect, op, op_flags, 1,
+ GFP_NOIO | __GFP_HIGH);
if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
pr_err("Adding page to bio failed at %llu\n",
--
2.22.1
[Index of Archives]
[linux Cryptography]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]