[Pvfs2-cvs] commit by pw in pvfs2/src/kernel/linux-2.6:
pvfs2-cache.c pvfs2-kernel.h pvfs2-utils.c
CVS commit program
cvs at parl.clemson.edu
Tue Jul 17 18:03:31 EDT 2007
Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv1435/src/kernel/linux-2.6
Modified Files:
pvfs2-cache.c pvfs2-kernel.h pvfs2-utils.c
Log Message:
murali: update kernel module to track kmem_cache_create API changes in 2.6.22; should work on older kernels fine too.
Index: pvfs2-cache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-cache.c,v
diff -u -p -p -u -r1.41 -r1.42
--- pvfs2-cache.c 13 Jun 2007 20:14:56 -0000 1.41
+++ pvfs2-cache.c 17 Jul 2007 22:03:31 -0000 1.42
@@ -282,20 +282,6 @@ static void pvfs2_inode_cache_ctor(
init_rwsem(&pvfs2_inode->xattr_sem);
}
-static void pvfs2_inode_cache_dtor(
- void *old_pvfs2_inode,
- pvfs2_kmem_cache_t * cachep,
- unsigned long flags)
-{
- pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)old_pvfs2_inode;
-
- if (pvfs2_inode && pvfs2_inode->link_target)
- {
- kfree(pvfs2_inode->link_target);
- pvfs2_inode->link_target = NULL;
- }
-}
-
static inline void add_to_pinode_list(pvfs2_inode_t *pvfs2_inode)
{
spin_lock(&pvfs2_inode_list_lock);
@@ -316,8 +302,7 @@ int pvfs2_inode_cache_initialize(void)
{
pvfs2_inode_cache = kmem_cache_create(
"pvfs2_inode_cache", sizeof(pvfs2_inode_t), 0,
- PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor,
- pvfs2_inode_cache_dtor);
+ PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor, NULL);
if (!pvfs2_inode_cache)
{
Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -u -p -p -u -r1.141 -r1.142
--- pvfs2-kernel.h 2 Feb 2007 02:40:12 -0000 1.141
+++ pvfs2-kernel.h 17 Jul 2007 22:03:31 -0000 1.142
@@ -363,7 +363,7 @@ typedef struct
typedef struct
{
PVFS_object_ref refn;
- char *link_target;
+ char link_target[PVFS_NAME_MAX];
/*
* Reading/Writing Extended attributes need to acquire the appropriate
* reader/writer semaphore on the pvfs2_inode_t structure.
Index: pvfs2-utils.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-utils.c,v
diff -u -p -p -u -r1.147 -r1.148
--- pvfs2-utils.c 9 Nov 2006 20:29:33 -0000 1.147
+++ pvfs2-utils.c 17 Jul 2007 22:03:31 -0000 1.148
@@ -288,17 +288,7 @@ int copy_attributes_to_inode(
/* copy link target to inode private data */
if (pvfs2_inode && symname)
{
- if (pvfs2_inode->link_target)
- {
- kfree(pvfs2_inode->link_target);
- pvfs2_inode->link_target = NULL;
- }
- pvfs2_inode->link_target = kmalloc(
- (strlen(symname) + 1), PVFS2_GFP_FLAGS);
- if (pvfs2_inode->link_target)
- {
- strcpy(pvfs2_inode->link_target, symname);
- }
+ strncpy(pvfs2_inode->link_target, symname, PVFS_NAME_MAX);
gossip_debug(GOSSIP_UTILS_DEBUG, "Copied attr link target %s\n",
pvfs2_inode->link_target);
}
@@ -1956,7 +1946,7 @@ void pvfs2_inode_initialize(pvfs2_inode_
pvfs2_inode->refn.handle = PVFS_HANDLE_NULL;
pvfs2_inode->refn.fs_id = PVFS_FS_ID_NULL;
pvfs2_inode->last_failed_block_index_read = 0;
- pvfs2_inode->link_target = NULL;
+ memset(pvfs2_inode->link_target, 0, sizeof(pvfs2_inode->link_target));
pvfs2_inode->error_code = 0;
SetInitFlag(pvfs2_inode);
}
@@ -1964,7 +1954,6 @@ void pvfs2_inode_initialize(pvfs2_inode_
/*
this is called from super:pvfs2_destroy_inode.
- pvfs2_inode_cache_dtor frees the link_target if any
*/
void pvfs2_inode_finalize(pvfs2_inode_t *pvfs2_inode)
{
More information about the Pvfs2-cvs
mailing list