diff options
author | Chao Yu <chao2.yu@samsung.com> | 2013-09-22 15:50:50 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-09-24 17:45:48 +0900 |
commit | cc7b1bb173676621b092b61d22d8d12b05efb5e8 (patch) | |
tree | 440612ad80fa325aa3a5b316b5f25d87ff6a0f81 /fs/f2fs/segment.h | |
parent | a57e564d14d9d123b2dd4ff1c933da0d900e0b1d (diff) | |
download | linux-cc7b1bb173676621b092b61d22d8d12b05efb5e8.tar.gz linux-cc7b1bb173676621b092b61d22d8d12b05efb5e8.tar.bz2 linux-cc7b1bb173676621b092b61d22d8d12b05efb5e8.zip |
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>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r-- | fs/f2fs/segment.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index bdd10eab8c40..7f94d78cda3d 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -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 { |