Fixes crash on very big buffers allocations reported by Matteo Tescione <matteo@rmnet.it> and others

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1527 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2010-03-01 19:41:14 +00:00
parent a041986db3
commit 6463e79a7c

View File

@@ -1329,7 +1329,7 @@ static int sgv_pool_init(struct sgv_pool *pool, const char *name,
pool->purge_interval = SGV_DEFAULT_PURGE_INTERVAL;
if (single_alloc_pages == 0) {
pool->max_caches = SGV_POOL_ELEMENTS;
pool->max_cached_pages = 1 << SGV_POOL_ELEMENTS;
pool->max_cached_pages = 1 << (SGV_POOL_ELEMENTS - 1);
} else {
pool->max_caches = 1;
pool->max_cached_pages = single_alloc_pages;