[RFC PATCH 23/34] fs/mpage.c: use bio_new mpage_alloc
[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 23/34] fs/mpage.c: use bio_new mpage_alloc
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:22 -0800
- In-reply-to: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Ironport-sdr: eR4rkKeZG+rbkBxixHoRdNezHV8pDF1zC0Mg6AxDzm7Chn0GXqpY8TwnUuQwts9+UiShR0ugPx dBPMh6lKeuoe7C7CBhEHpvCbGMiFcmk8CRItjWwjQDcuDB2fR9ZFIJE1NdJiZ2+/Ob46pSR02K zCYAcNqFVUMuPpSADHFQh9YNJibXxzD5y1SO9PC5hkOnmwnvEaiusSNYFD7Bt94ypURxJaNkMm uL7bmVae3wei/ROIR0LrdN5Aht7nOQTYzCTVeEoq8jhKMf7JbCMr+RB2L+J2KB1Ltn+rSsWTMk PAQ=
- Ironport-sdr: bm6iwWpjOfZ/qPbrHwU5clEMvD+MV3im/2zF6CP8Vx6WjW6+Fyt2JkGKOs4GZaVC0kMpJM255w /ZHmcPmFXrk2wb8Tso9hshlGQXaMaVc8HWZqEUeExVj1faaBS85SLfzt6n/1mI0T/rDCrenMEw CO+J/ZDOUOmNC09NpldhTQ8jln+D1hN6Wh0rFjwhsjmSQAKgfuU3l7NQqxHZgHYQuZ+kyM162d ouBR4yDRBQ1U25Ucc3u7SCnzAOHD3+LMkGCnWFzZBLNcP3/f2NyPAdZNzNgIekT7cbNDikXahm Ia5Uezgnjin7X0xr9aqu68Re
- Ironport-sdr: m1TZ+g0HqYnNuuEaVgIMmloDXGiOQeWVkBatefSwdP931h6/Qc9uK8rnz+JHWAn0f3QBmOsUC2 fXJ41UlgQQnfdBQndrwCq+hQtl7mr6AQW85+ZjLVP2rPUrLfDej915AJE+NjNtCGI740sa3D8g UGQ9bx3fpoJbY98zSPHF13CT5IYtiyfyvVxvvVA5VfTuNLKWU4ZEgYs5jdqkUbRYa6sajX3DSU E+nFYRIRokBPoO+x05JGw6lqTR47HYfSK6LYXKwXfQUKv6zaLN0igntqoauBJYDwbicxGnznwF roE=
- References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Wdcironportexception: Internal
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
fs/mpage.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/fs/mpage.c b/fs/mpage.c
index 830e6cc2a9e7..01725126e81f 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -68,25 +68,21 @@ static struct bio *mpage_bio_submit(int op, int op_flags, struct bio *bio)
}
static struct bio *
-mpage_alloc(struct block_device *bdev,
- sector_t first_sector, int nr_vecs,
- gfp_t gfp_flags)
+mpage_alloc(struct block_device *bdev, sector_t first_sector, int nr_vecs,
+ gfp_t gfp_flags)
{
struct bio *bio;
/* Restrict the given (page cache) mask for slab allocations */
gfp_flags &= GFP_KERNEL;
- bio = bio_alloc(gfp_flags, nr_vecs);
+ bio = bio_new(bdev, first_sector, 0, 0, nr_vecs, gfp_flags);
if (bio == NULL && (current->flags & PF_MEMALLOC)) {
while (!bio && (nr_vecs /= 2))
- bio = bio_alloc(gfp_flags, nr_vecs);
+ bio = bio_new(bdev, first_sector, 0, 0, nr_vecs,
+ gfp_flags);
}
- if (bio) {
- bio_set_dev(bio, bdev);
- bio->bi_iter.bi_sector = first_sector;
- }
return bio;
}
@@ -304,9 +300,7 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
goto out;
}
args->bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
- min_t(int, args->nr_pages,
- BIO_MAX_PAGES),
- gfp);
+ args->nr_pages, gfp);
if (args->bio == NULL)
goto confused;
}
--
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]