FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-24-2009, 02:25 PM
Konrad Rzeszutek
 
Default Update the documentation for path checkers and use MALLOC instead of malloc in one path checker.

The internal memory debugger throws a fit if the path checkers are
using the malloc instead of the 'MALLOC' macro.
---
libmultipath/checkers.h | 4 ++--
libmultipath/checkers/emc_clariion.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h
index b610e6b..23b1c46 100644
--- a/libmultipath/checkers.h
+++ b/libmultipath/checkers.h
@@ -36,7 +36,7 @@
* - Description: Indicates path not available for "normal" operations
*
* PATH_GHOST:
- * - Use: Only hp_sw
+ * - Use: Only hp_sw and rdac
* - Description: Indicates a "passive/standby" path on active/passive HP
* arrays. These paths will return valid answers to certain SCSI commands
* (tur, read_capacity, inquiry, start_stop), but will fail I/O commands.
@@ -101,7 +101,7 @@ struct checker {
char message[CHECKER_MSG_LEN]; /* comm with callers */
void * context; /* store for persistent data */
void ** mpcontext; /* store for persistent data
- shared multipath-wide */
+ shared multipath-wide. Use MALLOC if you want to stuff data in. */
int (*check)(struct checker *);
int (*init)(struct checker *); /* to allocate the context */
void (*free)(struct checker *); /* to free the context */
diff --git a/libmultipath/checkers/emc_clariion.c b/libmultipath/checkers/emc_clariion.c
index 9eac31d..200daee 100644
--- a/libmultipath/checkers/emc_clariion.c
+++ b/libmultipath/checkers/emc_clariion.c
@@ -10,6 +10,7 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
+#include <memory.h>

#include "../libmultipath/sg_include.h"
#include "libsg.h"
@@ -76,7 +77,7 @@ int libcheck_init (struct checker * c)
* Allocate and initialize the multi-path global context.
*/
if (c->mpcontext) {
- void * mpctxt = malloc(sizeof(int));
+ void * mpctxt = MALLOC(sizeof(int));
*c->mpcontext = mpctxt;
CLR_INACTIVE_SNAP(c);
}
--
1.5.4.1

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 09:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org