Skip to content

Commit

Permalink
erofs: shorten bvecs[] for file-backed mounts
Browse files Browse the repository at this point in the history
BIO_MAX_VECS is too large for __GFP_NOFAIL allocation.  We could use
a mempool (since BIOs can always proceed), but it seems overly
complicated for now.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250107082825.74242-1-hsiangkao@linux.alibaba.com
  • Loading branch information
Gao Xiang committed Jan 16, 2025
1 parent 54ab25d commit 9f74ae8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/erofs/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <trace/events/erofs.h>

struct erofs_fileio_rq {
struct bio_vec bvecs[BIO_MAX_VECS];
struct bio_vec bvecs[16];
struct bio bio;
struct kiocb iocb;
struct super_block *sb;
Expand Down Expand Up @@ -68,7 +68,7 @@ static struct erofs_fileio_rq *erofs_fileio_rq_alloc(struct erofs_map_dev *mdev)
struct erofs_fileio_rq *rq = kzalloc(sizeof(*rq),
GFP_KERNEL | __GFP_NOFAIL);

bio_init(&rq->bio, NULL, rq->bvecs, BIO_MAX_VECS, REQ_OP_READ);
bio_init(&rq->bio, NULL, rq->bvecs, ARRAY_SIZE(rq->bvecs), REQ_OP_READ);
rq->iocb.ki_filp = mdev->m_dif->file;
rq->sb = mdev->m_sb;
return rq;
Expand Down

0 comments on commit 9f74ae8

Please sign in to comment.