[Pvfs2-cvs] commit by slang in pvfs2/src/kernel/linux-2.6: pvfs2-bufmap.c pvfs2-kernel.h

CVS commit program cvs at parl.clemson.edu
Thu Feb 1 21:47:27 EST 2007


Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv5147/src/kernel/linux-2.6

Modified Files:
      Tag: pvfs-2-6-branch
	pvfs2-bufmap.c pvfs2-kernel.h 
Log Message:
kzalloc checks


Index: pvfs2-bufmap.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-bufmap.c,v
diff -p -u -r1.46.8.4 -r1.46.8.5
--- pvfs2-bufmap.c	9 Jan 2007 07:20:41 -0000	1.46.8.4
+++ pvfs2-bufmap.c	2 Feb 2007 02:47:27 -0000	1.46.8.5
@@ -63,7 +63,7 @@ static int initialize_bufmap_descriptors
     if (desc_array == NULL)
     {
         gossip_err("pvfs2: could not allocate %d bytes\n",
-                ndescs * sizeof(struct pvfs_bufmap_desc));
+		(int) (ndescs * sizeof(struct pvfs_bufmap_desc)));
         goto out1;
     }
     err = 0;

Index: pvfs2-kernel.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-kernel.h,v
diff -p -u -r1.137.2.2 -r1.137.2.3
--- pvfs2-kernel.h	11 Nov 2006 18:54:16 -0000	1.137.2.2
+++ pvfs2-kernel.h	2 Feb 2007 02:47:27 -0000	1.137.2.3
@@ -1258,6 +1258,21 @@ static inline unsigned int diff(struct t
     return ((end->tv_sec * 1000000) + end->tv_usec);
 }
 
+#ifndef HAVE_KZALLOC
+static inline void *kzalloc(size_t size, int flags)
+{
+	void * ptr;
+
+	ptr = kmalloc(size, flags);
+	if(!ptr)
+	{
+		return ptr;
+	}
+	memset(ptr, 0, size);
+	return ptr;
+}
+#endif
+
 #endif /* __PVFS2KERNEL_H */
 
 /* @} */



More information about the Pvfs2-cvs mailing list