diff options
Diffstat (limited to 'fs/exofs/super.c')
-rw-r--r-- | fs/exofs/super.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/exofs/super.c b/fs/exofs/super.c index 78f5ad633d3b..e87510f4749e 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c | |||
@@ -390,6 +390,23 @@ static int _read_and_match_data_map(struct exofs_sb_info *sbi, unsigned numdevs, | |||
390 | return 0; | 390 | return 0; |
391 | } | 391 | } |
392 | 392 | ||
393 | static unsigned __ra_pages(struct exofs_layout *layout) | ||
394 | { | ||
395 | const unsigned _MIN_RA = 32; /* min 128K read-ahead */ | ||
396 | unsigned ra_pages = layout->group_width * layout->stripe_unit / | ||
397 | PAGE_SIZE; | ||
398 | unsigned max_io_pages = exofs_max_io_pages(layout, ~0); | ||
399 | |||
400 | ra_pages *= 2; /* two stripes */ | ||
401 | if (ra_pages < _MIN_RA) | ||
402 | ra_pages = roundup(_MIN_RA, ra_pages / 2); | ||
403 | |||
404 | if (ra_pages > max_io_pages) | ||
405 | ra_pages = max_io_pages; | ||
406 | |||
407 | return ra_pages; | ||
408 | } | ||
409 | |||
393 | /* @odi is valid only as long as @fscb_dev is valid */ | 410 | /* @odi is valid only as long as @fscb_dev is valid */ |
394 | static int exofs_devs_2_odi(struct exofs_dt_device_info *dt_dev, | 411 | static int exofs_devs_2_odi(struct exofs_dt_device_info *dt_dev, |
395 | struct osd_dev_info *odi) | 412 | struct osd_dev_info *odi) |
@@ -623,6 +640,7 @@ static int exofs_fill_super(struct super_block *sb, void *data, int silent) | |||
623 | } | 640 | } |
624 | 641 | ||
625 | /* set up operation vectors */ | 642 | /* set up operation vectors */ |
643 | sbi->bdi.ra_pages = __ra_pages(&sbi->layout); | ||
626 | sb->s_bdi = &sbi->bdi; | 644 | sb->s_bdi = &sbi->bdi; |
627 | sb->s_fs_info = sbi; | 645 | sb->s_fs_info = sbi; |
628 | sb->s_op = &exofs_sops; | 646 | sb->s_op = &exofs_sops; |