From: <vl...@us...> - 2007-08-07 17:12:43
|
Revision: 156 http://scst.svn.sourceforge.net/scst/?rev=156&view=rev Author: vlnb Date: 2007-08-07 10:12:21 -0700 (Tue, 07 Aug 2007) Log Message: ----------- - Implemented temporary workaround to work on 2.6.22+ kernels - qla2x00-target/ChangeLog updated - Typo in scst_page.html fixed Modified Paths: -------------- trunk/qla2x00t/qla2x00-target/ChangeLog trunk/scst/src/scst_mem.c trunk/www/scst_page.html Modified: trunk/qla2x00t/qla2x00-target/ChangeLog =================================================================== --- trunk/qla2x00t/qla2x00-target/ChangeLog 2007-08-03 09:57:15 UTC (rev 155) +++ trunk/qla2x00t/qla2x00-target/ChangeLog 2007-08-07 17:12:21 UTC (rev 156) @@ -3,12 +3,15 @@ - Support for per-target default security groups added. - - Update to work on 2.6.19.x. + - Update to work on the latest kernel (2.6.22.x). - Updated to work with SCST 0.9.6. + - /proc support routines changed to work with seq_file interface. + - Cleanups and minor bug fixes. + Summary of changes between versions 0.9.3.8 and 0.9.5 ----------------------------------------------------- Modified: trunk/scst/src/scst_mem.c =================================================================== --- trunk/scst/src/scst_mem.c 2007-08-03 09:57:15 UTC (rev 155) +++ trunk/scst/src/scst_mem.c 2007-08-07 17:12:21 UTC (rev 156) @@ -42,16 +42,17 @@ */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) -#error 2.6.22+ kernels are not supported yet, because some oversmart nerd \ -has deleted support for destructors from SLABs in those kernels and was \ -unresponsible enough to made that without even set it in the deprecated \ -status for some time to allow depending on it projects fix it without \ -disturbing their users. Blame him for that! So, now to be usable on \ -2.6.22+ kernels SCST requires a complete rewrite of one of its major low \ +#warning SCST on 2.6.22+ kernels will run in performance degraded mode, \ +because some oversmart mainline kernel developers have deleted in those \ +kernels support for destructors in SLAB cache and they were unresponsible \ +enough to made that change without even set that feature in the deprecated \ +status for some time to allow depending on it projects to fix themself without \ +disturbing their users. Blame those people for that! So, now to run in full \ +power on those kernels SCST requires a complete rewrite of one of its major low \ level parts: all kmem_cache_*() functions in this file should be replaced \ with new ones with similar functionality. I'm not sure I will have time for \ -that in the near future, therefore you are welcome to implement that. \ -Don't hesitate to ask me how to do it most effectively. VLNB. +that in the near future, therefore you are welcome to implement it. Don't \ +hesitate to ask me how I think it should be done most effectively. VLNB. #endif /* Chosen to have one page per slab for all orders */ @@ -68,6 +69,10 @@ DEFINE_MUTEX(scst_sgv_pool_mutex); LIST_HEAD(scst_sgv_pool_list); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) +static void sgv_dtor(void *data, struct kmem_cache *k, unsigned long f); +#endif + static int scst_check_clustering(struct scatterlist *sg, int cur, int hint) { int res = -1; @@ -481,9 +486,12 @@ } out_fail_free: - if (cache) + if (cache) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + sgv_dtor(obj, NULL, 0); +#endif kmem_cache_free(pool->caches[order], obj); - else + } else kfree(obj); out_fail: @@ -505,8 +513,12 @@ "sg_count %d, allocator_priv %p", sgv, sgv->owner_cache, sgv->sg_entries, sgv->sg_count, sgv->allocator_priv); if (sgv->owner_cache != NULL) { + struct kmem_cache *c = sgv->owner_cache; sgv->sg_entries[sgv->orig_sg].length = sgv->orig_length; - kmem_cache_free(sgv->owner_cache, sgv); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + sgv_dtor(sgv, NULL, 0); +#endif + kmem_cache_free(c, sgv); } else { sgv->owner_pool->alloc_fns.free_pages_fn(sgv->sg_entries, sgv->sg_count, sgv->allocator_priv); @@ -545,6 +557,9 @@ } kfree(obj->sg_entries); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + memset(obj, 0, sizeof(*obj)); +#endif return; } @@ -635,8 +650,13 @@ scnprintf(pool->cache_names[i], sizeof(pool->cache_names[i]), "%s-%luK", name, (PAGE_SIZE >> 10) << i); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) pool->caches[i] = kmem_cache_create(pool->cache_names[i], + size, 0, SCST_SLAB_FLAGS, sgv_ctor, NULL); +#else + pool->caches[i] = kmem_cache_create(pool->cache_names[i], size, 0, SCST_SLAB_FLAGS, sgv_ctor, sgv_dtor); +#endif if (pool->caches[i] == NULL) { TRACE(TRACE_OUT_OF_MEM, "Allocation of sgv_pool cache " "%s(%d) failed", name, i); Modified: trunk/www/scst_page.html =================================================================== --- trunk/www/scst_page.html 2007-08-03 09:57:15 UTC (rev 155) +++ trunk/www/scst_page.html 2007-08-07 17:12:21 UTC (rev 156) @@ -92,8 +92,6 @@ </li> <li> Complete SMP support.<br> </li> - <li> <br> - </li> <li>Well documented.<br> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |