diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/exofs/inode.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 3b2ee72aecbe..1562c27a2fab 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c | |||
| @@ -37,15 +37,12 @@ | |||
| 37 | 37 | ||
| 38 | #define EXOFS_DBGMSG2(M...) do {} while (0) | 38 | #define EXOFS_DBGMSG2(M...) do {} while (0) |
| 39 | 39 | ||
| 40 | enum {MAX_PAGES_KMALLOC = PAGE_SIZE / sizeof(struct page *), }; | ||
| 41 | |||
| 42 | unsigned exofs_max_io_pages(struct ore_layout *layout, | 40 | unsigned exofs_max_io_pages(struct ore_layout *layout, |
| 43 | unsigned expected_pages) | 41 | unsigned expected_pages) |
| 44 | { | 42 | { |
| 45 | unsigned pages = min_t(unsigned, expected_pages, MAX_PAGES_KMALLOC); | 43 | unsigned pages = min_t(unsigned, expected_pages, |
| 44 | layout->max_io_length / PAGE_SIZE); | ||
| 46 | 45 | ||
| 47 | /* TODO: easily support bio chaining */ | ||
| 48 | pages = min_t(unsigned, pages, layout->max_io_length / PAGE_SIZE); | ||
| 49 | return pages; | 46 | return pages; |
| 50 | } | 47 | } |
| 51 | 48 | ||
| @@ -101,7 +98,8 @@ static void _pcol_reset(struct page_collect *pcol) | |||
| 101 | * it might not end here. don't be left with nothing | 98 | * it might not end here. don't be left with nothing |
| 102 | */ | 99 | */ |
| 103 | if (!pcol->expected_pages) | 100 | if (!pcol->expected_pages) |
| 104 | pcol->expected_pages = MAX_PAGES_KMALLOC; | 101 | pcol->expected_pages = |
| 102 | exofs_max_io_pages(&pcol->sbi->layout, ~0); | ||
| 105 | } | 103 | } |
| 106 | 104 | ||
| 107 | static int pcol_try_alloc(struct page_collect *pcol) | 105 | static int pcol_try_alloc(struct page_collect *pcol) |
