aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/checkpoint.c3
-rw-r--r--fs/f2fs/data.c2
-rw-r--r--fs/f2fs/node.c2
-rw-r--r--fs/f2fs/segment.c2
-rw-r--r--fs/f2fs/segment.h8
5 files changed, 8 insertions, 9 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index a1786d680906..b4a813345de2 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -83,8 +83,7 @@ struct page *get_meta_page_ra(struct f2fs_sb_info *sbi, pgoff_t index)
83 f2fs_put_page(page, 0); 83 f2fs_put_page(page, 0);
84 84
85 if (readahead) 85 if (readahead)
86 ra_meta_pages(sbi, index, 86 ra_meta_pages(sbi, index, MAX_BIO_BLOCKS(sbi), META_POR);
87 MAX_BIO_BLOCKS(max_hw_blocks(sbi)), META_POR);
88 return get_meta_page(sbi, index); 87 return get_meta_page(sbi, index);
89} 88}
90 89
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index fdc3dbe677a1..7749f305b102 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -193,7 +193,7 @@ void f2fs_submit_page_mbio(struct f2fs_sb_info *sbi, struct page *page,
193 __submit_merged_bio(io); 193 __submit_merged_bio(io);
194alloc_new: 194alloc_new:
195 if (io->bio == NULL) { 195 if (io->bio == NULL) {
196 int bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi)); 196 int bio_blocks = MAX_BIO_BLOCKS(sbi);
197 197
198 io->bio = __bio_alloc(sbi, blk_addr, bio_blocks, is_read); 198 io->bio = __bio_alloc(sbi, blk_addr, bio_blocks, is_read);
199 io->fio = *fio; 199 io->fio = *fio;
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 7a2d9c980c96..21ed91b3cb54 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1697,7 +1697,7 @@ int restore_node_summary(struct f2fs_sb_info *sbi,
1697 struct f2fs_summary *sum_entry; 1697 struct f2fs_summary *sum_entry;
1698 struct inode *inode = sbi->sb->s_bdev->bd_inode; 1698 struct inode *inode = sbi->sb->s_bdev->bd_inode;
1699 block_t addr; 1699 block_t addr;
1700 int bio_blocks = MAX_BIO_BLOCKS(max_hw_blocks(sbi)); 1700 int bio_blocks = MAX_BIO_BLOCKS(sbi);
1701 struct page *pages[bio_blocks]; 1701 struct page *pages[bio_blocks];
1702 int i, idx, last_offset, nrpages, err = 0; 1702 int i, idx, last_offset, nrpages, err = 0;
1703 1703
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index c6f627b492cd..4ea53aab786d 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1757,7 +1757,7 @@ static void build_sit_entries(struct f2fs_sb_info *sbi)
1757 int sit_blk_cnt = SIT_BLK_CNT(sbi); 1757 int sit_blk_cnt = SIT_BLK_CNT(sbi);
1758 unsigned int i, start, end; 1758 unsigned int i, start, end;
1759 unsigned int readed, start_blk = 0; 1759 unsigned int readed, start_blk = 0;
1760 int nrpages = MAX_BIO_BLOCKS(max_hw_blocks(sbi)); 1760 int nrpages = MAX_BIO_BLOCKS(sbi);
1761 1761
1762 do { 1762 do {
1763 readed = ra_meta_pages(sbi, start_blk, nrpages, META_SIT); 1763 readed = ra_meta_pages(sbi, start_blk, nrpages, META_SIT);
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index c6f37f2fe50e..848ac519958f 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -93,8 +93,8 @@
93 (((sector_t)blk_addr) << (sbi)->log_sectors_per_block) 93 (((sector_t)blk_addr) << (sbi)->log_sectors_per_block)
94#define SECTOR_TO_BLOCK(sbi, sectors) \ 94#define SECTOR_TO_BLOCK(sbi, sectors) \
95 (sectors >> (sbi)->log_sectors_per_block) 95 (sectors >> (sbi)->log_sectors_per_block)
96#define MAX_BIO_BLOCKS(max_hw_blocks) \ 96#define MAX_BIO_BLOCKS(sbi) \
97 (min((int)max_hw_blocks, BIO_MAX_PAGES)) 97 ((int)min((int)max_hw_blocks(sbi), BIO_MAX_PAGES))
98 98
99/* 99/*
100 * indicate a block allocation direction: RIGHT and LEFT. 100 * indicate a block allocation direction: RIGHT and LEFT.
@@ -728,7 +728,7 @@ static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
728 else if (type == NODE) 728 else if (type == NODE)
729 return 3 * sbi->blocks_per_seg; 729 return 3 * sbi->blocks_per_seg;
730 else if (type == META) 730 else if (type == META)
731 return MAX_BIO_BLOCKS(max_hw_blocks(sbi)); 731 return MAX_BIO_BLOCKS(sbi);
732 else 732 else
733 return 0; 733 return 0;
734} 734}
@@ -751,7 +751,7 @@ static inline long nr_pages_to_write(struct f2fs_sb_info *sbi, int type,
751 else if (type == NODE) 751 else if (type == NODE)
752 desired = 3 * max_hw_blocks(sbi); 752 desired = 3 * max_hw_blocks(sbi);
753 else 753 else
754 desired = MAX_BIO_BLOCKS(max_hw_blocks(sbi)); 754 desired = MAX_BIO_BLOCKS(sbi);
755 755
756 wbc->nr_to_write = desired; 756 wbc->nr_to_write = desired;
757 return desired - nr_to_write; 757 return desired - nr_to_write;