[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: Pavel Machek <pavel@xxxxxx>
- From: Chaitanya Kulkarni <Chaitanya.Kulkarni@xxxxxxx>
- Date: Thu, 18 Feb 2021 01:28:03 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nVXbQhzjMljenFFGdNZDlx1QlYnqBP6C3iQWXjZAeDQ=; b=D5Ytc/df2DjxEIjW1QryLJ4PGUbnB4Ea3TV4TMBIJJe8DPrtS7/fCrYYQqqU4ssKhfL6DXKyI+ZNIR6LwOebIgPjxKUsjt0VplzRsXrmumld0mbBvENF/awZ15Ok/IV6/9F9mTCXij7K1iD7W+Z0sFanabFIx+4VFlXzVHtIjaNPcKGT03ZluX8jLrza9njERNtaKgX2RI3q74SGBrf4x8krmb/G7SmtLcmpf9Z+p8jh5zsmy03qoXUJFM7u3O4PUmydrU65J49EK9YrYeUvGRQPEtmB28UyPJfcA10fq1voUzC4x1k0u63AqIPz8W0Gv9XhFgSoMRGCHlVRMjeeKw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GsvHQavf7uNlQ8d/3oXOF87+GvxVIS7rl+xPiEGXnHP+bBUzAqaNm79hvp6eEOelgsqnMdrw+/UPYXBqUqOTa5pnRU4tFNgDa9nLm4urO01I3oavRBVKe/vBSZY0cmZCNUfeMdAy448tzUkbPFZ+HA0L678ORN689HKD3GlNknbjj/aa/inu26GRcHgxm6ZoaTp4vnJIX0csxabEjE6nXT7No/iQFEwefWDC2u9zDR33iE8JiBL/QdUGhtOfICUkWaWMVhHbQwy1/JhuPajet2bj67dnvUlXiTo9kDSgmRpWiIUCJN5wOqA3M1VNKsXEe2jfnCtxL0fSMYuJw4vVOA==
- Authentication-results: ucw.cz; dkim=none (message not signed) header.d=none;ucw.cz; dmarc=none action=none header.from=wdc.com;
- Cc: "linux-xfs@xxxxxxxxxxxxxxx" <linux-xfs@xxxxxxxxxxxxxxx>, "linux-fsdevel@xxxxxxxxxxxxxxx" <linux-fsdevel@xxxxxxxxxxxxxxx>, "dm-devel@xxxxxxxxxx" <dm-devel@xxxxxxxxxx>, "linux-block@xxxxxxxxxxxxxxx" <linux-block@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "drbd-dev@xxxxxxxxxxxxxxxx" <drbd-dev@xxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-nvme@xxxxxxxxxxxxxxxxxxx" <linux-nvme@xxxxxxxxxxxxxxxxxxx>, "linux-scsi@xxxxxxxxxxxxxxx" <linux-scsi@xxxxxxxxxxxxxxx>, "target-devel@xxxxxxxxxxxxxxx" <target-devel@xxxxxxxxxxxxxxx>, "linux-fscrypt@xxxxxxxxxxxxxxx" <linux-fscrypt@xxxxxxxxxxxxxxx>, "jfs-discussion@xxxxxxxxxxxxxxxxxxxxx" <jfs-discussion@xxxxxxxxxxxxxxxxxxxxx>, "linux-nilfs@xxxxxxxxxxxxxxx" <linux-nilfs@xxxxxxxxxxxxxxx>, "ocfs2-devel@xxxxxxxxxxxxxx" <ocfs2-devel@xxxxxxxxxxxxxx>, "linux-pm@xxxxxxxxxxxxxxx" <linux-pm@xxxxxxxxxxxxxxx>, "linux-mm@xxxxxxxxx" <linux-mm@xxxxxxxxx>, "axboe@xxxxxxxxx" <axboe@xxxxxxxxx>, "philipp.reisner@xxxxxxxxxx" <philipp.reisner@xxxxxxxxxx>, "lars.ellenberg@xxxxxxxxxx" <lars.ellenberg@xxxxxxxxxx>, "konrad.wilk@xxxxxxxxxx" <konrad.wilk@xxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>, "minchan@xxxxxxxxxx" <minchan@xxxxxxxxxx>, "ngupta@xxxxxxxxxx" <ngupta@xxxxxxxxxx>, "sergey.senozhatsky.work@xxxxxxxxx" <sergey.senozhatsky.work@xxxxxxxxx>, "agk@xxxxxxxxxx" <agk@xxxxxxxxxx>, "snitzer@xxxxxxxxxx" <snitzer@xxxxxxxxxx>, "hch@xxxxxx" <hch@xxxxxx>, "sagi@xxxxxxxxxxx" <sagi@xxxxxxxxxxx>, "martin.petersen@xxxxxxxxxx" <martin.petersen@xxxxxxxxxx>, "viro@xxxxxxxxxxxxxxxxxx" <viro@xxxxxxxxxxxxxxxxxx>, "tytso@xxxxxxx" <tytso@xxxxxxx>, "jaegeuk@xxxxxxxxxx" <jaegeuk@xxxxxxxxxx>, "ebiggers@xxxxxxxxxx" <ebiggers@xxxxxxxxxx>, "djwong@xxxxxxxxxx" <djwong@xxxxxxxxxx>, "shaggy@xxxxxxxxxx" <shaggy@xxxxxxxxxx>, "konishi.ryusuke@xxxxxxxxx" <konishi.ryusuke@xxxxxxxxx>, "mark@xxxxxxxxxx" <mark@xxxxxxxxxx>, "jlbec@xxxxxxxxxxxx" <jlbec@xxxxxxxxxxxx>, "joseph.qi@xxxxxxxxxxxxxxxxx" <joseph.qi@xxxxxxxxxxxxxxxxx>, Damien Le Moal <Damien.LeMoal@xxxxxxx>, Naohiro Aota <Naohiro.Aota@xxxxxxx>, "jth@xxxxxxxxxx" <jth@xxxxxxxxxx>, "rjw@xxxxxxxxxxxxx" <rjw@xxxxxxxxxxxxx>, "len.brown@xxxxxxxxx" <len.brown@xxxxxxxxx>, "akpm@xxxxxxxxxxxxxxxxxxxx" <akpm@xxxxxxxxxxxxxxxxxxxx>, "hare@xxxxxxx" <hare@xxxxxxx>, "gustavoars@xxxxxxxxxx" <gustavoars@xxxxxxxxxx>, "tiwai@xxxxxxx" <tiwai@xxxxxxx>, "alex.shi@xxxxxxxxxxxxxxxxx" <alex.shi@xxxxxxxxxxxxxxxxx>, "asml.silence@xxxxxxxxx" <asml.silence@xxxxxxxxx>, "ming.lei@xxxxxxxxxx" <ming.lei@xxxxxxxxxx>, "tj@xxxxxxxxxx" <tj@xxxxxxxxxx>, "osandov@xxxxxx" <osandov@xxxxxx>, "bvanassche@xxxxxxx" <bvanassche@xxxxxxx>, "jefflexu@xxxxxxxxxxxxxxxxx" <jefflexu@xxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 18 Feb 2021 01:28:35 +0000
- Ironport-sdr: 4M88/9R/M4HR78hDDgozsqeLNcrKDcQhQIJmP9TXkmbtTPL6yPoZ1bM7xqHkXXxRFDDdTwigus mX5gd0CwlopugYCRTtOHQJopUAAsTISKaYaw4apfQyBsiluX3a4Rjf7VpS2Lf3x7MzVjK/nTdx djmGlB7C12dt0Rta8wMbhG6TZWfwu4HmiE1uxo6qqVm89CyfifeWMzkq23vWWRp6oFDDG6pKxJ IGK+ZbjuTPsRQYy55cOH0fLinw9UoYX1CD67RhnSXlGc+WYIAKau3aAnc6EaAEKVzmR4RuLma5 7b0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHW9UVtzcRBxm47UEq6Z+ZGJ3C99A==
- Thread-topic: [RFC PATCH 29/34] power/swap: use bio_new in hib_submit_io
- Wdcipoutbound: EOP-TRUE
On 2/17/21 14:03, Pavel Machek wrote:
> Hi!
>> 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);
>>
> C function with 6 arguments... dunno. Old version looks comparable or
> even more readable...
>
> Best regards,
> Pavel
The library functions that are in the kernel tree which are used
in different file-systems and fabrics drivers do take 6 arguments.
Plus what is the point of duplicating code for mandatory
parameters all over the kernel ?
|