diff options
-rw-r--r-- | fs/ceph/super.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 6ddc0bca56b2..7d377c9a5e35 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
@@ -479,6 +479,8 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, | |||
479 | CEPH_FEATURE_FLOCK | | 479 | CEPH_FEATURE_FLOCK | |
480 | CEPH_FEATURE_DIRLAYOUTHASH; | 480 | CEPH_FEATURE_DIRLAYOUTHASH; |
481 | const unsigned required_features = 0; | 481 | const unsigned required_features = 0; |
482 | int page_count; | ||
483 | size_t size; | ||
482 | int err = -ENOMEM; | 484 | int err = -ENOMEM; |
483 | 485 | ||
484 | fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); | 486 | fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); |
@@ -522,8 +524,9 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt, | |||
522 | 524 | ||
523 | /* set up mempools */ | 525 | /* set up mempools */ |
524 | err = -ENOMEM; | 526 | err = -ENOMEM; |
525 | fsc->wb_pagevec_pool = mempool_create_kmalloc_pool(10, | 527 | page_count = fsc->mount_options->wsize >> PAGE_CACHE_SHIFT; |
526 | fsc->mount_options->wsize >> PAGE_CACHE_SHIFT); | 528 | size = sizeof (struct page *) * (page_count ? page_count : 1); |
529 | fsc->wb_pagevec_pool = mempool_create_kmalloc_pool(10, size); | ||
527 | if (!fsc->wb_pagevec_pool) | 530 | if (!fsc->wb_pagevec_pool) |
528 | goto fail_trunc_wq; | 531 | goto fail_trunc_wq; |
529 | 532 | ||