Lines 203-216
Link Here
|
203 |
pvfs2_kmem_cache_t * cachep, |
203 |
pvfs2_kmem_cache_t * cachep, |
204 |
unsigned long flags) |
204 |
unsigned long flags) |
205 |
{ |
205 |
{ |
206 |
if (flags & SLAB_CTOR_CONSTRUCTOR) |
206 |
memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE)); |
207 |
{ |
|
|
208 |
memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE)); |
209 |
} |
210 |
else |
211 |
{ |
212 |
gossip_err("WARNING!! devreq_ctor called without ctor flag\n"); |
213 |
} |
214 |
} |
207 |
} |
215 |
|
208 |
|
216 |
int dev_req_cache_initialize(void) |
209 |
int dev_req_cache_initialize(void) |
Lines 269-313
Link Here
|
269 |
{ |
262 |
{ |
270 |
pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)new_pvfs2_inode; |
263 |
pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)new_pvfs2_inode; |
271 |
|
264 |
|
272 |
if (flags & SLAB_CTOR_CONSTRUCTOR) |
265 |
memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t)); |
273 |
{ |
266 |
ClearInitFlag(pvfs2_inode); |
274 |
memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t)); |
|
|
275 |
ClearInitFlag(pvfs2_inode); |
276 |
|
267 |
|
277 |
pvfs2_inode_initialize(pvfs2_inode); |
268 |
pvfs2_inode_initialize(pvfs2_inode); |
278 |
|
269 |
|
279 |
#ifndef PVFS2_LINUX_KERNEL_2_4 |
270 |
#ifndef PVFS2_LINUX_KERNEL_2_4 |
280 |
/* |
271 |
/* |
281 |
inode_init_once is from 2.6.x's inode.c; it's normally run |
272 |
inode_init_once is from 2.6.x's inode.c; it's normally run |
282 |
when an inode is allocated by the system's inode slab |
273 |
when an inode is allocated by the system's inode slab |
283 |
allocator. we call it here since we're overloading the |
274 |
allocator. we call it here since we're overloading the |
284 |
system's inode allocation with this routine, thus we have |
275 |
system's inode allocation with this routine, thus we have |
285 |
to init vfs inodes manually |
276 |
to init vfs inodes manually |
286 |
*/ |
277 |
*/ |
287 |
inode_init_once(&pvfs2_inode->vfs_inode); |
278 |
inode_init_once(&pvfs2_inode->vfs_inode); |
288 |
pvfs2_inode->vfs_inode.i_version = 1; |
279 |
pvfs2_inode->vfs_inode.i_version = 1; |
289 |
#endif |
280 |
#endif |
290 |
/* Initialize the reader/writer semaphore */ |
281 |
/* Initialize the reader/writer semaphore */ |
291 |
init_rwsem(&pvfs2_inode->xattr_sem); |
282 |
init_rwsem(&pvfs2_inode->xattr_sem); |
292 |
} |
|
|
293 |
else |
294 |
{ |
295 |
gossip_err("WARNING!! inode_ctor called without ctor flag\n"); |
296 |
} |
297 |
} |
298 |
|
299 |
static void pvfs2_inode_cache_dtor( |
300 |
void *old_pvfs2_inode, |
301 |
pvfs2_kmem_cache_t * cachep, |
302 |
unsigned long flags) |
303 |
{ |
304 |
pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)old_pvfs2_inode; |
305 |
|
306 |
if (pvfs2_inode && pvfs2_inode->link_target) |
307 |
{ |
308 |
kfree(pvfs2_inode->link_target); |
309 |
pvfs2_inode->link_target = NULL; |
310 |
} |
311 |
} |
283 |
} |
312 |
|
284 |
|
313 |
static inline void add_to_pinode_list(pvfs2_inode_t *pvfs2_inode) |
285 |
static inline void add_to_pinode_list(pvfs2_inode_t *pvfs2_inode) |
Lines 330-337
Link Here
|
330 |
{ |
302 |
{ |
331 |
pvfs2_inode_cache = kmem_cache_create( |
303 |
pvfs2_inode_cache = kmem_cache_create( |
332 |
"pvfs2_inode_cache", sizeof(pvfs2_inode_t), 0, |
304 |
"pvfs2_inode_cache", sizeof(pvfs2_inode_t), 0, |
333 |
PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor, |
305 |
PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor, NULL); |
334 |
pvfs2_inode_cache_dtor); |
|
|
335 |
|
306 |
|
336 |
if (!pvfs2_inode_cache) |
307 |
if (!pvfs2_inode_cache) |
337 |
{ |
308 |
{ |
Lines 403-416
Link Here
|
403 |
pvfs2_kmem_cache_t * cachep, |
374 |
pvfs2_kmem_cache_t * cachep, |
404 |
unsigned long flags) |
375 |
unsigned long flags) |
405 |
{ |
376 |
{ |
406 |
if (flags & SLAB_CTOR_CONSTRUCTOR) |
377 |
memset(req, 0, sizeof(pvfs2_kiocb)); |
407 |
{ |
|
|
408 |
memset(req, 0, sizeof(pvfs2_kiocb)); |
409 |
} |
410 |
else |
411 |
{ |
412 |
gossip_err("WARNING!! kiocb_ctor called without ctor flag\n"); |
413 |
} |
414 |
} |
378 |
} |
415 |
|
379 |
|
416 |
|
380 |
|