mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
f2fs: avoid allocating failure in bio_alloc
This patch add macro MAX_BIO_BLOCKS to limit value of npages in f2fs_bio_alloc, it can avoid allocating failure in bio_alloc caused by npages is larger than BIO_MAX_PAGES. Signed-off-by: Yu Chao <chao2.yu@samsung.com> Reviewed-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
parent
a57e564d14
commit
cc7b1bb173
2 changed files with 5 additions and 1 deletions
|
@ -90,6 +90,8 @@
|
|||
(blk_addr << ((sbi)->log_blocksize - F2FS_LOG_SECTOR_SIZE))
|
||||
#define SECTOR_TO_BLOCK(sbi, sectors) \
|
||||
(sectors >> ((sbi)->log_blocksize - F2FS_LOG_SECTOR_SIZE))
|
||||
#define MAX_BIO_BLOCKS(max_hw_blocks) \
|
||||
(min((int)max_hw_blocks, BIO_MAX_PAGES))
|
||||
|
||||
/* during checkpoint, bio_private is used to synchronize the last bio */
|
||||
struct bio_private {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue