Changeset 8885
- Timestamp:
- 06/13/11 12:53:38 (2 years ago)
- Location:
- branches/test-slab-cache-patch/src/kernel/linux-2.6
- Files:
-
- 2 modified
-
pvfs2-cache.c (modified) (6 diffs)
-
pvfs2-utils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/test-slab-cache-patch/src/kernel/linux-2.6/pvfs2-cache.c
r7426 r8885 203 203 } 204 204 205 206 static void dev_req_cache_ctor(207 #if defined(HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM)208 void *req209 #elif defined(HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM)210 struct kmem_cache *cachep,211 void *req212 #else213 void *req,214 pvfs2_kmem_cache_t * cachep,215 unsigned long flags216 #endif217 )218 {219 memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE));220 }221 222 205 int dev_req_cache_initialize(void) 223 206 { 224 207 dev_req_cache = kmem_cache_create( 225 208 "pvfs2_devreqcache", MAX_ALIGNED_DEV_REQ_DOWNSIZE, 0, 226 PVFS2_CACHE_CREATE_FLAGS, dev_req_cache_ctor209 PVFS2_CACHE_CREATE_FLAGS, NULL 227 210 #ifdef HAVE_KMEM_CACHE_CREATE_DESTRUCTOR_PARAM 228 211 , NULL … … 256 239 { 257 240 gossip_err("Failed to allocate from dev_req_cache\n"); 241 } 242 else 243 { 244 memset(buffer, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE)); 258 245 } 259 246 return buffer; … … 288 275 pvfs2_inode_t *pvfs2_inode = req; 289 276 290 memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t));291 277 ClearInitFlag(pvfs2_inode); 292 293 278 pvfs2_inode_initialize(pvfs2_inode); 294 279 … … 378 363 gossip_err("Failed to allocate pvfs2_inode\n"); 379 364 } 380 else { 365 else 366 { 367 ClearInitFlag(pvfs2_inode); 368 pvfs2_inode_initialize(pvfs2_inode); 381 369 add_to_pinode_list(pvfs2_inode); 382 370 } … … 399 387 #ifdef HAVE_AIO_VFS_SUPPORT 400 388 401 static void kiocb_ctor(402 #if defined(HAVE_KMEM_CACHE_CREATE_CTOR_ONE_PARAM)403 void *req404 #elif defined(HAVE_KMEM_CACHE_CREATE_CTOR_TWO_PARAM)405 struct kmem_cache *cachep,406 void *req407 #else408 void *req,409 pvfs2_kmem_cache_t * cachep,410 unsigned long flags411 #endif412 )413 {414 memset(req, 0, sizeof(pvfs2_kiocb));415 }416 417 418 389 int kiocb_cache_initialize(void) 419 390 { 420 391 pvfs2_kiocb_cache = kmem_cache_create( 421 392 "pvfs2_kiocbcache", sizeof(pvfs2_kiocb), 0, 422 PVFS2_CACHE_CREATE_FLAGS, kiocb_ctor393 PVFS2_CACHE_CREATE_FLAGS, NULL 423 394 #ifdef HAVE_KMEM_CACHE_CREATE_DESTRUCTOR_PARAM 424 395 , NULL … … 452 423 { 453 424 gossip_err("kiocb_alloc: kmem_cache_alloc failed!\n"); 425 } 426 else 427 { 428 memset(x, 0, sizeof(pvfs2_kiocb)); 454 429 } 455 430 return x; -
branches/test-slab-cache-patch/src/kernel/linux-2.6/pvfs2-utils.c
r8215 r8885 1998 1998 } 1999 1999 2000 /* 2001 We want to clear everything except for rw_semaphore and the vfs_inode 2002 */ 2000 2003 void pvfs2_inode_initialize(pvfs2_inode_t *pvfs2_inode) 2001 2004 { … … 2007 2010 memset(pvfs2_inode->link_target, 0, sizeof(pvfs2_inode->link_target)); 2008 2011 pvfs2_inode->error_code = 0; 2012 pvfs2_inode->revalidate_failed = 0; 2013 pvfs2_inode->pinode_flags = 0; 2009 2014 SetInitFlag(pvfs2_inode); 2010 2015 }
