[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io
- To: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- From: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
- Date: Thu, 28 Jan 2021 11:21:36 +0100
- Cc: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, drbd-dev@xxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-nvme <linux-nvme@xxxxxxxxxxxxxxxxxxx>, "open list:TARGET SUBSYSTEM" <linux-scsi@xxxxxxxxxxxxxxx>, target-devel@xxxxxxxxxxxxxxx, linux-fscrypt@xxxxxxxxxxxxxxx, jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, Linux PM <linux-pm@xxxxxxxxxxxxxxx>, Linux Memory Management List <linux-mm@xxxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>, Philipp Reisner <philipp.reisner@xxxxxxxxxx>, Lars Ellenberg <lars.ellenberg@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, roger.pau@xxxxxxxxxx, Minchan Kim <minchan@xxxxxxxxxx>, ngupta@xxxxxxxxxx, Sergey Senozhatsky <sergey.senozhatsky.work@xxxxxxxxx>, Alasdair Kergon <agk@xxxxxxxxxx>, Mike Snitzer <snitzer@xxxxxxxxxx>, Christoph Hellwig <hch@xxxxxx>, Sagi Grimberg <sagi@xxxxxxxxxxx>, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, Al Viro <viro@xxxxxxxxxxxxxxxxxx>, "Ted Ts'o" <tytso@xxxxxxx>, jaegeuk@xxxxxxxxxx, Eric Biggers <ebiggers@xxxxxxxxxx>, djwong@xxxxxxxxxx, shaggy@xxxxxxxxxx, konishi.ryusuke@xxxxxxxxx, Mark Fasheh <mark@xxxxxxxxxx>, Joel Becker <jlbec@xxxxxxxxxxxx>, Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx>, damien.lemoal@xxxxxxx, naohiro.aota@xxxxxxx, jth@xxxxxxxxxx, "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>, Len Brown <len.brown@xxxxxxxxx>, Pavel Machek <pavel@xxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Hannes Reinecke <hare@xxxxxxx>, "Gustavo A. R. Silva" <gustavoars@xxxxxxxxxx>, Takashi Iwai <tiwai@xxxxxxx>, Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx>, asml.silence@xxxxxxxxx, Ming Lei <ming.lei@xxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, osandov@xxxxxx, Bart Van Assche <bvanassche@xxxxxxx>, jefflexu@xxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 28 Jan 2021 10:21:52 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Jan 28, 2021 at 8:21 AM Chaitanya Kulkarni
<chaitanya.kulkarni@xxxxxxx> wrote:
>
Please explain in the changelog why making this change is a good idea.
> 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
>
|