[Ocfs2-commits] mfasheh commits r1663 - branches/dlm-glue/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Nov 22 21:37:19 CST 2004


Author: mfasheh
Date: 2004-11-22 21:37:18 -0600 (Mon, 22 Nov 2004)
New Revision: 1663

Modified:
   branches/dlm-glue/src/journal.c
   branches/dlm-glue/src/namei.c
   branches/dlm-glue/src/ocfs.h
   branches/dlm-glue/src/super.c
Log:
* ocfs_malloc was hardly used so lets take this opportunity to get rid of it.



Modified: branches/dlm-glue/src/journal.c
===================================================================
--- branches/dlm-glue/src/journal.c	2004-11-23 03:33:47 UTC (rev 1662)
+++ branches/dlm-glue/src/journal.c	2004-11-23 03:37:18 UTC (rev 1663)
@@ -207,7 +207,7 @@
 {
 	ocfs_journal_handle * retval = NULL;
 
-	retval = ocfs_malloc(sizeof(*retval));
+	retval = kmalloc(sizeof(*retval), GFP_KERNEL);
 	if (!retval) {
 		LOG_ERROR_STR("Failed to allocate memory for journal handle!");
 		return(NULL);
@@ -737,7 +737,7 @@
 }
 
 /*
-  if the journal has been ocfs_malloc'd it needs to be freed after this call.
+  if the journal has been kmalloc'd it needs to be freed after this call.
 */
 void ocfs_journal_shutdown(ocfs_super *osb) 
 {
@@ -848,7 +848,7 @@
 	}
 
 	/* Launch the commit thread */
-	osb->commit = ocfs_malloc(sizeof(ocfs_commit_task));
+	osb->commit = kmalloc(sizeof(ocfs_commit_task), GFP_KERNEL);
 	if (osb->commit == NULL) {
 		LOG_ERROR_STATUS(status = -ENOMEM);
 		goto done;

Modified: branches/dlm-glue/src/namei.c
===================================================================
--- branches/dlm-glue/src/namei.c	2004-11-23 03:33:47 UTC (rev 1662)
+++ branches/dlm-glue/src/namei.c	2004-11-23 03:37:18 UTC (rev 1663)
@@ -1383,7 +1383,7 @@
 		goto bail;
 	}
 
-	bhs = ocfs_malloc(sizeof(struct buffer_head *) * blocks);
+	bhs = kmalloc(sizeof(struct buffer_head *) * blocks, GFP_KERNEL);
 	if (!bhs) {
 		status = -ENOMEM;
 		LOG_ERROR_STATUS(status);

Modified: branches/dlm-glue/src/ocfs.h
===================================================================
--- branches/dlm-glue/src/ocfs.h	2004-11-23 03:33:47 UTC (rev 1662)
+++ branches/dlm-glue/src/ocfs.h	2004-11-23 03:37:18 UTC (rev 1663)
@@ -101,17 +101,6 @@
 ** Structures...
 */
 
-
-static inline void *ocfs_malloc(size_t size)
-{
-	void *p = kmalloc(size, GFP_KERNEL);
-	if (p)
-		memset(p, 0, size);
-	return p;
-}
-
-
-
 #define  OCFS_NAME              "OCFS2"
 
 /* ioctl commands */

Modified: branches/dlm-glue/src/super.c
===================================================================
--- branches/dlm-glue/src/super.c	2004-11-23 03:33:47 UTC (rev 1662)
+++ branches/dlm-glue/src/super.c	2004-11-23 03:37:18 UTC (rev 1663)
@@ -917,7 +917,7 @@
 		goto leave;
 	}
 
-	if ((osb = ocfs_malloc (sizeof (ocfs_super))) == NULL) {
+	if ((osb = kmalloc (sizeof(ocfs_super), GFP_KERNEL)) == NULL) {
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto leave;
 	}



More information about the Ocfs2-commits mailing list