|
@@ -102,8 +102,6 @@
|
|
|
(((sector_t)blk_addr) << F2FS_LOG_SECTORS_PER_BLOCK)
|
|
|
#define SECTOR_TO_BLOCK(sectors) \
|
|
|
(sectors >> F2FS_LOG_SECTORS_PER_BLOCK)
|
|
|
-#define MAX_BIO_BLOCKS(sbi) \
|
|
|
- ((int)min((int)max_hw_blocks(sbi), BIO_MAX_PAGES))
|
|
|
|
|
|
/*
|
|
|
* indicate a block allocation direction: RIGHT and LEFT.
|
|
@@ -696,13 +694,6 @@ static inline bool sec_usage_check(struct f2fs_sb_info *sbi, unsigned int secno)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-static inline unsigned int max_hw_blocks(struct f2fs_sb_info *sbi)
|
|
|
-{
|
|
|
- struct block_device *bdev = sbi->sb->s_bdev;
|
|
|
- struct request_queue *q = bdev_get_queue(bdev);
|
|
|
- return SECTOR_TO_BLOCK(queue_max_sectors(q));
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* It is very important to gather dirty pages and write at once, so that we can
|
|
|
* submit a big bio without interfering other data writes.
|
|
@@ -720,7 +711,7 @@ static inline int nr_pages_to_skip(struct f2fs_sb_info *sbi, int type)
|
|
|
else if (type == NODE)
|
|
|
return 8 * sbi->blocks_per_seg;
|
|
|
else if (type == META)
|
|
|
- return 8 * MAX_BIO_BLOCKS(sbi);
|
|
|
+ return 8 * BIO_MAX_PAGES;
|
|
|
else
|
|
|
return 0;
|
|
|
}
|
|
@@ -737,11 +728,9 @@ static inline long nr_pages_to_write(struct f2fs_sb_info *sbi, int type,
|
|
|
return 0;
|
|
|
|
|
|
nr_to_write = wbc->nr_to_write;
|
|
|
-
|
|
|
+ desired = BIO_MAX_PAGES;
|
|
|
if (type == NODE)
|
|
|
- desired = 2 * max_hw_blocks(sbi);
|
|
|
- else
|
|
|
- desired = MAX_BIO_BLOCKS(sbi);
|
|
|
+ desired <<= 1;
|
|
|
|
|
|
wbc->nr_to_write = desired;
|
|
|
return desired - nr_to_write;
|