* between getting its string and using it.
*/
-#define LNET_NIDSTR_COUNT 128 /* # of nidstrings */
-#define LNET_NIDSTR_SIZE 32 /* size of each one (see below for usage) */
-
static char libcfs_nidstrings[LNET_NIDSTR_COUNT][LNET_NIDSTR_SIZE];
static int libcfs_nidstring_idx = 0;
struct nid_stat *new_stat, *old_stat;
struct obd_device *obd = NULL;
cfs_proc_dir_entry_t *entry;
+ char *buffer = NULL;
int rc = 0;
ENTRY;
GOTO(destroy_new, rc = -EALREADY);
}
/* not found - create */
- new_stat->nid_proc = lprocfs_register(libcfs_nid2str(*nid),
+ OBD_ALLOC(buffer, LNET_NIDSTR_SIZE);
+ if (buffer == NULL)
+ GOTO(destroy_new, rc = -ENOMEM);
+
+ memcpy(buffer, libcfs_nid2str(*nid), LNET_NIDSTR_SIZE);
+ new_stat->nid_proc = lprocfs_register(buffer,
obd->obd_proc_exports_entry,
NULL, NULL);
+ OBD_FREE(buffer, LNET_NIDSTR_SIZE);
+
if (new_stat->nid_proc == NULL) {
CERROR("Error making export directory for nid %s\n",
libcfs_nid2str(*nid));