Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* Landed b_cray_portals_merge.
[fs/lustre-release.git]
/
lustre
/
obdclass
/
lustre_peer.c
diff --git
a/lustre/obdclass/lustre_peer.c
b/lustre/obdclass/lustre_peer.c
index
1e227e1
..
8298fc3
100644
(file)
--- a/
lustre/obdclass/lustre_peer.c
+++ b/
lustre/obdclass/lustre_peer.c
@@
-42,7
+42,6
@@
struct uuid_nid_data {
ptl_nid_t nid;
char *uuid;
__u32 nal;
ptl_nid_t nid;
char *uuid;
__u32 nal;
- ptl_handle_ni_t ni;
};
/* FIXME: This should probably become more elegant than a global linked list */
};
/* FIXME: This should probably become more elegant than a global linked list */
@@
-61,8
+60,7
@@
void class_exit_uuidlist(void)
class_del_uuid(NULL);
}
class_del_uuid(NULL);
}
-int lustre_uuid_to_peer(char *uuid,
- ptl_handle_ni_t *peer_ni, ptl_nid_t *peer_nid)
+int lustre_uuid_to_peer(char *uuid, __u32 *peer_nal, ptl_nid_t *peer_nid)
{
struct list_head *tmp;
{
struct list_head *tmp;
@@
-74,7
+72,7
@@
int lustre_uuid_to_peer(char *uuid,
if (strcmp(data->uuid, uuid) == 0) {
*peer_nid = data->nid;
if (strcmp(data->uuid, uuid) == 0) {
*peer_nid = data->nid;
- *peer_n
i = data->ni
;
+ *peer_n
al = data->nal
;
spin_unlock (&g_uuid_lock);
return 0;
spin_unlock (&g_uuid_lock);
return 0;
@@
-87,7
+85,6
@@
int lustre_uuid_to_peer(char *uuid,
int class_add_uuid(char *uuid, __u64 nid, __u32 nal)
{
int class_add_uuid(char *uuid, __u64 nid, __u32 nal)
{
- const ptl_handle_ni_t *nip;
struct uuid_nid_data *data;
int rc;
int nob = strnlen (uuid, PAGE_SIZE) + 1;
struct uuid_nid_data *data;
int rc;
int nob = strnlen (uuid, PAGE_SIZE) + 1;
@@
-95,26
+92,21
@@
int class_add_uuid(char *uuid, __u64 nid, __u32 nal)
if (nob > PAGE_SIZE)
return -EINVAL;
if (nob > PAGE_SIZE)
return -EINVAL;
- nip = kportal_get_ni (nal);
- if (nip == NULL) {
- CERROR("get_ni failed: is the NAL module loaded?\n");
- return -EIO;
- }
-
rc = -ENOMEM;
OBD_ALLOC(data, sizeof(*data));
if (data == NULL)
rc = -ENOMEM;
OBD_ALLOC(data, sizeof(*data));
if (data == NULL)
-
goto fail_0
;
+
return -ENOMEM
;
OBD_ALLOC(data->uuid, nob);
OBD_ALLOC(data->uuid, nob);
- if (data == NULL)
- goto fail_1;
+ if (data == NULL) {
+ OBD_FREE(data, sizeof(*data));
+ return -ENOMEM;
+ }
CDEBUG(D_INFO, "add uuid %s "LPX64" %u\n", uuid, nid, nal);
memcpy(data->uuid, uuid, nob);
data->nid = nid;
data->nal = nal;
CDEBUG(D_INFO, "add uuid %s "LPX64" %u\n", uuid, nid, nal);
memcpy(data->uuid, uuid, nob);
data->nid = nid;
data->nal = nal;
- data->ni = *nip;
spin_lock (&g_uuid_lock);
spin_lock (&g_uuid_lock);
@@
-123,12
+115,6
@@
int class_add_uuid(char *uuid, __u64 nid, __u32 nal)
spin_unlock (&g_uuid_lock);
return 0;
spin_unlock (&g_uuid_lock);
return 0;
-
- fail_1:
- OBD_FREE (data, sizeof (*data));
- fail_0:
- kportal_put_ni (nal);
- return (rc);
}
/* delete only one entry if uuid is specified, otherwise delete all */
}
/* delete only one entry if uuid is specified, otherwise delete all */
@@
-164,7
+150,6
@@
int class_del_uuid (char *uuid)
list_del (&data->head);
list_del (&data->head);
- kportal_put_ni (data->nal);
OBD_FREE(data->uuid, strlen(data->uuid) + 1);
OBD_FREE(data, sizeof(*data));
} while (!list_empty (&deathrow));
OBD_FREE(data->uuid, strlen(data->uuid) + 1);
OBD_FREE(data, sizeof(*data));
} while (!list_empty (&deathrow));